diff options
| author | 2023-12-18 19:32:13 -0600 | |
|---|---|---|
| committer | 2023-12-18 20:28:55 -0600 | |
| commit | 53956a299060ee71d77f08adbc45aaac217be376 (patch) | |
| tree | cdd3c0f5c4a42deb484d5a31ec597b1925d71ae0 /src | |
| parent | Merge pull request #12342 from FearlessTobi/fix-msvc (diff) | |
| download | yuzu-53956a299060ee71d77f08adbc45aaac217be376.tar.gz yuzu-53956a299060ee71d77f08adbc45aaac217be376.tar.xz yuzu-53956a299060ee71d77f08adbc45aaac217be376.zip | |
yuzu: Make language persistent and remove symbols_path
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/configuration/configure_ui.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/qt_config.cpp | 5 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/uisettings.h | 3 |
4 files changed, 6 insertions, 12 deletions
diff --git a/src/yuzu/configuration/configure_ui.cpp b/src/yuzu/configuration/configure_ui.cpp index dd43f0a0e..c8e871151 100644 --- a/src/yuzu/configuration/configure_ui.cpp +++ b/src/yuzu/configuration/configure_ui.cpp | |||
| @@ -193,8 +193,8 @@ void ConfigureUi::RequestGameListUpdate() { | |||
| 193 | void ConfigureUi::SetConfiguration() { | 193 | void ConfigureUi::SetConfiguration() { |
| 194 | ui->theme_combobox->setCurrentIndex( | 194 | ui->theme_combobox->setCurrentIndex( |
| 195 | ui->theme_combobox->findData(QString::fromStdString(UISettings::values.theme))); | 195 | ui->theme_combobox->findData(QString::fromStdString(UISettings::values.theme))); |
| 196 | ui->language_combobox->setCurrentIndex( | 196 | ui->language_combobox->setCurrentIndex(ui->language_combobox->findData( |
| 197 | ui->language_combobox->findData(QString::fromStdString(UISettings::values.language))); | 197 | QString::fromStdString(UISettings::values.language.GetValue()))); |
| 198 | ui->show_add_ons->setChecked(UISettings::values.show_add_ons.GetValue()); | 198 | ui->show_add_ons->setChecked(UISettings::values.show_add_ons.GetValue()); |
| 199 | ui->show_compat->setChecked(UISettings::values.show_compat.GetValue()); | 199 | ui->show_compat->setChecked(UISettings::values.show_compat.GetValue()); |
| 200 | ui->show_size->setChecked(UISettings::values.show_size.GetValue()); | 200 | ui->show_size->setChecked(UISettings::values.show_size.GetValue()); |
diff --git a/src/yuzu/configuration/qt_config.cpp b/src/yuzu/configuration/qt_config.cpp index 636c5e640..417a43ec5 100644 --- a/src/yuzu/configuration/qt_config.cpp +++ b/src/yuzu/configuration/qt_config.cpp | |||
| @@ -187,7 +187,6 @@ void QtConfig::ReadPathValues() { | |||
| 187 | BeginGroup(Settings::TranslateCategory(Settings::Category::Paths)); | 187 | BeginGroup(Settings::TranslateCategory(Settings::Category::Paths)); |
| 188 | 188 | ||
| 189 | UISettings::values.roms_path = ReadStringSetting(std::string("romsPath")); | 189 | UISettings::values.roms_path = ReadStringSetting(std::string("romsPath")); |
| 190 | UISettings::values.symbols_path = ReadStringSetting(std::string("symbolsPath")); | ||
| 191 | UISettings::values.game_dir_deprecated = | 190 | UISettings::values.game_dir_deprecated = |
| 192 | ReadStringSetting(std::string("gameListRootDir"), std::string(".")); | 191 | ReadStringSetting(std::string("gameListRootDir"), std::string(".")); |
| 193 | UISettings::values.game_dir_deprecated_deepscan = | 192 | UISettings::values.game_dir_deprecated_deepscan = |
| @@ -225,8 +224,6 @@ void QtConfig::ReadPathValues() { | |||
| 225 | UISettings::values.recent_files = | 224 | UISettings::values.recent_files = |
| 226 | QString::fromStdString(ReadStringSetting(std::string("recentFiles"))) | 225 | QString::fromStdString(ReadStringSetting(std::string("recentFiles"))) |
| 227 | .split(QStringLiteral(", "), Qt::SkipEmptyParts, Qt::CaseSensitive); | 226 | .split(QStringLiteral(", "), Qt::SkipEmptyParts, Qt::CaseSensitive); |
| 228 | UISettings::values.language = | ||
| 229 | ReadStringSetting(std::string("language"), std::make_optional(std::string(""))); | ||
| 230 | 227 | ||
| 231 | EndGroup(); | 228 | EndGroup(); |
| 232 | } | 229 | } |
| @@ -409,7 +406,6 @@ void QtConfig::SavePathValues() { | |||
| 409 | BeginGroup(Settings::TranslateCategory(Settings::Category::Paths)); | 406 | BeginGroup(Settings::TranslateCategory(Settings::Category::Paths)); |
| 410 | 407 | ||
| 411 | WriteSetting(std::string("romsPath"), UISettings::values.roms_path); | 408 | WriteSetting(std::string("romsPath"), UISettings::values.roms_path); |
| 412 | WriteSetting(std::string("symbolsPath"), UISettings::values.symbols_path); | ||
| 413 | BeginArray(std::string("gamedirs")); | 409 | BeginArray(std::string("gamedirs")); |
| 414 | for (int i = 0; i < UISettings::values.game_dirs.size(); ++i) { | 410 | for (int i = 0; i < UISettings::values.game_dirs.size(); ++i) { |
| 415 | SetArrayIndex(i); | 411 | SetArrayIndex(i); |
| @@ -422,7 +418,6 @@ void QtConfig::SavePathValues() { | |||
| 422 | 418 | ||
| 423 | WriteSetting(std::string("recentFiles"), | 419 | WriteSetting(std::string("recentFiles"), |
| 424 | UISettings::values.recent_files.join(QStringLiteral(", ")).toStdString()); | 420 | UISettings::values.recent_files.join(QStringLiteral(", ")).toStdString()); |
| 425 | WriteSetting(std::string("language"), UISettings::values.language); | ||
| 426 | 421 | ||
| 427 | EndGroup(); | 422 | EndGroup(); |
| 428 | } | 423 | } |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f31ed7ebb..059fcf041 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -5147,12 +5147,12 @@ void GMainWindow::UpdateUITheme() { | |||
| 5147 | void GMainWindow::LoadTranslation() { | 5147 | void GMainWindow::LoadTranslation() { |
| 5148 | bool loaded; | 5148 | bool loaded; |
| 5149 | 5149 | ||
| 5150 | if (UISettings::values.language.empty()) { | 5150 | if (UISettings::values.language.GetValue().empty()) { |
| 5151 | // If the selected language is empty, use system locale | 5151 | // If the selected language is empty, use system locale |
| 5152 | loaded = translator.load(QLocale(), {}, {}, QStringLiteral(":/languages/")); | 5152 | loaded = translator.load(QLocale(), {}, {}, QStringLiteral(":/languages/")); |
| 5153 | } else { | 5153 | } else { |
| 5154 | // Otherwise load from the specified file | 5154 | // Otherwise load from the specified file |
| 5155 | loaded = translator.load(QString::fromStdString(UISettings::values.language), | 5155 | loaded = translator.load(QString::fromStdString(UISettings::values.language.GetValue()), |
| 5156 | QStringLiteral(":/languages/")); | 5156 | QStringLiteral(":/languages/")); |
| 5157 | } | 5157 | } |
| 5158 | 5158 | ||
| @@ -5164,7 +5164,7 @@ void GMainWindow::LoadTranslation() { | |||
| 5164 | } | 5164 | } |
| 5165 | 5165 | ||
| 5166 | void GMainWindow::OnLanguageChanged(const QString& locale) { | 5166 | void GMainWindow::OnLanguageChanged(const QString& locale) { |
| 5167 | if (UISettings::values.language != std::string("en")) { | 5167 | if (UISettings::values.language.GetValue() != std::string("en")) { |
| 5168 | qApp->removeTranslator(&translator); | 5168 | qApp->removeTranslator(&translator); |
| 5169 | } | 5169 | } |
| 5170 | 5170 | ||
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 549a39e1b..f9906be33 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h | |||
| @@ -154,12 +154,11 @@ struct Values { | |||
| 154 | Setting<u32> screenshot_height{linkage, 0, "screenshot_height", Category::Screenshots}; | 154 | Setting<u32> screenshot_height{linkage, 0, "screenshot_height", Category::Screenshots}; |
| 155 | 155 | ||
| 156 | std::string roms_path; | 156 | std::string roms_path; |
| 157 | std::string symbols_path; | ||
| 158 | std::string game_dir_deprecated; | 157 | std::string game_dir_deprecated; |
| 159 | bool game_dir_deprecated_deepscan; | 158 | bool game_dir_deprecated_deepscan; |
| 160 | QVector<GameDir> game_dirs; | 159 | QVector<GameDir> game_dirs; |
| 161 | QStringList recent_files; | 160 | QStringList recent_files; |
| 162 | std::string language; | 161 | Setting<std::string> language{linkage, {}, "language", Category::Paths}; |
| 163 | 162 | ||
| 164 | std::string theme; | 163 | std::string theme; |
| 165 | 164 | ||