Merge pull request #5671 from FearlessTobi/port-5217

Port yuzu-emu/yuzu#5217: "citra_qt/main: Save settings when starting guest"
This commit is contained in:
Marshall Mohror 2021-02-03 10:22:38 -06:00 committed by GitHub
commit 2461f67a98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 16 deletions

View file

@ -1013,6 +1013,11 @@ void GMainWindow::BootGame(const QString& filename) {
Core::Movie::GetInstance().PrepareForRecording();
}
// Save configurations
UpdateUISettings();
game_list->SaveInterfaceLayout();
config->Save();
if (!LoadROM(filename))
return;
@ -2186,22 +2191,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();
@ -2370,6 +2360,24 @@ void GMainWindow::UpdateWindowTitle() {
}
}
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::SyncMenuUISettings() {
ui->action_Screen_Layout_Default->setChecked(Settings::values.layout_option ==
Settings::LayoutOption::Default);

View file

@ -229,6 +229,7 @@ private:
void UpdateStatusBar();
void LoadTranslation();
void UpdateWindowTitle();
void UpdateUISettings();
void RetranslateStatusBar();
void InstallCIA(QStringList filepaths);
void HideMouseCursor();