source: src-qt4/pc-sysmanager/longProc.h @ e9a3917

releng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since e9a3917 was e9a3917, checked in by Ken Moore <ken@…>, 9 months ago

Finish cleaning up the new system manager ports/source checkout functionality.
Also create a backend class that just contains a bunch of static functions for simple usage elsewhere (like generating ports update commands). This will make it easy to update the utility later if URL's or other system calls change (since we don't need to worry about all the GUI-specific stuff getting mixed in).

  • Property mode set to 100644
File size: 925 bytes
Line 
1#ifndef _LONG_PROGRESS_H
2#define _LONG_PROGRESS_H
3
4#include <QObject>
5#include <QProcess>
6#include <QFile>
7#include <QString>
8#include <QStringList>
9#include <QDebug>
10#include <QTimer>
11
12class LongProc : public QObject{
13        Q_OBJECT
14public:
15       
16        LongProc();
17        ~LongProc();
18       
19        //Quick-start functions for specific tasks
20        bool startCMDs(QStringList cmds, QStringList dirs, QStringList info);
21        void stopProc();
22
23        //Information functions
24        bool isRunning(){ return running; } //so you can double check whether it is still running
25
26private:
27        QProcess *process;
28        bool running, stopped;
29        QStringList cmdList, infoList, dirList;
30        int currentItem;
31        QTimer *timer;
32
33private slots:
34        void parseUpdate(); //New process message from internal worker
35        void procDone(); //internal worker finished
36        void procTimeout(); //internal timeout signal
37
38signals:
39        void ProcMessage(QString); //a new message while it is running
40        void ProcFinished();
41};
42#endif
Note: See TracBrowser for help on using the repository browser.