summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-17 13:00:01 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-17 13:00:01 +0100
commit704490e3157dbb9916fc3fb42b5503462a482f06 (patch)
treeee5e4fd41dcb5efa2379e3203401a2e7186d74d7 /src
parent2b1f01cba2a50a17db69187a1b4cbecf5a0fb65d (diff)
Add setting to not check for updates after installing mods.
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp4
-rw-r--r--src/settings.cpp10
-rw-r--r--src/settings.h5
-rw-r--r--src/settingsdialog.ui16
-rw-r--r--src/settingsdialoguserinterface.cpp2
5 files changed, 37 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 9c049efa..a2b12686 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -2191,6 +2191,10 @@ void MainWindow::directory_refreshed()
void MainWindow::modInstalled(const QString &modName)
{
+ if (!m_OrganizerCore.settings().interface().checkUpdateAfterInstallation()) {
+ return;
+ }
+
unsigned int index = ModInfo::getIndex(modName);
if (index == UINT_MAX) {
diff --git a/src/settings.cpp b/src/settings.cpp
index 7047fa44..27c02ede 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -2238,6 +2238,16 @@ void InterfaceSettings::setSaveFilters(bool b)
set(m_Settings, "Settings", "save_filters", b);
}
+bool InterfaceSettings::checkUpdateAfterInstallation() const
+{
+ return get<bool>(m_Settings, "Settings", "autocheck_update_install", true);
+}
+
+void InterfaceSettings::setCheckUpdateAfterInstallation(bool b)
+{
+ set(m_Settings, "Settings", "autocheck_update_install", b);
+}
+
bool InterfaceSettings::compactDownloads() const
{
return get<bool>(m_Settings, "Settings", "compact_downloads", false);
diff --git a/src/settings.h b/src/settings.h
index 5f6dd37c..35c9ca4d 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -653,6 +653,11 @@ public:
bool saveFilters() const;
void setSaveFilters(bool b);
+ // whether to check for update after installing a mod
+ //
+ bool checkUpdateAfterInstallation() const;
+ void setCheckUpdateAfterInstallation(bool b);
+
// whether to show compact downloads
//
bool compactDownloads() const;
diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui
index bcef5d95..e65e28ff 100644
--- a/src/settingsdialog.ui
+++ b/src/settingsdialog.ui
@@ -282,6 +282,22 @@ If you disable this feature, MO will only display official DLCs this way. Please
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="checkUpdateInstallBox">
+ <property name="toolTip">
+ <string>Check if updates iare available for mods after installing them.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Check if updates iare available for mods after installing them.</string>
+ </property>
+ <property name="text">
+ <string>Check for updates when installing mods</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer_9">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/src/settingsdialoguserinterface.cpp b/src/settingsdialoguserinterface.cpp
index 49710771..bb0628a8 100644
--- a/src/settingsdialoguserinterface.cpp
+++ b/src/settingsdialoguserinterface.cpp
@@ -32,6 +32,7 @@ UserInterfaceSettingsTab::UserInterfaceSettingsTab(Settings& s, SettingsDialog&
ui->collapsibleSeparatorsHighlightToBox->setChecked(settings().interface().collapsibleSeparatorsHighlightTo());
ui->collapsibleSeparatorsPerProfileBox->setChecked(settings().interface().collapsibleSeparatorsPerProfile());
ui->saveFiltersBox->setChecked(settings().interface().saveFilters());
+ ui->checkUpdateInstallBox->setChecked(settings().interface().checkUpdateAfterInstallation());
for (auto& p : m_columnToBox) {
p.second->setChecked(settings().interface().collapsibleSeparatorsIcons(p.first));
@@ -60,6 +61,7 @@ void UserInterfaceSettingsTab::update()
settings().interface().setCollapsibleSeparatorsHighlightTo(ui->collapsibleSeparatorsHighlightToBox->isChecked());
settings().interface().setCollapsibleSeparatorsPerProfile(ui->collapsibleSeparatorsPerProfileBox->isChecked());
settings().interface().setSaveFilters(ui->saveFiltersBox->isChecked());
+ settings().interface().setCheckUpdateAfterInstallation(ui->checkUpdateInstallBox->isChecked());
for (auto& p : m_columnToBox) {
settings().interface().setCollapsibleSeparatorsIcons(p.first, p.second->isChecked());