yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

Merge pull request #9817 from german77/save

yuzu: Write to config file on important config changes
This commit is contained in:
Mai 2023-02-16 22:58:29 -05:00 committed by GitHub
commit 61b1772e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 2 deletions

View File

@ -1103,6 +1103,7 @@ void Config::SaveValues() {
SaveRendererValues();
SaveAudioValues();
SaveSystemValues();
qt_config->sync();
}
void Config::SaveAudioValues() {

View File

@ -870,6 +870,7 @@ void GameList::ToggleFavorite(u64 program_id) {
tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true);
}
}
SaveConfig();
}
void GameList::AddFavorite(u64 program_id) {

View File

@ -122,6 +122,7 @@ signals:
void AddDirectory();
void ShowList(bool show);
void PopulatingCompleted();
void SaveConfig();
private slots:
void OnItemExpanded(const QModelIndex& item);

View File

@ -1271,6 +1271,7 @@ void GMainWindow::ConnectWidgetEvents() {
connect(game_list, &GameList::ShowList, this, &GMainWindow::OnGameListShowList);
connect(game_list, &GameList::PopulatingCompleted,
[this] { multiplayer_state->UpdateGameList(game_list->GetModel()); });
connect(game_list, &GameList::SaveConfig, this, &GMainWindow::OnSaveConfig);
connect(game_list, &GameList::OpenPerGameGeneralRequested, this,
&GMainWindow::OnGameListOpenPerGameProperties);
@ -2654,6 +2655,8 @@ void GMainWindow::OnGameListAddDirectory() {
} else {
LOG_WARNING(Frontend, "Selected directory is already in the game list");
}
OnSaveConfig();
}
void GMainWindow::OnGameListShowList(bool show) {
@ -3015,8 +3018,10 @@ void GMainWindow::OnRestartGame() {
if (!system->IsPoweredOn()) {
return;
}
// Make a copy since BootGame edits game_path
BootGame(QString(current_game_path));
// Make a copy since ShutdownGame edits game_path
const auto current_game = QString(current_game_path);
ShutdownGame();
BootGame(current_game);
}
void GMainWindow::OnPauseGame() {
@ -3380,6 +3385,7 @@ void GMainWindow::OnConfigureTas() {
return;
} else if (result == QDialog::Accepted) {
dialog.ApplyConfiguration();
OnSaveConfig();
}
}