This repository has been archived by the owner on Dec 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
/
mainWin.h
175 lines (145 loc) · 4.05 KB
/
mainWin.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#ifndef MAINWIN_H
#define MAINWIN_H
#include <QCloseEvent>
#include <QDialog>
#include <QFile>
#include <QMenu>
#include <QMessageBox>
#include <QProcess>
#include <QProgressDialog>
#include <QSocketNotifier>
#include <QStringList>
#include <QTextStream>
#include <QTimer>
#include <pcbsd-utils.h>
#include <pcbsd-ui.h>
#include "dialogConfirm.h"
#include "dialogConfig.h"
#include "ui_mainWin.h"
#include "../config.h"
/* Change this to switch the default patch tmpdir */
const QString PATCHTMPDIR_DEFAULT( PREFIX + "/tmp" );
#define SYSTRIGGER "/tmp/.sysupdatetraytrigger"
class mainWin : public QMainWindow, private Ui::mainWin
{
Q_OBJECT
public:
mainWin() : QMainWindow()
{
setupUi(this);
}
QMap <QString, QString> codeMap;
public slots:
void ProgramInit(QString);
void slotSingleInstance();
protected:
void closeEvent(QCloseEvent *event);
private slots:
// Generic pkgng handlers
void slotReadPkgOutput();
void slotPkgDone();
// Meta-Packages
void slotFinishLoadingMetaPkgs();
void slotGetPackageDataOutput();
void slotApplyClicked();
void slotSearchPackages();
// Package updates
void slotRescanPkgsClicked();
void slotUpdatePkgsClicked();
void slotApplyMetaChanges();
void slotDeskPkgsChanged(QTreeWidgetItem *aItem, int __unused);
void slotMetaRightClick();
void slotMetaViewPkgs();
// UI Stuff
void slotViewChanged();
void slotCloseClicked();
// NG Packages
void slotCloseAdvClicked();
void slotGetNGPackageDataOutput();
void slotFinishLoadingNGPkgs();
void slotGetNGInstalledDataOutput();
void slotGetNGInstalledPkgs();
void slotEnableApply();
void slotStartNGChanges();
void slotNGItemChanged();
void slotNGReadInfo();
void slotReadEventPipe();
// Configuration dialog
void slotConfigClicked();
void slotConfigFinished();
private:
// Generic pkg process handlers
void prepPkgProcess();
void startPkgProcess();
QList<QStringList> pkgCmdList;
bool pkgHasFailed;
QString getConflictDetailText();
//Search Iteration
bool performSearch(QString pkgSearch, QTreeWidget *TW, QTreeWidgetItem *SI = 0);
bool searchChildren(QString srch, QTreeWidget *TW, QTreeWidgetItem *CI, bool &started, QTreeWidgetItem *SI);
// Updates
void doUpdates();
bool sanityCheck();
int curUpdate;
int curUpdateIndex;
int totUpdate;
bool dPackages;
bool uPackages;
QProcess *uProc;
QList<QStringList> listUpdates;
QString wDir, wIP;
QString lastError;
QSocketNotifier *eSock;
// Meta-Packages
void initMetaWidget();
void populateMetaPkgs();
void addTreeItems(QString parent);
bool isMetaPkgInstalled(QString mPkg);
void checkMPKGUpdates();
void parseTmpMetaList();
void saveMetaPkgs();
void startMetaChanges();
bool haveAMetaDesktop();
bool haveMetaPkgChanges();
QString getAddPkgs();
QString getDelPkgs();
bool allChildrenPkgsChecked(QString parent);
bool allChildrenPkgsUnchecked(QString parent);
void checkAllChildrenPkgs(QString parent);
void uncheckAllChildrenPkgs(QString parent);
QString getLineFromCommandOutput( QString cmd );
QList<QStringList> metaPkgList;
QStringList tmpMetaPkgList;
QString addPkgs;
QString delPkgs;
QString pkgSource;
QString curFileText;
QProcess *getMetaProc;
// NG Packages
void populateNGPkgs();
void addNGItems();
void applyNGChanges();
QStringList tmpPkgList;
QStringList pkgList;
QStringList pkgDepList;
QStringList pkgRDepList;
QStringList selPkgList;
QStringList pkgRemoveList;
QStringList pkgAddList;
QProcess *getNGProc;
QProcess *getNGInfo;
dialogConfirm *askUserConfirm;
QString chrootArg1;
QString chrootArg2;
QString ConflictList;
bool canceled;
QMenu *popup;
dialogInfo *dIB;
QActionGroup *viewGroup;
// Event pipe process
QProcess *eP;
// Config dialog
dialogConfig *configD;
signals:
} ;
#endif // MAINWIN_H