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

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

Add all the new pkg conflict logic to libsh

Will detect if something is going to fail during pkg process and
warn the user either graphically or via CLI

In GUI add detection of the GUI hooks from conflict detection

When we find conflicts, remove them for now. (More advanced logic
may be incoming as I play with it)

  • Property mode set to 100644
File size: 2.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 "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
24class mainWin : public QMainWindow, private Ui::mainWin
25{
26        Q_OBJECT
27
28public:
29        mainWin() : QMainWindow()
30        {
31          setupUi(this);
32        }
33
34    QMap <QString, QString> codeMap;
35
36public slots:
37    void ProgramInit(QString);
38    void slotSingleInstance();
39
40private slots:
41    void slotCloseClicked();
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
52    // Package updates
53    void slotRescanPkgsClicked();
54    void slotUpdatePkgsClicked();
55    void slotApplyMetaChanges();
56    void slotDeskPkgsChanged(QTreeWidgetItem *aItem, int __unused);
57    void slotMetaRightClick();
58    void slotMetaViewPkgs();
59
60private:
61    // Generic pkg process handlers
62    void prepPkgProcess();
63    void startPkgProcess();
64    QList<QStringList> pkgCmdList;
65    bool pkgHasFailed;
66
67    // Updates
68    void doUpdates();
69    bool sanityCheck();
70
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
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;
108    QString curFileText;
109    QProcess *getMetaProc;
110    QString chrootArg1;
111    QString chrootArg2;
112    QString ConflictList;
113    bool canceled;
114    QMenu *popup;
115    dialogInfo *dIB;
116
117signals:
118
119} ;
120#endif // MAINWIN_H
121
Note: See TracBrowser for help on using the repository browser.