aboutsummaryrefslogtreecommitdiff
path: root/src/downloadmanagerwidget.h
diff options
context:
space:
mode:
authorLibravatar Keshav Bhatt <keshavnrj@gmail.com>2023-03-22 20:22:51 +0530
committerLibravatar Keshav Bhatt <keshavnrj@gmail.com>2023-03-22 20:22:51 +0530
commitdd687dc983614e133b841b6b942a13ff2dfd0ebf (patch)
tree401869a54f06edb143ca0adb8dd9371cc55574a6 /src/downloadmanagerwidget.h
parentc2bd1a32cada12f8d4b5e57b589911e96e2153c2 (diff)
downloadwhatsie-dd687dc983614e133b841b6b942a13ff2dfd0ebf.tar.gz
whatsie-dd687dc983614e133b841b6b942a13ff2dfd0ebf.zip
fix: prevent overwrite if file exists
- handle situation to prevent download overwrite - add clear all downloads - cleanup
Diffstat (limited to 'src/downloadmanagerwidget.h')
-rw-r--r--src/downloadmanagerwidget.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/downloadmanagerwidget.h b/src/downloadmanagerwidget.h
index 4a8d059..76464e8 100644
--- a/src/downloadmanagerwidget.h
+++ b/src/downloadmanagerwidget.h
@@ -53,9 +53,9 @@
#include "ui_downloadmanagerwidget.h"
-#include <QWidget>
-#include <QSettings>
#include "utils.h"
+#include <QSettings>
+#include <QWidget>
QT_BEGIN_NAMESPACE
class QWebEngineDownloadItem;
@@ -64,28 +64,32 @@ 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;
+ QSettings settings;
};
#endif // DOWNLOADMANAGERWIDGET_H