mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-23 00:40:58 +01:00
yuzu/main: Save settings when starting guest
Saves UISettings and Settings when booting a guest. Moves updating UISettings::values from GMainWindow::closeEvent into its own function, then reuses it in GMainWindow::BootGame.
This commit is contained in:
parent
1279c7ce7a
commit
c243932b41
2 changed files with 25 additions and 16 deletions
|
@ -1106,6 +1106,11 @@ void GMainWindow::BootGame(const QString& filename, std::size_t program_index) {
|
||||||
|
|
||||||
ConfigureVibration::SetAllVibrationDevices();
|
ConfigureVibration::SetAllVibrationDevices();
|
||||||
|
|
||||||
|
// Save configurations
|
||||||
|
UpdateUISettings();
|
||||||
|
game_list->SaveInterfaceLayout();
|
||||||
|
config->Save();
|
||||||
|
|
||||||
Settings::LogSettings();
|
Settings::LogSettings();
|
||||||
|
|
||||||
if (UISettings::values.select_user_on_boot) {
|
if (UISettings::values.select_user_on_boot) {
|
||||||
|
@ -2521,6 +2526,24 @@ void GMainWindow::UpdateStatusButtons() {
|
||||||
#endif
|
#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() {
|
void GMainWindow::HideMouseCursor() {
|
||||||
if (emu_thread == nullptr || UISettings::values.hide_mouse == false) {
|
if (emu_thread == nullptr || UISettings::values.hide_mouse == false) {
|
||||||
mouse_hide_timer.stop();
|
mouse_hide_timer.stop();
|
||||||
|
@ -2754,22 +2777,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ui.action_Fullscreen->isChecked()) {
|
UpdateUISettings();
|
||||||
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;
|
|
||||||
|
|
||||||
game_list->SaveInterfaceLayout();
|
game_list->SaveInterfaceLayout();
|
||||||
hotkey_registry.SaveHotkeys();
|
hotkey_registry.SaveHotkeys();
|
||||||
|
|
||||||
|
|
|
@ -257,6 +257,7 @@ private:
|
||||||
const std::string& title_version = {});
|
const std::string& title_version = {});
|
||||||
void UpdateStatusBar();
|
void UpdateStatusBar();
|
||||||
void UpdateStatusButtons();
|
void UpdateStatusButtons();
|
||||||
|
void UpdateUISettings();
|
||||||
void HideMouseCursor();
|
void HideMouseCursor();
|
||||||
void ShowMouseCursor();
|
void ShowMouseCursor();
|
||||||
void OpenURL(const QUrl& url);
|
void OpenURL(const QUrl& url);
|
||||||
|
|
Loading…
Reference in a new issue