-
Notifications
You must be signed in to change notification settings - Fork 4
/
createprogress.h
72 lines (54 loc) · 1.44 KB
/
createprogress.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef CREATEPROGRESS_H
#define CREATEPROGRESS_H
#include <QDialog>
#include <QProcess>
#include <QTimer>
#include <QElapsedTimer>
#include <QSystemTrayIcon>
#include <QAbstractButton>
#ifdef Q_OS_WINDOWS
#include <shobjidl.h>
#endif
namespace Ui {
class CreateProgress;
}
class CreateProgress : public QDialog
{
Q_OBJECT
public:
explicit CreateProgress(QWidget *parent = nullptr);
void run(QStringList args, const QHash<QString, QString>& env, const QByteArray& inFiles, const QString& baseOutput_, const QString& outDir_, const QStringList& outFiles_);
~CreateProgress();
private slots:
void timerTick();
void gotStdout();
void finished(int exitCode, QProcess::ExitStatus exitStatus);
void notificationClicked();
void on_CreateProgress_rejected();
void on_btnBackground_clicked();
void on_btnPause_clicked();
void on_buttonBox_accepted();
void on_btnNotify_clicked();
private:
Ui::CreateProgress *ui;
QProcess parpar;
QString baseOutput;
QString outDir;
QStringList outFiles;
QByteArray stdoutBuffer;
bool isCancelled;
void deleteOutput();
void ended(const QString& error, bool showOutput);
QTimer timer;
quint64 elapsedTimeBase;
QElapsedTimer elapsedTime;
void updateTitlePerc();
#ifdef Q_OS_WINDOWS
ITaskbarList3* pTL;
HWND hWnd;
#endif
QSystemTrayIcon sysTrayIcon;
void init();
void rerun();
};
#endif // CREATEPROGRESS_H