source: src-qt4/pc-pkgmanager/mainWin.h @ f3f036a

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since f3f036a was f3f036a, checked in by Ken Moore <ken@…>, 16 months ago

Clean up the new search functionality in pc-pkgmanager. It is now recursive and fast (so no worries about changing the depth of the tree's) The only caveat is that it will not return a top-level item as a search result at the moment.
Also setup the search button to be actively enabled/disabled

  • Property mode set to 100644
File size: 3.7 KB
Line 
1#ifndef MAINWIN_H
2#define MAINWIN_H
3
4#include <QDialog>
5#include <QFile>
6#include <QMenu>
7#include <QMessageBox>
8#include <QProcess>
9#include <QProgressDialog>
10#include <QSocketNotifier>
11#include <QStringList>
12#include <QTextStream>
13#include <QTimer>
14
15#include <pcbsd-utils.h>
16#include <pcbsd-ui.h>
17#include "dialogConfirm.h"
18#include "ui_mainWin.h"
19#include "../config.h"
20
21/* Change this to switch the default patch tmpdir */
22const QString PATCHTMPDIR_DEFAULT( PREFIX + "/tmp" );
23#define SYSTRIGGER "/tmp/.sysupdatetraytrigger"
24
25class mainWin : public QMainWindow, private Ui::mainWin
26{
27        Q_OBJECT
28
29public:
30        mainWin() : QMainWindow()
31        {
32          setupUi(this);
33        }
34
35    QMap <QString, QString> codeMap;
36
37public slots:
38    void ProgramInit(QString);
39    void slotSingleInstance();
40
41private slots:
42   
43    // Generic pkgng handlers
44    void slotReadPkgOutput();
45    void slotPkgDone();
46
47    // Meta-Packages
48    void slotFinishLoadingMetaPkgs();
49    void slotGetPackageDataOutput();
50    void slotApplyClicked();
51    void slotSearchPackages();
52
53    // Package updates
54    void slotRescanPkgsClicked();
55    void slotUpdatePkgsClicked();
56    void slotApplyMetaChanges();
57    void slotDeskPkgsChanged(QTreeWidgetItem *aItem, int __unused);
58    void slotMetaRightClick();
59    void slotMetaViewPkgs();
60
61    // UI Stuff
62    void slotViewChanged();
63    void slotCloseClicked();
64
65    // NG Packages
66    void slotGetNGPackageDataOutput();
67    void slotFinishLoadingNGPkgs();
68    void slotGetNGInstalledDataOutput();
69    void slotGetNGInstalledPkgs();
70    void slotEnableApply();
71    void slotStartNGChanges();
72    void slotNGItemChanged();
73    void slotNGReadInfo();
74
75private:
76    // Generic pkg process handlers
77    void prepPkgProcess();
78    void startPkgProcess();
79    QList<QStringList> pkgCmdList;
80    bool pkgHasFailed;
81    QString getConflictDetailText();
82
83    //Search Iteration
84    bool performSearch(QString pkgSearch, QTreeWidget *TW, QTreeWidgetItem *SI = 0);
85    bool searchChildren(QString srch, QTreeWidget *TW, QTreeWidgetItem *CI, bool &started, QTreeWidgetItem *SI);
86
87    // Updates
88    void doUpdates();
89    bool sanityCheck();
90
91    int curUpdate;
92    int curUpdateIndex;
93    int totUpdate;
94    bool dPackages;
95    bool uPackages;
96    QProcess *uProc;
97    QList<QStringList> listUpdates;
98    QString wDir, wIP;
99    QString lastError;
100    QSocketNotifier *eSock;
101
102
103    // Meta-Packages
104    void initMetaWidget();
105    void populateMetaPkgs();
106    void addTreeItems(QString parent);
107    bool isMetaPkgInstalled(QString mPkg);
108    void checkMPKGUpdates();
109    void parseTmpMetaList();
110    void saveMetaPkgs();
111    void startMetaChanges();
112    bool haveAMetaDesktop();
113    bool haveMetaPkgChanges();
114    QString getAddPkgs();
115    QString getDelPkgs();
116    bool allChildrenPkgsChecked(QString parent);
117    bool allChildrenPkgsUnchecked(QString parent);
118    void checkAllChildrenPkgs(QString parent);
119    void uncheckAllChildrenPkgs(QString parent);
120    QString getLineFromCommandOutput( QString cmd );
121    QList<QStringList> metaPkgList;
122    QStringList tmpMetaPkgList;
123    QString addPkgs;
124    QString delPkgs;
125    QString pkgSource;
126    QString curFileText;
127    QProcess *getMetaProc;
128
129    // NG Packages
130    void populateNGPkgs();
131    void addNGItems();
132    void applyNGChanges();
133    QStringList tmpPkgList;
134    QStringList pkgList;
135    QStringList pkgDepList;
136    QStringList pkgRDepList;
137    QStringList selPkgList;
138    QStringList pkgRemoveList;
139    QStringList pkgAddList;
140    QProcess *getNGProc;
141    QProcess *getNGInfo;
142    dialogConfirm *askUserConfirm;
143
144
145    QString chrootArg1;
146    QString chrootArg2;
147    QString ConflictList;
148    bool canceled;
149    QMenu *popup;
150    dialogInfo *dIB;
151    QActionGroup *viewGroup;
152
153signals:
154
155} ;
156#endif // MAINWIN_H
157
Note: See TracBrowser for help on using the repository browser.