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

9.1-release9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since f9fc934 was f9fc934, checked in by Kris Moore <kris@…>, 17 months ago

Add new menu bar, not yet functional

Display messages from pkgng as they happen

Offer to save file if something goes bad

  • Property mode set to 100644
File size: 2.7 KB
RevLine 
[3f4caf6]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>
[4b9e67a]16#include <pcbsd-ui.h>
[3f4caf6]17#include "ui_mainWin.h"
18#include "../config.h"
19
20/* Change this to switch the default patch tmpdir */
21const QString PATCHTMPDIR_DEFAULT( PREFIX + "/tmp" );
22#define SYSTRIGGER "/tmp/.sysupdatetraytrigger"
23
[f9fc934]24class mainWin : public QMainWindow, private Ui::mainWin
[3f4caf6]25{
26        Q_OBJECT
27
28public:
[f9fc934]29        mainWin() : QMainWindow()
[3f4caf6]30        {
31          setupUi(this);
32        }
33
34    QMap <QString, QString> codeMap;
35
36public slots:
[4b9e67a]37    void ProgramInit(QString);
[3f4caf6]38    void slotSingleInstance();
39
40private slots:
41    void slotCloseClicked();
[4b9e67a]42   
43    // Generic pkgng handlers
44    void slotReadPkgOutput();
45    void slotPkgDone();
46
47    // Meta-Packages
48    void slotFinishLoadingMetaPkgs();
49    void slotGetPackageDataOutput();
50    void slotApplyClicked();
[3f4caf6]51
52    // Package updates
53    void slotRescanPkgsClicked();
54    void slotUpdatePkgsClicked();
[4b9e67a]55    void slotApplyMetaChanges();
56    void slotDeskPkgsChanged(QTreeWidgetItem *aItem, int __unused);
57    void slotMetaRightClick();
58    void slotMetaViewPkgs();
[3f4caf6]59
60private:
[4b9e67a]61    // Generic pkg process handlers
[f9fc934]62    void prepPkgProcess();
[4b9e67a]63    void startPkgProcess();
64    QList<QStringList> pkgCmdList;
[f9fc934]65    bool pkgHasFailed;
[4b9e67a]66
67    // Updates
[3f4caf6]68    void doUpdates();
69    bool sanityCheck();
[4b9e67a]70
[3f4caf6]71    int curUpdate;
72    int curUpdateIndex;
73    int totUpdate;
74    bool dPackages;
75    bool uPackages;
76    bool doingUpdate;
77    QProcess *uProc;
78    QList<QStringList> listUpdates;
79    QString wDir, wIP;
80    QString lastError;
81    QSocketNotifier *eSock;
82
[4b9e67a]83
84    // Meta-Packages
85    void initMetaWidget();
86    void populateMetaPkgs();
87    void addTreeItems(QString parent);
88    bool isMetaPkgInstalled(QString mPkg);
89    void checkMPKGUpdates();
90    void parseTmpMetaList();
91    void saveMetaPkgs();
92    void startMetaChanges();
93    bool haveAMetaDesktop();
94    bool haveMetaPkgChanges();
95    QString getAddPkgs();
96    QString getDelPkgs();
97    bool allChildrenPkgsChecked(QString parent);
98    bool allChildrenPkgsUnchecked(QString parent);
99    void checkAllChildrenPkgs(QString parent);
100    void uncheckAllChildrenPkgs(QString parent);
101    QString getLineFromCommandOutput( QString cmd );
102
103    QList<QStringList> metaPkgList;
104    QStringList tmpMetaPkgList;
105    QString addPkgs;
106    QString delPkgs;
107    QString pkgSource;
[f9fc934]108    QString curFileText;
109    QProcess *getMetaProc;
[4b9e67a]110    QString chrootArg1;
111    QString chrootArg2;
112    bool canceled;
113    QMenu *popup;
114    dialogInfo *dIB;
115
[3f4caf6]116signals:
117
118} ;
119#endif // MAINWIN_H
120
Note: See TracBrowser for help on using the repository browser.