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

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

Add a new DLProcess class to the libpcbsd utilities. Compiles fine, but untestedyet.

  • Property mode set to 100644
File size: 1006 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 : 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.