-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
96 lines (79 loc) · 2.64 KB
/
mainwindow.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
95
96
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QResizeEvent>
#include <QLabel>
#include <QStatusBar>
#include <QAction>
#include <QTextDocument>
#include <QStringList>
#include <QSettings>
#include <QTableWidgetItem>
#include <QModelIndexList>
#include <QClipboard>
#include <QDesktopServices>
#include <QSystemTrayIcon>
#include <QEvent>
#include <QMenu>
#include <QTimer>
#include <QThread>
#include "downloader.h"
#include "settingspanel.h"
#include "addlinkspanel.h"
#include "progressbardelegate.h"
#include "aboutbox.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
enum DOWNLOADSTATES { WAITING = 0, QUEUING, DOWNLOADING, COMPLETED, PAUSED, CANCELLED, ERROR };
int downloadState(const QString &link);
int downloadLast(const QString &link);
int downloadTotal(const QString &link);
public slots:
void updateDownload(QString filename, QString size = "", QString progress = "", QString speed = "", QString eta = "", int state = -1, QString next = "", QString total = "", QString errorString = "ERROR: Generic Error");
signals:
void startNewDownload( void );
void pauseDownload( const QString &link);
void stopDownload( const QString &link);
private slots:
void settingsMenu( void );
void addLinksMenu( void );
void btStart_clicked( void );
void btPause_clicked( void );
void btStop_clicked( void );
void btMoveUp_clicked( void );
void btMoveDown_clicked( void );
void btDel_clicked( void );
void clipboard_dataChanged( void );
void about_clicked( void );
void openTargetDirectory( void );
void aboutToQuit( void );
void closeApp( void );
void changeEvent(QEvent *);
void trayActivated(QSystemTrayIcon::ActivationReason);
void saveLinks( void );
private:
void resizeEvent(QResizeEvent *);
void loadSettings( void );
void loadLinks( void );
void addLink( const QString &link, const QString &saveAs, const int stateValue = -1, const int nextText = 0, const int totalText = 0);
void sortList(QModelIndexList &list, bool ascending = true);
void decrementActive( void );
QAction *settings, *about, *openInBrowser, *trayActionShow, *trayActionExit, *exit;
QClipboard *clipboard;
QSystemTrayIcon *trayIcon;
QMenu *trayMenu;
Downloader *downloader;
QTimer *timer;
int concd, active;
bool fastmode, autostart, startminimized;
enum COLUMNS { FileName = 0, FileSize, Progress, Speed, ETA, Status, Path, Next, Total, DownloadState };
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H