From 66b1e419c38e301d8b2ead9ca4ab3893c9d4ff35 Mon Sep 17 00:00:00 2001 From: vitor-k Date: Sat, 14 Sep 2019 18:14:23 -0300 Subject: [PATCH] Naming changes and clang format --- src/citra_qt/configuration/config.cpp | 5 +++-- src/citra_qt/configuration/configure_general.cpp | 4 ++-- src/citra_qt/main.cpp | 6 +++--- src/citra_qt/main.h | 2 +- src/citra_qt/uisettings.h | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp index 970dc7bca..0a7a78835 100644 --- a/src/citra_qt/configuration/config.cpp +++ b/src/citra_qt/configuration/config.cpp @@ -384,7 +384,8 @@ void Config::ReadValues() { UISettings::values.first_start = ReadSetting("firstStart", true).toBool(); UISettings::values.callout_flags = ReadSetting("calloutFlags", 0).toUInt(); UISettings::values.show_console = ReadSetting("showConsole", false).toBool(); - UISettings::values.pause_when_on_background = ReadSetting("pauseWhenOnBackground", false).toBool(); + UISettings::values.pause_when_in_background = + ReadSetting("pauseWhenInBackground", false).toBool(); qt_config->beginGroup("Multiplayer"); UISettings::values.nickname = ReadSetting("nickname", "").toString(); @@ -637,7 +638,7 @@ void Config::SaveValues() { WriteSetting("firstStart", UISettings::values.first_start, true); WriteSetting("calloutFlags", UISettings::values.callout_flags, 0); WriteSetting("showConsole", UISettings::values.show_console, false); - WriteSetting("pauseWhenOnBackground", UISettings::values.pause_when_on_background, false); + WriteSetting("pauseWhenInBackground", UISettings::values.pause_when_in_background, false); qt_config->beginGroup("Multiplayer"); WriteSetting("nickname", UISettings::values.nickname, ""); diff --git a/src/citra_qt/configuration/configure_general.cpp b/src/citra_qt/configuration/configure_general.cpp index 2911c26fe..47d559e3d 100644 --- a/src/citra_qt/configuration/configure_general.cpp +++ b/src/citra_qt/configuration/configure_general.cpp @@ -26,7 +26,7 @@ ConfigureGeneral::~ConfigureGeneral() = default; void ConfigureGeneral::SetConfiguration() { ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing); - ui->toggle_background_pause->setChecked(UISettings::values.pause_when_on_background); + ui->toggle_background_pause->setChecked(UISettings::values.pause_when_in_background); ui->toggle_update_check->setChecked(UISettings::values.check_for_update_on_start); ui->toggle_auto_update->setChecked(UISettings::values.update_on_close); @@ -54,7 +54,7 @@ void ConfigureGeneral::ResetDefaults() { void ConfigureGeneral::ApplyConfiguration() { UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); - UISettings::values.pause_when_on_background = ui->toggle_background_pause->isChecked(); + UISettings::values.pause_when_in_background = ui->toggle_background_pause->isChecked(); UISettings::values.check_for_update_on_start = ui->toggle_update_check->isChecked(); UISettings::values.update_on_close = ui->toggle_auto_update->isChecked(); diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index eb8cc55c7..9b2fc5253 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -499,8 +499,8 @@ void GMainWindow::RestoreUIState() { statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); } -void GMainWindow::OnLoseFocus(Qt::ApplicationState state) { - if (UISettings::values.pause_when_on_background) { +void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) { + if (UISettings::values.pause_when_in_background) { if (ui.action_Pause->isEnabled() && (state == Qt::ApplicationSuspended || state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) { @@ -2030,7 +2030,7 @@ int main(int argc, char* argv[]) { main_window.show(); QObject::connect(&app, &QGuiApplication::applicationStateChanged, &main_window, - &GMainWindow::OnLoseFocus); + &GMainWindow::OnAppFocusStateChanged); int result = app.exec(); detached_tasks.WaitForAllTasks(); diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 9cb6886d3..c86d99b79 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -69,7 +69,7 @@ public: std::unique_ptr discord_rpc; public slots: - void OnLoseFocus(Qt::ApplicationState state); + void OnAppFocusStateChanged(Qt::ApplicationState state); signals: /** diff --git a/src/citra_qt/uisettings.h b/src/citra_qt/uisettings.h index 175c68a2b..bc1fc9f0f 100644 --- a/src/citra_qt/uisettings.h +++ b/src/citra_qt/uisettings.h @@ -72,7 +72,7 @@ struct Values { bool confirm_before_closing; bool first_start; - bool pause_when_on_background; + bool pause_when_in_background; bool updater_found; bool update_on_close;