-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDownloadManager.h
More file actions
68 lines (59 loc) · 1.81 KB
/
DownloadManager.h
File metadata and controls
68 lines (59 loc) · 1.81 KB
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
#ifndef COMET_DOWNLOADMANAGER_H
#define COMET_DOWNLOADMANAGER_H
#include <QWidget>
#include <QtWidgets>
#include "SFTPSite.h"
class DownloadManager : public QWidget
{
Q_OBJECT
public:
explicit DownloadManager(QWidget *parent = 0);
void getDataFromParent(QStringList data);
void setCredentials(QStringList credentials);
signals:
//void downloadFinished(int a);
void initThread(std::string host, std::string user, std::string pass, std::string port);
void startDownload(QString source, QString destination);
void startUpload(QString source, QString destination);
// Status Area Updating
void setProgress(int progress);
void setFileName(QString fileName);
void setNumFiles(int numFiles);
void sendPauseClick();
void sendCancelClick();
void setSpeed(QString speed);
private:
std::string host, user, password, port;
QTableWidget* table;
QStringList queue;
SFTPSite* sftp;
SFTPSite* site;
QThread* thread;
int numRows;
QString destination;
QString destinationTemp;
bool downloading;
bool isAlive;
int percentage;
int fileCounter;
enum returnCodes {
DLOAD_FILE_EXISTS,
DLOAD_COMPLETE,
DLOAD_FAILED,
DLOAD_OVERWRITE,
DLOAD_CANCEL,
DLOAD_ERROR
};
public slots:
// Thread slots
void receivePercentage();
void receiveDownloadComplete(int a);
void receiveCancelClick();
void receivePauseClick();
void receiveSpeed(int bytes);
void addData(QString _type, QString _source, QString _destination, QString sftpType);
void addLocalFolder(QString path);
void addServerFolder(QString path, QString destination);
void receiveCredentials(std::string _host, std::string _user, std::string _password, std::string _port);
};
#endif // COMET_DOWNLOADMANAGER_H