diff --git a/src/citra_qt/citra_qt.cpp b/src/citra_qt/citra_qt.cpp index a5f849b8b..0b9aedcba 100644 --- a/src/citra_qt/citra_qt.cpp +++ b/src/citra_qt/citra_qt.cpp @@ -309,16 +309,19 @@ GMainWindow::GMainWindow(Core::System& system_) } #ifdef ENABLE_QT_UPDATE_CHECKER - const std::optional latest_release = UpdateChecker::CheckForUpdate(); - if (latest_release && latest_release.value() != Common::g_build_fullname) { - if (QMessageBox::information( - this, tr("Update Available"), - tr("Update %1 for Azahar is available.\nWould you like to download it?") - .arg(QString::fromStdString(latest_release.value())), - QMessageBox::Yes | QMessageBox::Ignore) == QMessageBox::Yes) { - QDesktopServices::openUrl(QUrl(QString::fromStdString( - "https://github.com/azahar-emu/azahar/releases/tag/" + latest_release.value()))); - exit(0); + if (UISettings::values.check_for_update_on_start) { + const std::optional latest_release = UpdateChecker::CheckForUpdate(); + if (latest_release && latest_release.value() != Common::g_build_fullname) { + if (QMessageBox::information( + this, tr("Update Available"), + tr("Update %1 for Azahar is available.\nWould you like to download it?") + .arg(QString::fromStdString(latest_release.value())), + QMessageBox::Yes | QMessageBox::Ignore) == QMessageBox::Yes) { + QDesktopServices::openUrl(QUrl( + QString::fromStdString("https://github.com/azahar-emu/azahar/releases/tag/" + + latest_release.value()))); + exit(0); + } } } #endif diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp index a925ca3b2..5e261dca3 100644 --- a/src/citra_qt/configuration/config.cpp +++ b/src/citra_qt/configuration/config.cpp @@ -1,4 +1,4 @@ -// Copyright 2014 Citra Emulator Project +// Copyright Citra Emulator Project / Azahar Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -559,6 +559,7 @@ void QtConfig::ReadMiscellaneousValues() { ReadBasicSetting(Settings::values.log_filter); ReadBasicSetting(Settings::values.log_regex_filter); ReadBasicSetting(Settings::values.enable_gamemode); + ReadBasicSetting(UISettings::values.check_for_update_on_start); qt_config->endGroup(); } @@ -795,7 +796,6 @@ void QtConfig::ReadUIValues() { ReadBasicSetting(UISettings::values.enable_discord_presence); ReadBasicSetting(UISettings::values.screenshot_resolution_factor); - ReadUpdaterValues(); ReadUILayoutValues(); ReadUIGameListValues(); ReadShortcutValues(); @@ -861,15 +861,6 @@ void QtConfig::ReadUILayoutValues() { qt_config->endGroup(); } -void QtConfig::ReadUpdaterValues() { - qt_config->beginGroup(QStringLiteral("Updater")); - - ReadBasicSetting(UISettings::values.check_for_update_on_start); - ReadBasicSetting(UISettings::values.update_on_close); - - qt_config->endGroup(); -} - void QtConfig::ReadWebServiceValues() { qt_config->beginGroup(QStringLiteral("WebService")); @@ -1123,6 +1114,7 @@ void QtConfig::SaveMiscellaneousValues() { WriteBasicSetting(Settings::values.log_filter); WriteBasicSetting(Settings::values.log_regex_filter); WriteBasicSetting(Settings::values.enable_gamemode); + WriteBasicSetting(UISettings::values.check_for_update_on_start); qt_config->endGroup(); } @@ -1310,7 +1302,6 @@ void QtConfig::SaveUIValues() { WriteBasicSetting(UISettings::values.enable_discord_presence); WriteBasicSetting(UISettings::values.screenshot_resolution_factor); - SaveUpdaterValues(); SaveUILayoutValues(); SaveUIGameListValues(); SaveShortcutValues(); @@ -1374,15 +1365,6 @@ void QtConfig::SaveUILayoutValues() { qt_config->endGroup(); } -void QtConfig::SaveUpdaterValues() { - qt_config->beginGroup(QStringLiteral("Updater")); - - WriteBasicSetting(UISettings::values.check_for_update_on_start); - WriteBasicSetting(UISettings::values.update_on_close); - - qt_config->endGroup(); -} - void QtConfig::SaveWebServiceValues() { qt_config->beginGroup(QStringLiteral("WebService")); diff --git a/src/citra_qt/configuration/config.h b/src/citra_qt/configuration/config.h index d1412b1fa..d1a7abfcf 100644 --- a/src/citra_qt/configuration/config.h +++ b/src/citra_qt/configuration/config.h @@ -1,4 +1,4 @@ -// Copyright 2014 Citra Emulator Project +// Copyright Citra Emulator Project / Azahar Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -48,7 +48,6 @@ private: void ReadUIValues(); void ReadUIGameListValues(); void ReadUILayoutValues(); - void ReadUpdaterValues(); void ReadUtilityValues(); void ReadWebServiceValues(); void ReadVideoDumpingValues(); @@ -70,7 +69,6 @@ private: void SaveUIValues(); void SaveUIGameListValues(); void SaveUILayoutValues(); - void SaveUpdaterValues(); void SaveUtilityValues(); void SaveWebServiceValues(); void SaveVideoDumpingValues(); diff --git a/src/citra_qt/configuration/configure_general.cpp b/src/citra_qt/configuration/configure_general.cpp index 51d04adaf..cf091ec3c 100644 --- a/src/citra_qt/configuration/configure_general.cpp +++ b/src/citra_qt/configuration/configure_general.cpp @@ -1,4 +1,4 @@ -// Copyright 2016 Citra Emulator Project +// Copyright Citra Emulator Project / Azahar Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -35,10 +35,12 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) ui->emulation_speed_display_label->setMinimumWidth(width); ui->emulation_speed_combo->setVisible(!Settings::IsConfiguringGlobal()); ui->screenshot_combo->setVisible(!Settings::IsConfiguringGlobal()); - ui->updateBox->setVisible(UISettings::values.updater_found); #ifndef __unix__ ui->toggle_gamemode->setVisible(false); #endif +#ifndef ENABLE_QT_UPDATE_CHECKER + ui->toggle_update_checker->setVisible(false); +#endif SetupPerGameUI(); SetConfiguration(); @@ -77,10 +79,8 @@ void ConfigureGeneral::SetConfiguration() { ui->toggle_background_mute->setChecked( UISettings::values.mute_when_in_background.GetValue()); ui->toggle_hide_mouse->setChecked(UISettings::values.hide_mouse.GetValue()); - - ui->toggle_update_check->setChecked( + ui->toggle_update_checker->setChecked( UISettings::values.check_for_update_on_start.GetValue()); - ui->toggle_auto_update->setChecked(UISettings::values.update_on_close.GetValue()); #ifdef __unix__ ui->toggle_gamemode->setChecked(Settings::values.enable_gamemode.GetValue()); #endif @@ -178,9 +178,7 @@ void ConfigureGeneral::ApplyConfiguration() { UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked(); UISettings::values.mute_when_in_background = ui->toggle_background_mute->isChecked(); UISettings::values.hide_mouse = ui->toggle_hide_mouse->isChecked(); - - UISettings::values.check_for_update_on_start = ui->toggle_update_check->isChecked(); - UISettings::values.update_on_close = ui->toggle_auto_update->isChecked(); + UISettings::values.check_for_update_on_start = ui->toggle_update_checker->isChecked(); #ifdef __unix__ Settings::values.enable_gamemode = ui->toggle_gamemode->isChecked(); #endif @@ -211,9 +209,9 @@ void ConfigureGeneral::SetupPerGameUI() { }); ui->general_group->setVisible(false); - ui->updateBox->setVisible(false); ui->button_reset_defaults->setVisible(false); ui->toggle_gamemode->setVisible(false); + ui->toggle_update_checker->setVisible(false); ConfigurationShared::SetColoredComboBox( ui->region_combobox, ui->widget_region, diff --git a/src/citra_qt/configuration/configure_general.ui b/src/citra_qt/configuration/configure_general.ui index deb6c4282..4b6b0adf6 100644 --- a/src/citra_qt/configuration/configure_general.ui +++ b/src/citra_qt/configuration/configure_general.ui @@ -57,26 +57,10 @@ - - - - - - - Updates - - - + - Check for updates on start - - - - - - - Silently auto update after closing + Check for updates @@ -324,8 +308,7 @@ toggle_check_exit toggle_background_pause toggle_hide_mouse - toggle_update_check - toggle_auto_update + toggle_update_checker button_reset_defaults diff --git a/src/citra_qt/uisettings.h b/src/citra_qt/uisettings.h index 48ffa528d..9ac9d86d6 100644 --- a/src/citra_qt/uisettings.h +++ b/src/citra_qt/uisettings.h @@ -1,4 +1,4 @@ -// Copyright 2016 Citra Emulator Project +// Copyright Citra Emulator Project / Azahar Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -82,9 +82,6 @@ struct Values { Settings::Setting pause_when_in_background{false, "pauseWhenInBackground"}; Settings::Setting mute_when_in_background{false, "muteWhenInBackground"}; Settings::Setting hide_mouse{false, "hideInactiveMouse"}; - - bool updater_found; - Settings::Setting update_on_close{false, "update_on_close"}; Settings::Setting check_for_update_on_start{true, "check_for_update_on_start"}; // Discord RPC