From 704490e3157dbb9916fc3fb42b5503462a482f06 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 17 Jan 2021 13:00:01 +0100 Subject: Add setting to not check for updates after installing mods. --- src/mainwindow.cpp | 4 ++++ src/settings.cpp | 10 ++++++++++ src/settings.h | 5 +++++ src/settingsdialog.ui | 16 ++++++++++++++++ src/settingsdialoguserinterface.cpp | 2 ++ 5 files changed, 37 insertions(+) (limited to 'src') 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(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(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 @@ -281,6 +281,22 @@ If you disable this feature, MO will only display official DLCs this way. Please + + + + Check if updates iare available for mods after installing them. + + + Check if updates iare available for mods after installing them. + + + Check for updates when installing mods + + + true + + + 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()); -- cgit v1.3.1