summaryrefslogtreecommitdiff
path: root/src/downloadlistwidget.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-10-10 19:32:01 +0200
committerTannin <devnull@localhost>2013-10-10 19:32:01 +0200
commit54c7131a5e2fa282369e25344ac190d51676c383 (patch)
treecf03c6b8ba02afc17fece75d5e83a20cac4a8fbc /src/downloadlistwidget.cpp
parent15e256ef4460ecfdf05b4f17b4fe8f889f4c6b11 (diff)
- new toggle to display hidden downloads
- hidden downloads can be un-hidden - the installation manager now more thoroughly cleans up the temporary directory after installation - added SkyrimLauncher.exe to the list of auto-detected executables - bugfix: shutting down MO while downloads where active in some occasions didn't work - bugfix: when canceling the only active download the taskbar icon didn't return to normal
Diffstat (limited to 'src/downloadlistwidget.cpp')
-rw-r--r--src/downloadlistwidget.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/downloadlistwidget.cpp b/src/downloadlistwidget.cpp
index b657ca69..b4d40799 100644
--- a/src/downloadlistwidget.cpp
+++ b/src/downloadlistwidget.cpp
@@ -208,6 +208,11 @@ void DownloadListWidgetDelegate::issueRemoveFromView()
emit removeDownload(m_ContextRow, false);
}
+void DownloadListWidgetDelegate::issueRestoreToView()
+{
+ emit restoreDownload(m_ContextRow);
+}
+
void DownloadListWidgetDelegate::issueCancel()
{
emit cancelDownload(m_ContextRow);
@@ -277,13 +282,18 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *
QMenu menu(m_View);
m_ContextRow = qobject_cast<QSortFilterProxyModel*>(model)->mapToSource(index).row();
DownloadManager::DownloadState state = m_Manager->getState(m_ContextRow);
+ bool hidden = m_Manager->isHidden(m_ContextRow);
if (state >= DownloadManager::STATE_READY) {
menu.addAction(tr("Install"), this, SLOT(issueInstall()));
if (m_Manager->isInfoIncomplete(m_ContextRow)) {
menu.addAction(tr("Query Info"), this, SLOT(issueQueryInfo()));
}
menu.addAction(tr("Delete"), this, SLOT(issueDelete()));
- menu.addAction(tr("Remove from View"), this, SLOT(issueRemoveFromView()));
+ if (hidden) {
+ menu.addAction(tr("Un-Hide"), this, SLOT(issueRestoreToView()));
+ } else {
+ menu.addAction(tr("Remove from View"), this, SLOT(issueRemoveFromView()));
+ }
} else if (state == DownloadManager::STATE_DOWNLOADING){
menu.addAction(tr("Cancel"), this, SLOT(issueCancel()));
menu.addAction(tr("Pause"), this, SLOT(issuePause()));
@@ -295,9 +305,11 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *
menu.addSeparator();
menu.addAction(tr("Delete Installed..."), this, SLOT(issueDeleteCompleted()));
menu.addAction(tr("Delete All..."), this, SLOT(issueDeleteAll()));
- menu.addSeparator();
- menu.addAction(tr("Remove Installed..."), this, SLOT(issueRemoveFromViewCompleted()));
- menu.addAction(tr("Remove All..."), this, SLOT(issueRemoveFromViewAll()));
+ if (!hidden) {
+ menu.addSeparator();
+ menu.addAction(tr("Remove Installed..."), this, SLOT(issueRemoveFromViewCompleted()));
+ menu.addAction(tr("Remove All..."), this, SLOT(issueRemoveFromViewAll()));
+ }
menu.exec(mouseEvent->globalPos());
event->accept();