diff options
author | bunnei <bunneidev@gmail.com> | 2020-12-23 10:45:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-23 10:45:24 +0100 |
commit | 5836530a87e79beb57fc1076debed81c62c813f4 (patch) | |
tree | aa1e61ab72f4a1724f4605d6262ae5cab0da6c6b /src | |
parent | Merge pull request #5223 from lat9nq/menu-navigation (diff) | |
parent | yuzu/main: Save settings when starting guest (diff) | |
download | yuzu-5836530a87e79beb57fc1076debed81c62c813f4.tar yuzu-5836530a87e79beb57fc1076debed81c62c813f4.tar.gz yuzu-5836530a87e79beb57fc1076debed81c62c813f4.tar.bz2 yuzu-5836530a87e79beb57fc1076debed81c62c813f4.tar.lz yuzu-5836530a87e79beb57fc1076debed81c62c813f4.tar.xz yuzu-5836530a87e79beb57fc1076debed81c62c813f4.tar.zst yuzu-5836530a87e79beb57fc1076debed81c62c813f4.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/yuzu/main.cpp | 40 | ||||
-rw-r--r-- | src/yuzu/main.h | 1 |
2 files changed, 25 insertions, 16 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 9a0f9919b..44ca3db8b 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1116,6 +1116,11 @@ void GMainWindow::BootGame(const QString& filename, std::size_t program_index) { ConfigureVibration::SetAllVibrationDevices(); + // Save configurations + UpdateUISettings(); + game_list->SaveInterfaceLayout(); + config->Save(); + Settings::LogSettings(); if (UISettings::values.select_user_on_boot) { @@ -2546,6 +2551,24 @@ void GMainWindow::UpdateStatusButtons() { #endif } +void GMainWindow::UpdateUISettings() { + if (!ui.action_Fullscreen->isChecked()) { + UISettings::values.geometry = saveGeometry(); + UISettings::values.renderwindow_geometry = render_window->saveGeometry(); + } + UISettings::values.state = saveState(); +#if MICROPROFILE_ENABLED + UISettings::values.microprofile_geometry = microProfileDialog->saveGeometry(); + UISettings::values.microprofile_visible = microProfileDialog->isVisible(); +#endif + UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); + UISettings::values.fullscreen = ui.action_Fullscreen->isChecked(); + UISettings::values.display_titlebar = ui.action_Display_Dock_Widget_Headers->isChecked(); + UISettings::values.show_filter_bar = ui.action_Show_Filter_Bar->isChecked(); + UISettings::values.show_status_bar = ui.action_Show_Status_Bar->isChecked(); + UISettings::values.first_start = false; +} + void GMainWindow::HideMouseCursor() { if (emu_thread == nullptr || UISettings::values.hide_mouse == false) { mouse_hide_timer.stop(); @@ -2779,22 +2802,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) { return; } - if (!ui.action_Fullscreen->isChecked()) { - UISettings::values.geometry = saveGeometry(); - UISettings::values.renderwindow_geometry = render_window->saveGeometry(); - } - UISettings::values.state = saveState(); -#if MICROPROFILE_ENABLED - UISettings::values.microprofile_geometry = microProfileDialog->saveGeometry(); - UISettings::values.microprofile_visible = microProfileDialog->isVisible(); -#endif - UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); - UISettings::values.fullscreen = ui.action_Fullscreen->isChecked(); - UISettings::values.display_titlebar = ui.action_Display_Dock_Widget_Headers->isChecked(); - UISettings::values.show_filter_bar = ui.action_Show_Filter_Bar->isChecked(); - UISettings::values.show_status_bar = ui.action_Show_Status_Bar->isChecked(); - UISettings::values.first_start = false; - + UpdateUISettings(); game_list->SaveInterfaceLayout(); hotkey_registry.SaveHotkeys(); diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 8b6b85800..ea6d2c30d 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -263,6 +263,7 @@ private: const std::string& title_version = {}); void UpdateStatusBar(); void UpdateStatusButtons(); + void UpdateUISettings(); void HideMouseCursor(); void ShowMouseCursor(); void OpenURL(const QUrl& url); |