aboutsummaryrefslogtreecommitdiff
path: root/src/downloadmanagerwidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/downloadmanagerwidget.h')
-rw-r--r--src/downloadmanagerwidget.h38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/downloadmanagerwidget.h b/src/downloadmanagerwidget.h
index 4a8d059..8367041 100644
--- a/src/downloadmanagerwidget.h
+++ b/src/downloadmanagerwidget.h
@@ -51,11 +51,14 @@
#ifndef DOWNLOADMANAGERWIDGET_H
#define DOWNLOADMANAGERWIDGET_H
+#include "settingsmanager.h"
#include "ui_downloadmanagerwidget.h"
+#include "utils.h"
+#include <QFileDialog>
+#include <QStandardPaths>
+#include <QWebEngineDownloadItem>
#include <QWidget>
-#include <QSettings>
-#include "utils.h"
QT_BEGIN_NAMESPACE
class QWebEngineDownloadItem;
@@ -64,28 +67,31 @@ QT_END_NAMESPACE
class DownloadWidget;
// Displays a list of downloads.
-class DownloadManagerWidget final : public QWidget, public Ui::DownloadManagerWidget
-{
- Q_OBJECT
+class DownloadManagerWidget final : public QWidget,
+ public Ui::DownloadManagerWidget {
+ Q_OBJECT
public:
- explicit DownloadManagerWidget(QWidget *parent = nullptr);
+ explicit DownloadManagerWidget(QWidget *parent = nullptr);
- // Prompts user with a "Save As" dialog. If the user doesn't cancel it, then
- // the QWebEngineDownloadItem will be accepted and the DownloadManagerWidget
- // will be shown on the screen.
- void downloadRequested(QWebEngineDownloadItem *webItem);
+ // Prompts user with a "Save As" dialog. If the user doesn't cancel it, then
+ // the QWebEngineDownloadItem will be accepted and the DownloadManagerWidget
+ // will be shown on the screen.
+ void downloadRequested(QWebEngineDownloadItem *webItem);
protected slots:
- void keyPressEvent(QKeyEvent *e);
+ void keyPressEvent(QKeyEvent *e);
private slots:
- void on_open_download_dir_clicked();
+ void on_open_download_dir_clicked();
+
+ void acceptDownload(QWebEngineDownloadItem *download);
+
+ void on_clear_all_downlads_clicked();
private:
- void add(DownloadWidget *downloadWidget);
- void remove(DownloadWidget *downloadWidget);
+ void add(DownloadWidget *downloadWidget);
+ void remove(DownloadWidget *downloadWidget);
- int m_numDownloads;
- QSettings settings;
+ int m_numDownloads;
};
#endif // DOWNLOADMANAGERWIDGET_H