summaryrefslogtreecommitdiff
path: root/src/downloadlistwidgetcompact.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/downloadlistwidgetcompact.cpp
parent9ddb26ea5100581c832920015f79de8d7366463f (diff)
Added new "Hide Uninstalled" and "Delete Uninstalled" options to downloads tab.
Diffstat (limited to 'src/downloadlistwidgetcompact.cpp')
-rw-r--r--src/downloadlistwidgetcompact.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/downloadlistwidgetcompact.cpp b/src/downloadlistwidgetcompact.cpp
index ad9e0994..34e31006 100644
--- a/src/downloadlistwidgetcompact.cpp
+++ b/src/downloadlistwidgetcompact.cpp
@@ -292,6 +292,15 @@ void DownloadListWidgetCompactDelegate::issueDeleteCompleted()
}
}
+void DownloadListWidgetCompactDelegate::issueDeleteUninstalled()
+{
+ if (QMessageBox::question(nullptr, tr("Are you sure?"),
+ tr("This will remove all uninstalled downloads from this list and from disk."),
+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
+ emit removeDownload(-3, true);
+ }
+}
+
void DownloadListWidgetCompactDelegate::issueRemoveFromViewAll()
{
if (QMessageBox::question(nullptr, tr("Are you sure?"),
@@ -310,6 +319,15 @@ void DownloadListWidgetCompactDelegate::issueRemoveFromViewCompleted()
}
}
+void DownloadListWidgetCompactDelegate::issueRemoveFromViewUninstalled()
+{
+ if (QMessageBox::question(nullptr, tr("Are you sure?"),
+ tr("This will permanently remove all uninstalled downloads from this list (but NOT from disk)."),
+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
+ emit removeDownload(-3, false);
+ }
+}
+
bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
const QStyleOptionViewItem &option, const QModelIndex &index)
@@ -359,10 +377,12 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem
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) {