summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/organizercore.cpp3
-rw-r--r--src/settings.cpp10
-rw-r--r--src/settings.h5
-rw-r--r--src/settingsdialog.ui13
-rw-r--r--src/settingsdialoguserinterface.cpp2
5 files changed, 33 insertions, 0 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index bbf6029b..e95aa565 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -808,6 +808,9 @@ ModInfo::Ptr OrganizerCore::installDownload(int index, int priority)
reportError(tr("mod not found: %1").arg(qUtf8Printable(modName)));
}
m_DownloadManager.markInstalled(index);
+ if (settings().interface().hideDownloadsAfterInstallation()) {
+ m_DownloadManager.removeDownload(index, false);
+ }
emit modInstalled(modName);
return modInfo;
}
diff --git a/src/settings.cpp b/src/settings.cpp
index 27108162..7047fa44 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -2258,6 +2258,16 @@ void InterfaceSettings::setMetaDownloads(bool b)
set(m_Settings, "Settings", "meta_downloads", b);
}
+bool InterfaceSettings::hideDownloadsAfterInstallation() const
+{
+ return get<bool>(m_Settings, "Settings", "autohide_downloads", false);
+}
+
+void InterfaceSettings::setHideDownloadsAfterInstallation(bool b)
+{
+ set(m_Settings, "Settings", "autohide_downloads", b);
+}
+
bool InterfaceSettings::hideAPICounter() const
{
return get<bool>(m_Settings, "Settings", "hide_api_counter", false);
diff --git a/src/settings.h b/src/settings.h
index 384d50a2..5f6dd37c 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -663,6 +663,11 @@ public:
bool metaDownloads() const;
void setMetaDownloads(bool b);
+ // whether to hide downloads after installing them
+ //
+ bool hideDownloadsAfterInstallation() const;
+ void setHideDownloadsAfterInstallation(bool b);
+
// whether the API counter should be hidden
//
bool hideAPICounter() const;
diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui
index f6368ff7..bcef5d95 100644
--- a/src/settingsdialog.ui
+++ b/src/settingsdialog.ui
@@ -521,6 +521,19 @@ If you disable this feature, MO will only display official DLCs this way. Please
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="hideDownloadInstallBox">
+ <property name="toolTip">
+ <string>Automatically hide downloads after successful installation.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Automatically hide downloads after successful installation.</string>
+ </property>
+ <property name="text">
+ <string>Hide downloads after installation</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/src/settingsdialoguserinterface.cpp b/src/settingsdialoguserinterface.cpp
index 6ccea300..49710771 100644
--- a/src/settingsdialoguserinterface.cpp
+++ b/src/settingsdialoguserinterface.cpp
@@ -40,6 +40,7 @@ UserInterfaceSettingsTab::UserInterfaceSettingsTab(Settings& s, SettingsDialog&
// download list
ui->compactBox->setChecked(settings().interface().compactDownloads());
ui->showMetaBox->setChecked(settings().interface().metaDownloads());
+ ui->hideDownloadInstallBox->setChecked(settings().interface().hideDownloadsAfterInstallation());
// colors
ui->colorTable->load(s);
@@ -67,6 +68,7 @@ void UserInterfaceSettingsTab::update()
// download list
settings().interface().setCompactDownloads(ui->compactBox->isChecked());
settings().interface().setMetaDownloads(ui->showMetaBox->isChecked());
+ settings().interface().setHideDownloadsAfterInstallation(ui->hideDownloadInstallBox->isChecked());
// colors
ui->colorTable->commitColors();