-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Start.h
94 lines (75 loc) · 2.25 KB
/
Start.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#pragma once
#include <QObject>
#include <QThread>
#include <QThreadPool>
#include <QString>
//#include <Windows.h>
#include <iostream>
#include <io.h>
#include <string>
#include "HTTP.h"
#define maxDlThreah 3
using namespace std;
static QString threadWorking;
struct llog
{
int module;
QString log;
};
struct stnetspeed
{
bool isdling=false;
LONG64 hisDl;
qint64 hisDlt;
LONG64 dl;
qint64 dlt;
LONG64 total;
void *tid;
QString path;
};
static stnetspeed netspeed[maxDlThreah];
static int totalFile;
static int doneFile;
class Start : public QObject
{
Q_OBJECT
public:
Start(QString dir, QObject *parent);
~Start();
void updaterErr();
void relaytworkMessageBox(int tag,QString title,QString txt);
void stopWork();
QString tNowWork();
bool isdling;
vector<llog*> logList;
void newLog(int module,QString log);
public:
static void dlworking(LONG64 dlnow,LONG64 dltotal,void *tid,QString path);
static void stlog(int module,QString str,int mod);
private:
QThread *workProcess = nullptr;
QThreadPool *tpoolhttp = nullptr;
QString dir;
HTTP *http=nullptr;
HTTP *thttp=nullptr;
private slots:
void work();
void dldone();
public slots:
signals:
void tstart();
void log(int module,QString str,int mod);
signals:
//void tworkError(int errorCode);
void tworkProcess(int a,int b);
void tworkFinished(bool done);
void tworkMessageBox(int tag,QString title,QString txt,bool modal = false);
signals:
/*窗口控制托管信号*/
void changeMainPage(int page,bool done=false);/*修改MainPage,0:进度条 1:选择目录按钮*/
void changeMainPage0label_Text(QString str);/*修改MainPage->Label_Text文本*/
void changeProgressBarValue(int a,int b);/*修改进度条进度*/
void changeProgressBarColor(QString rgba,QString rgbb);
void changePBText(QString str);//修改按钮文本
void updataDlingmag();//强制刷新进度文本
};