From 2f16f07f6e095c203e7df147ae4584fd199a75e1 Mon Sep 17 00:00:00 2001
From: isanae <14251494+isanae@users.noreply.github.com>
Date: Sun, 10 Jan 2021 20:41:59 -0500
Subject: task dialog for deleting downloads also shows filename
---
src/downloadlistwidget.cpp | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
(limited to 'src')
diff --git a/src/downloadlistwidget.cpp b/src/downloadlistwidget.cpp
index ad9ea63a..22e3a3b9 100644
--- a/src/downloadlistwidget.cpp
+++ b/src/downloadlistwidget.cpp
@@ -19,6 +19,7 @@ along with Mod Organizer. If not, see .
#include "downloadlist.h"
#include "downloadlistwidget.h"
+#include
#include
#include
#include
@@ -240,7 +241,7 @@ void DownloadListWidget::onCustomContextMenu(const QPoint &point)
menu.addSeparator();
- menu.addAction(tr("Delete"), this, SLOT(issueDelete()));
+ menu.addAction(tr("Delete..."), this, SLOT(issueDelete()));
if (hidden)
menu.addAction(tr("Un-Hide"), this, SLOT(issueRestoreToView()));
else
@@ -251,7 +252,7 @@ void DownloadListWidget::onCustomContextMenu(const QPoint &point)
menu.addAction(tr("Reveal in Explorer"), this, SLOT(issueOpenInDownloadsFolder()));
} else if ((state == DownloadManager::STATE_PAUSED) || (state == DownloadManager::STATE_ERROR)
|| (state == DownloadManager::STATE_PAUSING)) {
- menu.addAction(tr("Delete"), this, SLOT(issueDelete()));
+ menu.addAction(tr("Delete..."), this, SLOT(issueDelete()));
menu.addAction(tr("Resume"), this, SLOT(issueResume()));
menu.addAction(tr("Reveal in Explorer"), this, SLOT(issueOpenInDownloadsFolder()));
}
@@ -297,11 +298,19 @@ void DownloadListWidget::issueQueryInfoMd5()
void DownloadListWidget::issueDelete()
{
- if (QMessageBox::warning(nullptr, tr("Delete Files?"),
- tr("This will permanently delete the selected download.\n\nAre you absolutely sure you want to proceed?"),
- QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
- emit removeDownload(m_ContextRow, true);
+ const auto r = MOBase::TaskDialog(this, tr("Delete download"))
+ .main("Are you sure you want to delete this download?")
+ .content(m_Manager->getFilePath(m_ContextRow))
+ .icon(QMessageBox::Question)
+ .button({tr("Move to the Recycle Bin"), QMessageBox::Yes})
+ .button({tr("Cancel"), QMessageBox::Cancel})
+ .exec();
+
+ if (r != QMessageBox::Yes) {
+ return;
}
+
+ emit removeDownload(m_ContextRow, true);
}
void DownloadListWidget::issueRemoveFromView()
--
cgit v1.3.1