forked from compilelife/feiq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
filemanagerdlg.h
55 lines (42 loc) · 1.1 KB
/
filemanagerdlg.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
#ifndef DOWNLOADFILEDLG_H
#define DOWNLOADFILEDLG_H
#include <QDialog>
#include <memory>
#include "feiqlib/filetask.h"
#include "feiqlib/feiqengine.h"
using namespace std;
namespace Ui {
class DownloadFileDlg;
}
class FileManagerDlg : public QDialog
{
Q_OBJECT
typedef function<bool (const FileTask &)> SearchPredict;
public:
explicit FileManagerDlg(QWidget *parent = 0);
~FileManagerDlg();
public:
void setEngine(FeiqEngine* engine);
void select(FileTask* task);
public slots:
void statChanged(FileTask* task);
void progressChanged(FileTask* task);
private slots:
void delSelTask();
void saveSelTask();
void clear();
void refresh();
private:
void reloadWith(SearchPredict predict);
QString typeString(FileTaskType type);
QString stateString(const FileTask *task);
QString progressString(const FileTask* task);
FileTask* getTaskOfCurrentRow();
int findRowByTask(const FileTask* task);
protected:
virtual void showEvent(QShowEvent *) override;
private:
Ui::DownloadFileDlg *ui;
FeiqEngine* mEngine;
};
#endif // DOWNLOADFILEDLG_H