diff options
| author | 2023-02-16 22:58:29 -0500 | |
|---|---|---|
| committer | 2023-02-16 22:58:29 -0500 | |
| commit | 61b1772e510523813b0642b51113135148e0ce5a (patch) | |
| tree | 807562743402b5348e5a14c1da522dac2d9b0fd6 /src | |
| parent | Merge pull request #9802 from Kelebek1/wait_data_cache (diff) | |
| parent | yuzu: Shutdown game on restart to reload per game config (diff) | |
| download | yuzu-61b1772e510523813b0642b51113135148e0ce5a.tar.gz yuzu-61b1772e510523813b0642b51113135148e0ce5a.tar.xz yuzu-61b1772e510523813b0642b51113135148e0ce5a.zip | |
Merge pull request #9817 from german77/save
yuzu: Write to config file on important config changes
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/game_list.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/game_list.h | 1 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 10 |
4 files changed, 11 insertions, 2 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 31209fb2e..db68ed259 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -1103,6 +1103,7 @@ void Config::SaveValues() { | |||
| 1103 | SaveRendererValues(); | 1103 | SaveRendererValues(); |
| 1104 | SaveAudioValues(); | 1104 | SaveAudioValues(); |
| 1105 | SaveSystemValues(); | 1105 | SaveSystemValues(); |
| 1106 | qt_config->sync(); | ||
| 1106 | } | 1107 | } |
| 1107 | 1108 | ||
| 1108 | void Config::SaveAudioValues() { | 1109 | void Config::SaveAudioValues() { |
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 22aa19c56..c21828b1d 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -870,6 +870,7 @@ void GameList::ToggleFavorite(u64 program_id) { | |||
| 870 | tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true); | 870 | tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true); |
| 871 | } | 871 | } |
| 872 | } | 872 | } |
| 873 | SaveConfig(); | ||
| 873 | } | 874 | } |
| 874 | 875 | ||
| 875 | void GameList::AddFavorite(u64 program_id) { | 876 | void GameList::AddFavorite(u64 program_id) { |
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index f7ff93ed9..64e5af4c1 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h | |||
| @@ -122,6 +122,7 @@ signals: | |||
| 122 | void AddDirectory(); | 122 | void AddDirectory(); |
| 123 | void ShowList(bool show); | 123 | void ShowList(bool show); |
| 124 | void PopulatingCompleted(); | 124 | void PopulatingCompleted(); |
| 125 | void SaveConfig(); | ||
| 125 | 126 | ||
| 126 | private slots: | 127 | private slots: |
| 127 | void OnItemExpanded(const QModelIndex& item); | 128 | void OnItemExpanded(const QModelIndex& item); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index a1c18ff90..5560a30bd 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1271,6 +1271,7 @@ void GMainWindow::ConnectWidgetEvents() { | |||
| 1271 | connect(game_list, &GameList::ShowList, this, &GMainWindow::OnGameListShowList); | 1271 | connect(game_list, &GameList::ShowList, this, &GMainWindow::OnGameListShowList); |
| 1272 | connect(game_list, &GameList::PopulatingCompleted, | 1272 | connect(game_list, &GameList::PopulatingCompleted, |
| 1273 | [this] { multiplayer_state->UpdateGameList(game_list->GetModel()); }); | 1273 | [this] { multiplayer_state->UpdateGameList(game_list->GetModel()); }); |
| 1274 | connect(game_list, &GameList::SaveConfig, this, &GMainWindow::OnSaveConfig); | ||
| 1274 | 1275 | ||
| 1275 | connect(game_list, &GameList::OpenPerGameGeneralRequested, this, | 1276 | connect(game_list, &GameList::OpenPerGameGeneralRequested, this, |
| 1276 | &GMainWindow::OnGameListOpenPerGameProperties); | 1277 | &GMainWindow::OnGameListOpenPerGameProperties); |
| @@ -2654,6 +2655,8 @@ void GMainWindow::OnGameListAddDirectory() { | |||
| 2654 | } else { | 2655 | } else { |
| 2655 | LOG_WARNING(Frontend, "Selected directory is already in the game list"); | 2656 | LOG_WARNING(Frontend, "Selected directory is already in the game list"); |
| 2656 | } | 2657 | } |
| 2658 | |||
| 2659 | OnSaveConfig(); | ||
| 2657 | } | 2660 | } |
| 2658 | 2661 | ||
| 2659 | void GMainWindow::OnGameListShowList(bool show) { | 2662 | void GMainWindow::OnGameListShowList(bool show) { |
| @@ -3015,8 +3018,10 @@ void GMainWindow::OnRestartGame() { | |||
| 3015 | if (!system->IsPoweredOn()) { | 3018 | if (!system->IsPoweredOn()) { |
| 3016 | return; | 3019 | return; |
| 3017 | } | 3020 | } |
| 3018 | // Make a copy since BootGame edits game_path | 3021 | // Make a copy since ShutdownGame edits game_path |
| 3019 | BootGame(QString(current_game_path)); | 3022 | const auto current_game = QString(current_game_path); |
| 3023 | ShutdownGame(); | ||
| 3024 | BootGame(current_game); | ||
| 3020 | } | 3025 | } |
| 3021 | 3026 | ||
| 3022 | void GMainWindow::OnPauseGame() { | 3027 | void GMainWindow::OnPauseGame() { |
| @@ -3380,6 +3385,7 @@ void GMainWindow::OnConfigureTas() { | |||
| 3380 | return; | 3385 | return; |
| 3381 | } else if (result == QDialog::Accepted) { | 3386 | } else if (result == QDialog::Accepted) { |
| 3382 | dialog.ApplyConfiguration(); | 3387 | dialog.ApplyConfiguration(); |
| 3388 | OnSaveConfig(); | ||
| 3383 | } | 3389 | } |
| 3384 | } | 3390 | } |
| 3385 | 3391 | ||