summaryrefslogtreecommitdiff
path: root/src/downloadlistwidget.cpp
diff options
context:
space:
mode:
authorAl12rs <gabriel.cortesi@outlook.com>2018-07-17 00:49:41 +0200
committerAl12rs <gabriel.cortesi@outlook.com>2018-07-17 00:49:41 +0200
commit872c33fe5592eb84a2f6c01a2e47b72602b6139e (patch)
treeed0b5d3203500b15a55801a009a0fec680b4a6db /src/downloadlistwidget.cpp
parent9ddb26ea5100581c832920015f79de8d7366463f (diff)
Added new "Hide Uninstalled" and "Delete Uninstalled" options to downloads tab.
Diffstat (limited to 'src/downloadlistwidget.cpp')
-rw-r--r--src/downloadlistwidget.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/downloadlistwidget.cpp b/src/downloadlistwidget.cpp
index 1a401d10..ad694107 100644
--- a/src/downloadlistwidget.cpp
+++ b/src/downloadlistwidget.cpp
@@ -310,6 +310,15 @@ void DownloadListWidgetDelegate::issueDeleteCompleted()
}
}
+void DownloadListWidgetDelegate::issueDeleteUninstalled()
+{
+ if (QMessageBox::question(nullptr, tr("Delete Files?"),
+ tr("This will remove all uninstalled downloads from this list and from disk."),
+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
+ emit removeDownload(-3, true);
+ }
+}
+
void DownloadListWidgetDelegate::issueRemoveFromViewAll()
{
if (QMessageBox::question(nullptr, tr("Are you sure?"),
@@ -328,6 +337,15 @@ void DownloadListWidgetDelegate::issueRemoveFromViewCompleted()
}
}
+void DownloadListWidgetDelegate::issueRemoveFromViewUninstalled()
+{
+ if (QMessageBox::question(nullptr, tr("Are you sure?"),
+ tr("This will remove all uninstalled downloads from this list (but NOT from disk)."),
+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
+ emit removeDownload(-3, false);
+ }
+}
+
bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
const QStyleOptionViewItem &option, const QModelIndex &index)
{
@@ -380,11 +398,13 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *
menu.addSeparator();
}
menu.addAction(tr("Delete Installed..."), this, SLOT(issueDeleteCompleted()));
+ menu.addAction(tr("Delete Uninstalled..."), this, SLOT(issueDeleteUninstalled()));
menu.addAction(tr("Delete All..."), this, SLOT(issueDeleteAll()));
if (!hidden) {
menu.addSeparator();
menu.addAction(tr("Hide Installed..."), this, SLOT(issueRemoveFromViewCompleted()));
+ menu.addAction(tr("Hide Uninstalled..."), this, SLOT(issueRemoveFromViewUninstalled()));
menu.addAction(tr("Hide All..."), this, SLOT(issueRemoveFromViewAll()));
}
if (hidden) {