-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstallationhandler.h
More file actions
138 lines (101 loc) · 3.46 KB
/
installationhandler.h
File metadata and controls
138 lines (101 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#ifndef INSTALLATIONHANDLER_H
#define INSTALLATIONHANDLER_H
#include <QDebug>
#include <QLabel>
#include <QMap>
#include <QObject>
#include <QPointer>
#include <QProcess>
#include <QTime>
#include <QWidget>
#include <KF6/KIOCore/KIO/CopyJob>
#include <KF6/KIOCore/KIO/SimpleJob>
#include <KF6/KIOCore/KIO/MkdirJob>
#include <install/configurebootloader.h>
#include <install/initcpio.h>
#include <install/mountboot.h>
#include <install/mountroot.h>
#include <install/unsquash.h>
struct UserAccountData {
QString login;
QString password;
QString name;
QString autoLogin;
};
class InstallationHandler : public QObject
{
Q_OBJECT
public:
explicit InstallationHandler();
~InstallationHandler();
void init(QWidget*);
void unmountPartition(QString partition);
void installSystem();
void copyFiles();
void installBootloader(int, const QString&);
void setUpUsers(QStringList);
void setHostname(const QString &name) { m_hostname = name; }
QString hostname() { return m_hostname; }
void setContinent(const QString &continent) { m_continent = continent; }
QString continent() { return m_continent; }
void setRegion(const QString ®ion) { m_region = region; }
QString region() { return m_region; }
void setKbLayout(const QString &kblayout) { m_kblayout = kblayout; }
QString kblayout() { return m_kblayout; }
void setKbVariant(const QString &kbvariant) { m_kbvariant = kbvariant; }
QString kbvariant() { return m_kbvariant; }
void setTimezone(const QString &time) { m_timezone = time; }
QString timezone() { return m_timezone; }
void setLocale(const QString &loc) { m_locale = loc; }
QString locale() { return m_locale; }
void setKDELangPack(const QString &pack) { m_KDELangPack = pack; }
QString KDELangPack() { return m_KDELangPack; }
void setPackages(const QStringList & packages) { m_packages = packages; }
QStringList packages() const { return m_packages; }
void setRootPassword(QString password) { m_rootPassword = password; }
QString rootPassword() {return m_rootPassword; }
void setRootDevice(const QString& s) { m_rootDevice = s; }
QString rootDevice() { return m_rootDevice; }
void setBootDevice(const QString& s) { m_bootDevice = s; }
QString bootDevice() { return m_bootDevice; }
void setProgressLabel(QLabel* l) { m_progressLabel = l; }
public Q_SLOTS:
void parseUnsquashfsOutput(int);
void unsquashDone(int);
void updateProgress(QString);
void initFinished();
void mountFinished();
void unsquashFinished();
void mkinitcpioFinished();
void installBootloaderFinished();
void unmountFinished();
signals:
void updateInstallProgress(QString);
private:
QPointer<QProcess> m_process;
QProcess *m_initProcess;
MountRoot *m_mountProcess;
UnsquashRoot *m_unsquashProcess;
InitCpio *m_initcpioProcess;
MountBoot *m_mountBoot;
ConfigureBootloader *m_configureBootloader;
QProcess *m_unmountProcess;
QProcess *m_userProcess;
QProcess *m_rootUserProcess;
QLabel *m_progressLabel;
QStringList m_mtab;
UserAccountData m_userAccountData;
QString m_rootPassword;
QStringList m_packages;
QString m_kblayout;
QString m_kbvariant;
QString m_hostname;
QString m_continent;
QString m_region;
QString m_timezone;
QString m_locale;
QString m_KDELangPack;
QString m_rootDevice;
QString m_bootDevice;
};
#endif // INSTALLATIONHANDLER_H