forked from gazelle-installer/gazelle-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
minstall.h
150 lines (129 loc) · 4.45 KB
/
minstall.h
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
139
140
141
142
143
144
145
146
147
148
149
150
//
// Copyright (C) 2003-2009 by Warren Woodford
// Heavily edited, with permision, by anticapitalista for antiX 2011-2014.
// Heavily revised by dolphin oracle, adrian, and anticaptialista 2018.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include <QFile>
#include <QMessageBox>
#include <QProcess>
#include <QTimer>
#include <QProgressDialog>
#include <sys/stat.h>
#include <sys/swap.h>
#include <unistd.h>
#include <dirent.h>
#include "ui_meinstall.h"
#include "cmd.h"
class MInstall : public QWidget, public Ui::MeInstall {
Q_OBJECT
protected:
QProcess *proc;
QTimer *timer;
QProgressBar *bar;
QDialog *mmn;
public:
/** constructor */
MInstall(QWidget* parent=0, QStringList args = QStringList());
/** destructor */
~MInstall();
bool abortInstall;
int removedItemIndex;
QString removedItem;
QStringList args;
void goBack(QString msg);
void unmountGoBack(QString msg);
// helpers
static QString getCmdOut(QString cmd);
static QStringList getCmdOuts(QString cmd);
static QString getCmdValue(QString cmd, QString key, QString keydel, QString valdel);
static QStringList getCmdValues(QString cmd, QString key, QString keydel, QString valdel);
static bool replaceStringInFile(QString oldtext, QString newtext, QString filepath);
static int getPartitionNumber();
bool is32bit();
bool is64bit();
bool isInsideVB();
bool isGpt(QString drv);
bool isUefi();
void buildServiceList();
void copyLinux();
void installLinux();
void prepareToInstall();
void setLocale();
void setServices();
void updatePartitionWidgets();
void updateStatus(QString msg, int val);
bool checkDisk();
bool installLoader();
bool makeChosenPartitions();
bool makeDefaultPartitions();
bool makeFloppy();
bool makeGrub(int rootdev, QString rootpart, const char *rootmnt, bool initrd);
bool makeLinuxPartition(QString dev, const char *type, bool bad, QString label);
bool makeSwapPartition(QString dev);
bool makeEsp(QString drv, int size);
bool mountPartition(const QString dev, const QString point, const QString mopts);
bool removeKernel();
bool setComputerName();
bool setPasswords();
bool setUserInfo();
bool setUserName();
bool INSTALL_FROM_ROOT_DEVICE;
bool POPULATE_MEDIA_MOUNTPOINTS;
QString PROJECTNAME;
QString PROJECTVERSION;
QString PROJECTSHORTNAME;
QString PROJECTURL;
QString PROJECTFORUM;
QString MIN_ROOT_DEVICE_SIZE;
QString DEFAULT_HOSTNAME;
QString MIN_INSTALL_SIZE;
QString PREFERRED_MIN_INSTALL_SIZE;
QStringList ENABLE_SERVICES;
void setupkeyboardbutton();
void gotoPage(int next);
void pageDisplayed(int next);
int showPage(int curr, int next);
void stopInstall();
void firstRefresh(QDialog *main);
void refresh();
public slots:
virtual void on_passwordCheckBox_stateChanged(int);
virtual void on_nextButton_clicked();
virtual void on_backButton_clicked();
virtual void on_abortInstallButton_clicked();
virtual void on_qtpartedButton_clicked();
virtual void on_diskCombo_activated(QString item = "");
virtual void on_rootCombo_activated(QString item = "");
virtual void on_rootTypeCombo_activated(QString item = "");
void procAbort();
virtual bool close();
// void moreClicked(QListViewItem *item);
void delStart();
void delDone(int, QProcess::ExitStatus exitStatus);
void delTime();
void copyStart();
void copyDone(int, QProcess::ExitStatus exitStatus);
void copyTime();
void procTime();
private slots:
void on_viewServicesButton_clicked();
void on_homeCombo_activated(const QString &arg1);
void on_grubBootCombo_activated(QString item = "");
void on_closeButton_clicked();
void on_encryptCheckBox_toggled(bool checked);
void on_saveHomeCheck_toggled(bool checked);
void on_buttonSetKeyboard_clicked();
private:
Cmd *shellcmd;
};