source: src-qt4/libpcbsd/utils/pcbsd-DLProcess.h @ dd91d89

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

Minor fix to make the QProcess subclass public within the DLProcess (for running start() and setWorkingDirectory() mostly, as well as raw access to the other QProcess signals/functions)

  • Property mode set to 100644
File size: 1013 bytes
Line 
1#ifndef _PCBSD_DOWNLOAD_PROCESS_H
2#define _PCBSD_DOWNLOAD_PROCESS_H
3
4#include <QProcess>
5#include <QProcessEnvironment>
6#include <QObject>
7#include <QString>
8#include <QDebug>
9#include <QFile>
10
11class DLProcess : public QProcess{
12        Q_OBJECT
13public:
14        DLProcess(QObject* parent = 0);
15        ~DLProcess();
16
17        void setWardenDir(QString wardendir); //If the PKG type is running in a jail (before setting type)
18        void setDLType(QString type); // [PBI, PKG, CDN] - (***ONLY RUN ONCE PER INSTANCE***)
19        bool isRunning();
20
21private:
22        int DLTYPE;
23        QProcess *watcher;
24        QString pipeFile;
25
26        void calculateStats(QString current, QString total, QString speed, QString filename);
27        void parsePBILine(QString line);
28        void parsePKGLine(QString line);
29
30        QString kbToString(double);
31
32private slots:
33        void ProcFinished();
34        void newMessage();
35
36signals:
37        void UpdateMessage(QString); //Any messages not related to download status
38        void UpdatePercent(QString, QString, QString); //percent (XX.x), file size, Other info (speed or filename)
39};
40
41#endif
Note: See TracBrowser for help on using the repository browser.