This repository has been archived by the owner on Jun 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
minstall.h
124 lines (111 loc) · 3.74 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
//
// Copyright (C) 2003-2009 by Warren Woodford
//
// 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 <sys/mount.h>
#include <sys/stat.h>
#include <sys/swap.h>
#include <sys/types.h>
#include <unistd.h>
#include <qfile.h>
#include <dirent.h>
#include <qmessagebox.h>
#include <qwidget.h>
#include <qprocess.h>
#include <qtimer.h>
#include <qlistview.h>
#include "ui_meinstall.h"
class MInstall : public QWidget, public Ui::MeInstall {
Q_OBJECT
protected:
QProcess *proc;
QTimer *timer;
QTreeWidgetItem *wicdItem;
QTreeWidgetItem *sshItem;
QTreeWidgetItem *transmissionItem;
QTreeWidgetItem *bluetoothItem;
QTreeWidgetItem *cpufreqItem;
QTreeWidgetItem *smartmontoolsItem;
QTreeWidgetItem *acpidItem;
QTreeWidgetItem *acpisupportItem;
QTreeWidgetItem *acpifakekeyItem;
QTreeWidgetItem *dbusItem;
QTreeWidgetItem *cronItem;
QTreeWidgetItem *rsyncItem;
QTreeWidgetItem *gpmItem;
QTreeWidgetItem *sanedItem;
QTreeWidgetItem *cupsItem;
QDialog *mmn;
public:
/** construtor */
MInstall(QWidget* parent=0);
/** destructor */
~MInstall();
bool abortInstall;
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();
void updateStatus(QString msg, int val);
bool mountPartition(QString dev, const char *point);
void prepareToInstall();
bool makeSwapPartition(QString dev);
bool makeLinuxPartition(QString dev, const char *type, bool bad);
bool makeDefaultPartitions();
bool makeChosenPartitions();
void installLinux();
void copyLinux();
bool makeFloppy();
bool installLoader();
void setLocale();
void setServices();
bool setUserName();
bool setPasswords();
bool setUserInfo();
bool setComputerName();
bool removeKernel();
bool makeGrub(int rootdev, QString rootpart, const char *rootmnt, bool initrd);
void updatePartitionWidgets();
bool checkDisk();
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();
virtual void on_rootCombo_activated();
virtual void on_swapCombo_activated();
virtual void on_rootTypeCombo_activated();
void procAbort();
virtual bool close();
// void moreClicked(QListViewItem *item);
void delStart();
void delDone(int exitCode, QProcess::ExitStatus exitStatus);
void delTime();
void copyStart();
void copyDone(int exitCode, QProcess::ExitStatus exitStatus);
void copyTime();
};