diff options
| author | 2020-12-23 01:45:24 -0800 | |
|---|---|---|
| committer | 2020-12-23 01:45:24 -0800 | |
| 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.gz yuzu-5836530a87e79beb57fc1076debed81c62c813f4.tar.xz yuzu-5836530a87e79beb57fc1076debed81c62c813f4.zip | |
Merge pull request #5217 from lat9nq/save-on-boot
yuzu/main: Save settings when starting guest
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) { | |||
| 1116 | 1116 | ||
| 1117 | ConfigureVibration::SetAllVibrationDevices(); | 1117 | ConfigureVibration::SetAllVibrationDevices(); |
| 1118 | 1118 | ||
| 1119 | // Save configurations | ||
| 1120 | UpdateUISettings(); | ||
| 1121 | game_list->SaveInterfaceLayout(); | ||
| 1122 | config->Save(); | ||
| 1123 | |||
| 1119 | Settings::LogSettings(); | 1124 | Settings::LogSettings(); |
| 1120 | 1125 | ||
| 1121 | if (UISettings::values.select_user_on_boot) { | 1126 | if (UISettings::values.select_user_on_boot) { |
| @@ -2546,6 +2551,24 @@ void GMainWindow::UpdateStatusButtons() { | |||
| 2546 | #endif | 2551 | #endif |
| 2547 | } | 2552 | } |
| 2548 | 2553 | ||
| 2554 | void GMainWindow::UpdateUISettings() { | ||
| 2555 | if (!ui.action_Fullscreen->isChecked()) { | ||
| 2556 | UISettings::values.geometry = saveGeometry(); | ||
| 2557 | UISettings::values.renderwindow_geometry = render_window->saveGeometry(); | ||
| 2558 | } | ||
| 2559 | UISettings::values.state = saveState(); | ||
| 2560 | #if MICROPROFILE_ENABLED | ||
| 2561 | UISettings::values.microprofile_geometry = microProfileDialog->saveGeometry(); | ||
| 2562 | UISettings::values.microprofile_visible = microProfileDialog->isVisible(); | ||
| 2563 | #endif | ||
| 2564 | UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); | ||
| 2565 | UISettings::values.fullscreen = ui.action_Fullscreen->isChecked(); | ||
| 2566 | UISettings::values.display_titlebar = ui.action_Display_Dock_Widget_Headers->isChecked(); | ||
| 2567 | UISettings::values.show_filter_bar = ui.action_Show_Filter_Bar->isChecked(); | ||
| 2568 | UISettings::values.show_status_bar = ui.action_Show_Status_Bar->isChecked(); | ||
| 2569 | UISettings::values.first_start = false; | ||
| 2570 | } | ||
| 2571 | |||
| 2549 | void GMainWindow::HideMouseCursor() { | 2572 | void GMainWindow::HideMouseCursor() { |
| 2550 | if (emu_thread == nullptr || UISettings::values.hide_mouse == false) { | 2573 | if (emu_thread == nullptr || UISettings::values.hide_mouse == false) { |
| 2551 | mouse_hide_timer.stop(); | 2574 | mouse_hide_timer.stop(); |
| @@ -2779,22 +2802,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) { | |||
| 2779 | return; | 2802 | return; |
| 2780 | } | 2803 | } |
| 2781 | 2804 | ||
| 2782 | if (!ui.action_Fullscreen->isChecked()) { | 2805 | UpdateUISettings(); |
| 2783 | UISettings::values.geometry = saveGeometry(); | ||
| 2784 | UISettings::values.renderwindow_geometry = render_window->saveGeometry(); | ||
| 2785 | } | ||
| 2786 | UISettings::values.state = saveState(); | ||
| 2787 | #if MICROPROFILE_ENABLED | ||
| 2788 | UISettings::values.microprofile_geometry = microProfileDialog->saveGeometry(); | ||
| 2789 | UISettings::values.microprofile_visible = microProfileDialog->isVisible(); | ||
| 2790 | #endif | ||
| 2791 | UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); | ||
| 2792 | UISettings::values.fullscreen = ui.action_Fullscreen->isChecked(); | ||
| 2793 | UISettings::values.display_titlebar = ui.action_Display_Dock_Widget_Headers->isChecked(); | ||
| 2794 | UISettings::values.show_filter_bar = ui.action_Show_Filter_Bar->isChecked(); | ||
| 2795 | UISettings::values.show_status_bar = ui.action_Show_Status_Bar->isChecked(); | ||
| 2796 | UISettings::values.first_start = false; | ||
| 2797 | |||
| 2798 | game_list->SaveInterfaceLayout(); | 2806 | game_list->SaveInterfaceLayout(); |
| 2799 | hotkey_registry.SaveHotkeys(); | 2807 | hotkey_registry.SaveHotkeys(); |
| 2800 | 2808 | ||
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: | |||
| 263 | const std::string& title_version = {}); | 263 | const std::string& title_version = {}); |
| 264 | void UpdateStatusBar(); | 264 | void UpdateStatusBar(); |
| 265 | void UpdateStatusButtons(); | 265 | void UpdateStatusButtons(); |
| 266 | void UpdateUISettings(); | ||
| 266 | void HideMouseCursor(); | 267 | void HideMouseCursor(); |
| 267 | void ShowMouseCursor(); | 268 | void ShowMouseCursor(); |
| 268 | void OpenURL(const QUrl& url); | 269 | void OpenURL(const QUrl& url); |