| 1 | // Copyright 2017 Dolphin Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #include "DolphinQt/Settings/GeneralPane.h" |
| 5 | |
| 6 | #include <QCheckBox> |
| 7 | #include <QComboBox> |
| 8 | #include <QFormLayout> |
| 9 | #include <QGroupBox> |
| 10 | #include <QLabel> |
| 11 | #include <QPushButton> |
| 12 | #include <QSlider> |
| 13 | #include <QVBoxLayout> |
| 14 | #include <QWidget> |
| 15 | |
| 16 | #include "Core/AchievementManager.h" |
| 17 | #include "Core/Config/MainSettings.h" |
| 18 | #include "Core/Config/UISettings.h" |
| 19 | #include "Core/Core.h" |
| 20 | #include "Core/DolphinAnalytics.h" |
| 21 | #include "Core/System.h" |
| 22 | |
| 23 | #include "DolphinQt/Config/ConfigControls/ConfigBool.h" |
| 24 | #include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h" |
| 25 | #include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h" |
| 26 | #include "DolphinQt/Config/ToolTipControls/ToolTipPushButton.h" |
| 27 | #include "DolphinQt/QtUtils/ModalMessageBox.h" |
| 28 | #include "DolphinQt/QtUtils/SignalBlocking.h" |
| 29 | #include "DolphinQt/Settings.h" |
| 30 | |
| 31 | #include "UICommon/AutoUpdate.h" |
| 32 | #ifdef USE_DISCORD_PRESENCE |
| 33 | #include "UICommon/DiscordPresence.h" |
| 34 | #endif |
| 35 | |
| 36 | constexpr int AUTO_UPDATE_DISABLE_INDEX = 0; |
| 37 | constexpr int AUTO_UPDATE_RELEASE_INDEX = 1; |
| 38 | constexpr int AUTO_UPDATE_DEV_INDEX = 2; |
| 39 | |
| 40 | constexpr const char* AUTO_UPDATE_DISABLE_STRING = ""; |
| 41 | // Before the official switch to the rolling release cycle in 2407, de facto releases were called |
| 42 | // beta builds. To maintain backward compatibility and let users update from those builds to current |
| 43 | // releases the value of this string remains "beta". |
| 44 | constexpr const char* AUTO_UPDATE_RELEASE_STRING = "beta"; |
| 45 | constexpr const char* AUTO_UPDATE_DEV_STRING = "dev"; |
| 46 | |
| 47 | constexpr int FALLBACK_REGION_NTSCJ_INDEX = 0; |
| 48 | constexpr int FALLBACK_REGION_NTSCU_INDEX = 1; |
| 49 | constexpr int FALLBACK_REGION_PAL_INDEX = 2; |
| 50 | constexpr int FALLBACK_REGION_NTSCK_INDEX = 3; |
| 51 | |
| 52 | GeneralPane::GeneralPane(QWidget* parent) : QWidget(parent) |
| 53 | { |
| 54 | CreateLayout(); |
| 55 | LoadConfig(); |
| 56 | AddDescriptions(); |
| 57 | |
| 58 | ConnectLayout(); |
| 59 | |
| 60 | connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, |
| 61 | &GeneralPane::OnEmulationStateChanged); |
| 62 | connect(&Settings::Instance(), &Settings::ConfigChanged, this, &GeneralPane::LoadConfig); |
| 63 | |
| 64 | OnEmulationStateChanged(Core::GetState(Core::System::GetInstance())); |
| 65 | } |
| 66 | |
| 67 | void GeneralPane::CreateLayout() |
| 68 | { |
| 69 | m_main_layout = new QVBoxLayout; |
| 70 | // Create layout here |
| 71 | CreateBasic(); |
| 72 | |
| 73 | if (AutoUpdateChecker::SystemSupportsAutoUpdates()) |
| 74 | CreateAutoUpdate(); |
| 75 | |
| 76 | CreateFallbackRegion(); |
| 77 | |
| 78 | #if defined(USE_ANALYTICS) && USE_ANALYTICS |
| 79 | CreateAnalytics(); |
| 80 | #endif |
| 81 | |
| 82 | m_main_layout->addStretch(1); |
| 83 | setLayout(m_main_layout); |
| 84 | } |
| 85 | |
| 86 | void GeneralPane::OnEmulationStateChanged(Core::State state) |
| 87 | { |
| 88 | const bool running = state != Core::State::Uninitialized; |
| 89 | |
| 90 | m_checkbox_dualcore->setEnabled(!running); |
| 91 | m_checkbox_cheats->setEnabled(!running); |
| 92 | m_checkbox_load_games_into_memory->setEnabled(!running); |
| 93 | m_checkbox_override_region_settings->setEnabled(!running); |
| 94 | #ifdef USE_DISCORD_PRESENCE |
| 95 | m_checkbox_discord_presence->setEnabled(!running); |
| 96 | #endif |
| 97 | m_combobox_fallback_region->setEnabled(!running); |
| 98 | |
| 99 | UpdateDescriptionsUsingHardcoreStatus(); |
| 100 | } |
| 101 | |
| 102 | void GeneralPane::ConnectLayout() |
| 103 | { |
| 104 | connect(m_checkbox_cheats, &QCheckBox::toggled, &Settings::Instance(), |
| 105 | &Settings::EnableCheatsChanged); |
| 106 | #ifdef USE_DISCORD_PRESENCE |
| 107 | connect(m_checkbox_discord_presence, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig); |
| 108 | #endif |
| 109 | |
| 110 | if (AutoUpdateChecker::SystemSupportsAutoUpdates()) |
| 111 | { |
| 112 | connect(m_combobox_update_track, &QComboBox::currentIndexChanged, this, |
| 113 | &GeneralPane::OnSaveConfig); |
| 114 | connect(&Settings::Instance(), &Settings::AutoUpdateTrackChanged, this, |
| 115 | &GeneralPane::LoadConfig); |
| 116 | } |
| 117 | |
| 118 | // Advanced |
| 119 | connect(m_combobox_speedlimit, &QComboBox::currentIndexChanged, [this] { |
| 120 | Config::SetBaseOrCurrent(Config::MAIN_EMULATION_SPEED, |
| 121 | m_combobox_speedlimit->currentIndex() * 0.1f); |
| 122 | }); |
| 123 | |
| 124 | connect(m_combobox_fallback_region, &QComboBox::currentIndexChanged, this, |
| 125 | &GeneralPane::OnSaveConfig); |
| 126 | connect(&Settings::Instance(), &Settings::FallbackRegionChanged, this, &GeneralPane::LoadConfig); |
| 127 | |
| 128 | #if defined(USE_ANALYTICS) && USE_ANALYTICS |
| 129 | connect(&Settings::Instance(), &Settings::AnalyticsToggled, this, &GeneralPane::LoadConfig); |
| 130 | connect(m_checkbox_enable_analytics, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig); |
| 131 | connect(m_button_generate_new_identity, &QPushButton::clicked, this, |
| 132 | &GeneralPane::GenerateNewIdentity); |
| 133 | #endif |
| 134 | } |
| 135 | |
| 136 | void GeneralPane::CreateBasic() |
| 137 | { |
| 138 | auto* basic_group = new QGroupBox(tr("Basic Settings")); |
| 139 | auto* basic_group_layout = new QVBoxLayout; |
| 140 | basic_group->setLayout(basic_group_layout); |
| 141 | m_main_layout->addWidget(basic_group); |
| 142 | |
| 143 | m_checkbox_dualcore = new ConfigBool(tr("Enable Dual Core (speedhack)"), Config::MAIN_CPU_THREAD); |
| 144 | basic_group_layout->addWidget(m_checkbox_dualcore); |
| 145 | |
| 146 | m_checkbox_cheats = new ConfigBool(tr("Enable Cheats"), Config::MAIN_ENABLE_CHEATS); |
| 147 | basic_group_layout->addWidget(m_checkbox_cheats); |
| 148 | |
| 149 | m_checkbox_load_games_into_memory = |
| 150 | new ConfigBool(tr("Load Whole Game Into Memory"), Config::MAIN_LOAD_GAME_INTO_MEMORY); |
| 151 | basic_group_layout->addWidget(m_checkbox_load_games_into_memory); |
| 152 | m_checkbox_load_games_into_memory->SetDescription( |
| 153 | tr("Loads the running game into memory in the background." |
| 154 | "<br><br>This may improve performance with slow or high-latency storage." |
| 155 | "<br>System memory requirements will be much higher with this setting enabled." |
| 156 | "<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>")); |
| 157 | |
| 158 | m_checkbox_override_region_settings = |
| 159 | new ConfigBool(tr("Allow Mismatched Region Settings"), Config::MAIN_OVERRIDE_REGION_SETTINGS); |
| 160 | basic_group_layout->addWidget(m_checkbox_override_region_settings); |
| 161 | |
| 162 | m_checkbox_auto_disc_change = |
| 163 | new ConfigBool(tr("Change Discs Automatically"), Config::MAIN_AUTO_DISC_CHANGE); |
| 164 | basic_group_layout->addWidget(m_checkbox_auto_disc_change); |
| 165 | |
| 166 | #ifdef USE_DISCORD_PRESENCE |
| 167 | m_checkbox_discord_presence = new ToolTipCheckBox(tr("Show Current Game on Discord")); |
| 168 | basic_group_layout->addWidget(m_checkbox_discord_presence); |
| 169 | #endif |
| 170 | |
| 171 | auto* speed_limit_layout = new QFormLayout; |
| 172 | speed_limit_layout->setFormAlignment(Qt::AlignLeft | Qt::AlignTop); |
| 173 | speed_limit_layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); |
| 174 | basic_group_layout->addLayout(speed_limit_layout); |
| 175 | |
| 176 | m_combobox_speedlimit = new ToolTipComboBox(); |
| 177 | |
| 178 | m_combobox_speedlimit->addItem(tr("Unlimited")); |
| 179 | for (int i = 10; i <= 200; i += 10) // from 10% to 200% |
| 180 | { |
| 181 | QString str; |
| 182 | if (i != 100) |
| 183 | str = QStringLiteral("%1%").arg(i); |
| 184 | else |
| 185 | str = tr("%1% (Normal Speed)").arg(i); |
| 186 | |
| 187 | m_combobox_speedlimit->addItem(str); |
| 188 | } |
| 189 | |
| 190 | speed_limit_layout->addRow(tr("&Speed Limit:"), m_combobox_speedlimit); |
| 191 | } |
| 192 | |
| 193 | void GeneralPane::CreateAutoUpdate() |
| 194 | { |
| 195 | auto* auto_update_group = new QGroupBox(tr("Auto Update Settings")); |
| 196 | auto* auto_update_group_layout = new QFormLayout; |
| 197 | auto_update_group->setLayout(auto_update_group_layout); |
| 198 | m_main_layout->addWidget(auto_update_group); |
| 199 | |
| 200 | auto_update_group_layout->setFormAlignment(Qt::AlignLeft | Qt::AlignTop); |
| 201 | auto_update_group_layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); |
| 202 | |
| 203 | m_combobox_update_track = new ToolTipComboBox(); |
| 204 | |
| 205 | auto_update_group_layout->addRow(tr("&Auto Update:"), m_combobox_update_track); |
| 206 | |
| 207 | for (const QString& option : |
| 208 | {tr("Don't Update"), |
| 209 | // i18n: Releases is a noun. |
| 210 | tr("Releases (every few months)"), tr("Dev (multiple times a day)")}) |
| 211 | { |
| 212 | m_combobox_update_track->addItem(option); |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | void GeneralPane::CreateFallbackRegion() |
| 217 | { |
| 218 | auto* fallback_region_group = new QGroupBox(tr("Fallback Region")); |
| 219 | auto* fallback_region_group_layout = new QVBoxLayout; |
| 220 | fallback_region_group->setLayout(fallback_region_group_layout); |
| 221 | m_main_layout->addWidget(fallback_region_group); |
| 222 | |
| 223 | auto* fallback_region_dropdown_layout = new QFormLayout; |
| 224 | fallback_region_dropdown_layout->setFormAlignment(Qt::AlignLeft | Qt::AlignTop); |
| 225 | fallback_region_dropdown_layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); |
| 226 | fallback_region_group_layout->addLayout(fallback_region_dropdown_layout); |
| 227 | |
| 228 | m_combobox_fallback_region = new ToolTipComboBox(); |
| 229 | fallback_region_dropdown_layout->addRow(tr("Fallback Region:"), m_combobox_fallback_region); |
| 230 | |
| 231 | for (const QString& option : {tr("NTSC-J"), tr("NTSC-U"), tr("PAL"), tr("NTSC-K")}) |
| 232 | m_combobox_fallback_region->addItem(option); |
| 233 | } |
| 234 | |
| 235 | #if defined(USE_ANALYTICS) && USE_ANALYTICS |
| 236 | void GeneralPane::CreateAnalytics() |
| 237 | { |
| 238 | auto* analytics_group = new QGroupBox(tr("Usage Statistics Reporting Settings")); |
| 239 | auto* analytics_group_layout = new QVBoxLayout; |
| 240 | analytics_group->setLayout(analytics_group_layout); |
| 241 | m_main_layout->addWidget(analytics_group); |
| 242 | |
| 243 | m_checkbox_enable_analytics = new ToolTipCheckBox(tr("Enable Usage Statistics Reporting")); |
| 244 | m_button_generate_new_identity = new ToolTipPushButton(tr("Generate a New Statistics Identity")); |
| 245 | analytics_group_layout->addWidget(m_checkbox_enable_analytics); |
| 246 | analytics_group_layout->addWidget(m_button_generate_new_identity); |
| 247 | } |
| 248 | #endif |
| 249 | |
| 250 | void GeneralPane::LoadConfig() |
| 251 | { |
| 252 | const QSignalBlocker blocker(this); |
| 253 | |
| 254 | if (AutoUpdateChecker::SystemSupportsAutoUpdates()) |
| 255 | { |
| 256 | const auto track = Settings::Instance().GetAutoUpdateTrack().toStdString(); |
| 257 | |
| 258 | // If the track doesn't match any known value, set to "beta" which is the |
| 259 | // default config value on Dolphin release builds. |
| 260 | if (track == AUTO_UPDATE_DISABLE_STRING) |
| 261 | SignalBlocking(m_combobox_update_track)->setCurrentIndex(AUTO_UPDATE_DISABLE_INDEX); |
| 262 | else if (track == AUTO_UPDATE_DEV_STRING) |
| 263 | SignalBlocking(m_combobox_update_track)->setCurrentIndex(AUTO_UPDATE_DEV_INDEX); |
| 264 | else |
| 265 | SignalBlocking(m_combobox_update_track)->setCurrentIndex(AUTO_UPDATE_RELEASE_INDEX); |
| 266 | } |
| 267 | |
| 268 | #if defined(USE_ANALYTICS) && USE_ANALYTICS |
| 269 | SignalBlocking(m_checkbox_enable_analytics) |
| 270 | ->setChecked(Settings::Instance().IsAnalyticsEnabled()); |
| 271 | #endif |
| 272 | |
| 273 | #ifdef USE_DISCORD_PRESENCE |
| 274 | SignalBlocking(m_checkbox_discord_presence) |
| 275 | ->setChecked(Config::Get(Config::MAIN_USE_DISCORD_PRESENCE)); |
| 276 | #endif |
| 277 | int selection = qRound(Config::Get(Config::MAIN_EMULATION_SPEED) * 10); |
| 278 | if (selection < m_combobox_speedlimit->count()) |
| 279 | SignalBlocking(m_combobox_speedlimit)->setCurrentIndex(selection); |
| 280 | |
| 281 | const auto fallback = Settings::Instance().GetFallbackRegion(); |
| 282 | if (fallback == DiscIO::Region::NTSC_J) |
| 283 | SignalBlocking(m_combobox_fallback_region)->setCurrentIndex(FALLBACK_REGION_NTSCJ_INDEX); |
| 284 | else if (fallback == DiscIO::Region::NTSC_U) |
| 285 | SignalBlocking(m_combobox_fallback_region)->setCurrentIndex(FALLBACK_REGION_NTSCU_INDEX); |
| 286 | else if (fallback == DiscIO::Region::PAL) |
| 287 | SignalBlocking(m_combobox_fallback_region)->setCurrentIndex(FALLBACK_REGION_PAL_INDEX); |
| 288 | else if (fallback == DiscIO::Region::NTSC_K) |
| 289 | SignalBlocking(m_combobox_fallback_region)->setCurrentIndex(FALLBACK_REGION_NTSCK_INDEX); |
| 290 | else |
| 291 | SignalBlocking(m_combobox_fallback_region)->setCurrentIndex(FALLBACK_REGION_NTSCJ_INDEX); |
| 292 | } |
| 293 | |
| 294 | static QString UpdateTrackFromIndex(int index) |
| 295 | { |
| 296 | QString value; |
| 297 | |
| 298 | switch (index) |
| 299 | { |
| 300 | case AUTO_UPDATE_DISABLE_INDEX: |
| 301 | value = QString::fromStdString(AUTO_UPDATE_DISABLE_STRING); |
| 302 | break; |
| 303 | case AUTO_UPDATE_RELEASE_INDEX: |
| 304 | value = QString::fromStdString(AUTO_UPDATE_RELEASE_STRING); |
| 305 | break; |
| 306 | case AUTO_UPDATE_DEV_INDEX: |
| 307 | value = QString::fromStdString(AUTO_UPDATE_DEV_STRING); |
| 308 | break; |
| 309 | } |
| 310 | |
| 311 | return value; |
| 312 | } |
| 313 | |
| 314 | static DiscIO::Region UpdateFallbackRegionFromIndex(int index) |
| 315 | { |
| 316 | DiscIO::Region value = DiscIO::Region::Unknown; |
| 317 | |
| 318 | switch (index) |
| 319 | { |
| 320 | case FALLBACK_REGION_NTSCJ_INDEX: |
| 321 | value = DiscIO::Region::NTSC_J; |
| 322 | break; |
| 323 | case FALLBACK_REGION_NTSCU_INDEX: |
| 324 | value = DiscIO::Region::NTSC_U; |
| 325 | break; |
| 326 | case FALLBACK_REGION_PAL_INDEX: |
| 327 | value = DiscIO::Region::PAL; |
| 328 | break; |
| 329 | case FALLBACK_REGION_NTSCK_INDEX: |
| 330 | value = DiscIO::Region::NTSC_K; |
| 331 | break; |
| 332 | default: |
| 333 | value = DiscIO::Region::NTSC_J; |
| 334 | } |
| 335 | |
| 336 | return value; |
| 337 | } |
| 338 | |
| 339 | void GeneralPane::OnSaveConfig() |
| 340 | { |
| 341 | Config::ConfigChangeCallbackGuard config_guard; |
| 342 | |
| 343 | if (AutoUpdateChecker::SystemSupportsAutoUpdates()) |
| 344 | { |
| 345 | Settings::Instance().SetAutoUpdateTrack( |
| 346 | UpdateTrackFromIndex(m_combobox_update_track->currentIndex())); |
| 347 | } |
| 348 | |
| 349 | #ifdef USE_DISCORD_PRESENCE |
| 350 | Discord::SetDiscordPresenceEnabled(m_checkbox_discord_presence->isChecked()); |
| 351 | #endif |
| 352 | |
| 353 | #if defined(USE_ANALYTICS) && USE_ANALYTICS |
| 354 | Settings::Instance().SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked()); |
| 355 | DolphinAnalytics::Instance().ReloadConfig(); |
| 356 | #endif |
| 357 | Settings::Instance().SetFallbackRegion( |
| 358 | UpdateFallbackRegionFromIndex(m_combobox_fallback_region->currentIndex())); |
| 359 | } |
| 360 | |
| 361 | #if defined(USE_ANALYTICS) && USE_ANALYTICS |
| 362 | void GeneralPane::GenerateNewIdentity() |
| 363 | { |
| 364 | DolphinAnalytics::Instance().GenerateNewIdentity(); |
| 365 | DolphinAnalytics::Instance().ReloadConfig(); |
| 366 | ModalMessageBox message_box(this); |
| 367 | message_box.setIcon(QMessageBox::Information); |
| 368 | message_box.setWindowTitle(tr("Identity Generation")); |
| 369 | message_box.setText(tr("New identity generated.")); |
| 370 | message_box.exec(); |
| 371 | } |
| 372 | #endif |
| 373 | |
| 374 | void GeneralPane::AddDescriptions() |
| 375 | { |
| 376 | static constexpr char TR_DUALCORE_DESCRIPTION[] = |
| 377 | QT_TR_NOOP("Separates CPU and GPU emulation work to separate threads. Reduces single-thread " |
| 378 | "burden by spreading Dolphin's heaviest load across two cores, which usually " |
| 379 | "improves performance. However, it can result in glitches and crashes." |
| 380 | "<br><br>This setting cannot be changed while emulation is active." |
| 381 | "<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"); |
| 382 | static constexpr char TR_CHEATS_DESCRIPTION[] = QT_TR_NOOP( |
| 383 | "Enables the use of AR and Gecko cheat codes which can be used to modify games' behavior. " |
| 384 | "These codes can be configured with the Cheats Manager in the Tools menu." |
| 385 | "<br><br>This setting cannot be changed while emulation is active." |
| 386 | "<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"); |
| 387 | static constexpr char TR_OVERRIDE_REGION_SETTINGS_DESCRIPTION[] = |
| 388 | QT_TR_NOOP("Lets you use languages and other region-related settings that the game may not " |
| 389 | "be designed for. May cause various crashes and bugs." |
| 390 | "<br><br>This setting cannot be changed while emulation is active." |
| 391 | "<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"); |
| 392 | static constexpr char TR_AUTO_DISC_CHANGE_DESCRIPTION[] = QT_TR_NOOP( |
| 393 | "Automatically changes the game disc when requested by games with two discs. This feature " |
| 394 | "requires the game to be launched in one of the following ways:" |
| 395 | "<br>- From the game list, with both discs being present in the game list." |
| 396 | "<br>- With File > Open or the command line interface, with the paths to both discs being " |
| 397 | "provided." |
| 398 | "<br>- By launching an M3U file with File > Open or the command line interface." |
| 399 | "<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"); |
| 400 | #ifdef USE_DISCORD_PRESENCE |
| 401 | static constexpr char TR_DISCORD_PRESENCE_DESCRIPTION[] = |
| 402 | QT_TR_NOOP("Shows which game is active and the duration of your current play session in your " |
| 403 | "Discord status." |
| 404 | "<br><br>This setting cannot be changed while emulation is active." |
| 405 | "<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>"); |
| 406 | #endif |
| 407 | static constexpr char TR_UPDATE_TRACK_DESCRIPTION[] = QT_TR_NOOP( |
| 408 | "Selects which update track Dolphin uses when checking for updates at startup. If a new " |
| 409 | "update is available, Dolphin will show a list of changes made since your current version " |
| 410 | "and ask you if you want to update." |
| 411 | "<br><br>The Dev track has the latest version of Dolphin which often updates multiple times " |
| 412 | "per day. Select this track if you want the newest features and fixes." |
| 413 | "<br><br>The Releases track has an update every few months. Some reasons you might prefer to " |
| 414 | "use this track:" |
| 415 | "<br>- You prefer using versions that have had additional testing." |
| 416 | "<br>- NetPlay requires players to have the same Dolphin version, and the latest Release " |
| 417 | "version will have the most players to match with." |
| 418 | "<br>- You frequently use Dolphin's savestate system, which doesn't guarantee backward " |
| 419 | "compatibility of savestates between Dolphin versions. If this applies to you, make sure you " |
| 420 | "make an in-game save before updating (i.e. save your game in the same way you would on a " |
| 421 | "physical GameCube or Wii), then load the in-game save after updating Dolphin and before " |
| 422 | "making any new savestates." |
| 423 | "<br><br>Selecting \"Don't Update\" will prevent Dolphin from automatically checking for " |
| 424 | "updates." |
| 425 | "<br><br><dolphin_emphasis>If unsure, select Releases.</dolphin_emphasis>"); |
| 426 | static constexpr char TR_FALLBACK_REGION_DESCRIPTION[] = |
| 427 | QT_TR_NOOP("Sets the region used for titles whose region cannot be determined automatically." |
| 428 | "<br><br>This setting cannot be changed while emulation is active."); |
| 429 | #if defined(USE_ANALYTICS) && USE_ANALYTICS |
| 430 | static constexpr char TR_ENABLE_ANALYTICS_DESCRIPTION[] = QT_TR_NOOP( |
| 431 | "If selected, Dolphin can collect data on its performance, feature usage, emulated games, " |
| 432 | "and configuration, as well as data on your system's hardware and operating system." |
| 433 | "<br><br>No private data is ever collected. This data helps us understand how people and " |
| 434 | "emulated games use Dolphin and prioritize our efforts. It also helps us identify rare " |
| 435 | "configurations that are causing bugs, performance and stability issues."); |
| 436 | static constexpr char TR_GENERATE_NEW_IDENTITY_DESCRIPTION[] = |
| 437 | QT_TR_NOOP("Generate a new anonymous ID for your usage statistics. This will cause any " |
| 438 | "future statistics to be unassociated with your previous statistics."); |
| 439 | #endif |
| 440 | |
| 441 | m_checkbox_dualcore->SetDescription(tr(TR_DUALCORE_DESCRIPTION)); |
| 442 | |
| 443 | m_checkbox_cheats->SetDescription(tr(TR_CHEATS_DESCRIPTION)); |
| 444 | |
| 445 | m_checkbox_override_region_settings->SetDescription(tr(TR_OVERRIDE_REGION_SETTINGS_DESCRIPTION)); |
| 446 | |
| 447 | m_checkbox_auto_disc_change->SetDescription(tr(TR_AUTO_DISC_CHANGE_DESCRIPTION)); |
| 448 | |
| 449 | #ifdef USE_DISCORD_PRESENCE |
| 450 | m_checkbox_discord_presence->SetDescription(tr(TR_DISCORD_PRESENCE_DESCRIPTION)); |
| 451 | #endif |
| 452 | |
| 453 | m_combobox_speedlimit->SetTitle(tr("Speed Limit")); |
| 454 | |
| 455 | if (AutoUpdateChecker::SystemSupportsAutoUpdates()) |
| 456 | { |
| 457 | m_combobox_update_track->SetTitle(tr("Auto Update")); |
| 458 | m_combobox_update_track->SetDescription(tr(TR_UPDATE_TRACK_DESCRIPTION)); |
| 459 | } |
| 460 | |
| 461 | m_combobox_fallback_region->SetTitle(tr("Fallback Region")); |
| 462 | m_combobox_fallback_region->SetDescription(tr(TR_FALLBACK_REGION_DESCRIPTION)); |
| 463 | |
| 464 | #if defined(USE_ANALYTICS) && USE_ANALYTICS |
| 465 | m_checkbox_enable_analytics->SetDescription(tr(TR_ENABLE_ANALYTICS_DESCRIPTION)); |
| 466 | |
| 467 | m_button_generate_new_identity->SetTitle(tr("Generate a New Statistics Identity")); |
| 468 | m_button_generate_new_identity->SetDescription(tr(TR_GENERATE_NEW_IDENTITY_DESCRIPTION)); |
| 469 | #endif |
| 470 | } |
| 471 | |
| 472 | void GeneralPane::UpdateDescriptionsUsingHardcoreStatus() |
| 473 | { |
| 474 | const bool hardcore_enabled = AchievementManager::GetInstance().IsHardcoreModeActive(); |
| 475 | |
| 476 | static constexpr char TR_SPEEDLIMIT_DESCRIPTION[] = |
| 477 | QT_TR_NOOP("Controls how fast emulation runs relative to the original hardware." |
| 478 | "<br><br>Values higher than 100% will emulate faster than the original hardware " |
| 479 | "can run, if your hardware is able to keep up. Values lower than 100% will slow " |
| 480 | "emulation instead. Unlimited will emulate as fast as your hardware is able to." |
| 481 | "<br><br><dolphin_emphasis>If unsure, select 100%.</dolphin_emphasis>"); |
| 482 | static constexpr char TR_SPEEDLIMIT_RESTRICTION_IN_HARDCORE_DESCRIPTION[] = |
| 483 | QT_TR_NOOP("<dolphin_emphasis>When Hardcore Mode is enabled, Speed Limit values less than " |
| 484 | "100% will be treated as 100%.</dolphin_emphasis>"); |
| 485 | |
| 486 | if (hardcore_enabled) |
| 487 | { |
| 488 | m_combobox_speedlimit->SetDescription( |
| 489 | tr("%1<br><br>%2") |
| 490 | .arg(tr(TR_SPEEDLIMIT_DESCRIPTION)) |
| 491 | .arg(tr(TR_SPEEDLIMIT_RESTRICTION_IN_HARDCORE_DESCRIPTION))); |
| 492 | } |
| 493 | else |
| 494 | { |
| 495 | m_combobox_speedlimit->SetDescription(tr(TR_SPEEDLIMIT_DESCRIPTION)); |
| 496 | } |
| 497 | } |