| 1 | // Copyright 2017 Dolphin Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #include "DolphinQt/Settings/InterfacePane.h" |
| 5 | |
| 6 | #include <QCheckBox> |
| 7 | #include <QComboBox> |
| 8 | #include <QFileInfo> |
| 9 | #include <QFormLayout> |
| 10 | #include <QGroupBox> |
| 11 | #include <QLabel> |
| 12 | #include <QRadioButton> |
| 13 | #include <QVBoxLayout> |
| 14 | #include <QWidget> |
| 15 | |
| 16 | #include "Common/CommonPaths.h" |
| 17 | #include "Common/FileSearch.h" |
| 18 | #include "Common/FileUtil.h" |
| 19 | #include "Common/StringUtil.h" |
| 20 | |
| 21 | #include "Core/AchievementManager.h" |
| 22 | #include "Core/Config/MainSettings.h" |
| 23 | #include "Core/Config/UISettings.h" |
| 24 | #include "Core/Core.h" |
| 25 | #include "Core/System.h" |
| 26 | |
| 27 | #include "DolphinQt/Config/ConfigControls/ConfigBool.h" |
| 28 | #include "DolphinQt/Config/ConfigControls/ConfigChoice.h" |
| 29 | #include "DolphinQt/Config/ConfigControls/ConfigRadio.h" |
| 30 | #include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h" |
| 31 | #include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h" |
| 32 | #include "DolphinQt/QtUtils/ModalMessageBox.h" |
| 33 | #include "DolphinQt/QtUtils/SignalBlocking.h" |
| 34 | #include "DolphinQt/Settings.h" |
| 35 | |
| 36 | static ConfigStringChoice* MakeLanguageComboBox() |
| 37 | { |
| 38 | using QPair = std::pair<QString, QString>; |
| 39 | std::vector<QPair> languages = { |
| 40 | QPair{QObject::tr("<System Language>"), QString{}}, |
| 41 | QPair{QStringLiteral(u"Bahasa Melayu"), QStringLiteral("ms")}, // Malay |
| 42 | QPair{QStringLiteral(u"Catal\u00E0"), QStringLiteral("ca")}, // Catalan |
| 43 | QPair{QStringLiteral(u"\u010Ce\u0161tina"), QStringLiteral("cs")}, // Czech |
| 44 | QPair{QStringLiteral(u"Dansk"), QStringLiteral("da")}, // Danish |
| 45 | QPair{QStringLiteral(u"Deutsch"), QStringLiteral("de")}, // German |
| 46 | QPair{QStringLiteral(u"English"), QStringLiteral("en")}, // English |
| 47 | QPair{QStringLiteral(u"Espa\u00F1ol"), QStringLiteral("es")}, // Spanish |
| 48 | QPair{QStringLiteral(u"Fran\u00E7ais"), QStringLiteral("fr")}, // French |
| 49 | QPair{QStringLiteral(u"Hrvatski"), QStringLiteral("hr")}, // Croatian |
| 50 | QPair{QStringLiteral(u"Italiano"), QStringLiteral("it")}, // Italian |
| 51 | QPair{QStringLiteral(u"Magyar"), QStringLiteral("hu")}, // Hungarian |
| 52 | QPair{QStringLiteral(u"Nederlands"), QStringLiteral("nl")}, // Dutch |
| 53 | QPair{QStringLiteral(u"Norsk bokm\u00E5l"), QStringLiteral("nb")}, // Norwegian |
| 54 | QPair{QStringLiteral(u"Polski"), QStringLiteral("pl")}, // Polish |
| 55 | QPair{QStringLiteral(u"Portugu\u00EAs"), QStringLiteral("pt")}, // Portuguese |
| 56 | QPair{QStringLiteral(u"Portugu\u00EAs (Brasil)"), |
| 57 | QStringLiteral("pt_BR")}, // Portuguese (Brazil) |
| 58 | QPair{QStringLiteral(u"Rom\u00E2n\u0103"), QStringLiteral("ro")}, // Romanian |
| 59 | QPair{QStringLiteral(u"Srpski"), QStringLiteral("sr")}, // Serbian |
| 60 | QPair{QStringLiteral(u"Suomi"), QStringLiteral("fi")}, // Finnish |
| 61 | QPair{QStringLiteral(u"Svenska"), QStringLiteral("sv")}, // Swedish |
| 62 | QPair{QStringLiteral(u"T\u00FCrk\u00E7e"), QStringLiteral("tr")}, // Turkish |
| 63 | QPair{QStringLiteral(u"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"), |
| 64 | QStringLiteral("el")}, // Greek |
| 65 | QPair{QStringLiteral(u"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"), |
| 66 | QStringLiteral("ru")}, // Russian |
| 67 | QPair{QStringLiteral(u"\u0627\u0644\u0639\u0631\u0628\u064A\u0629"), |
| 68 | QStringLiteral("ar")}, // Arabic |
| 69 | QPair{QStringLiteral(u"\u0641\u0627\u0631\u0633\u06CC"), QStringLiteral("fa")}, // Farsi |
| 70 | QPair{QStringLiteral(u"\uD55C\uAD6D\uC5B4"), QStringLiteral("ko")}, // Korean |
| 71 | QPair{QStringLiteral(u"\u65E5\u672C\u8A9E"), QStringLiteral("ja")}, // Japanese |
| 72 | QPair{QStringLiteral(u"\u7B80\u4F53\u4E2D\u6587"), |
| 73 | QStringLiteral("zh_CN")}, // Simplified Chinese |
| 74 | QPair{QStringLiteral(u"\u7E41\u9AD4\u4E2D\u6587"), |
| 75 | QStringLiteral("zh_TW")}, // Traditional Chinese |
| 76 | }; |
| 77 | |
| 78 | auto* const combobox = new ConfigStringChoice(languages, Config::MAIN_INTERFACE_LANGUAGE); |
| 79 | |
| 80 | // The default, QComboBox::AdjustToContentsOnFirstShow, causes a noticeable pause when opening the |
| 81 | // SettingWindow for the first time. The culprit seems to be non-Latin graphemes in the above |
| 82 | // list. QComboBox::AdjustToContents still has some lag but it's much less noticeable. |
| 83 | combobox->setSizeAdjustPolicy(QComboBox::AdjustToContents); |
| 84 | |
| 85 | return combobox; |
| 86 | } |
| 87 | |
| 88 | InterfacePane::InterfacePane(QWidget* parent) : QWidget(parent) |
| 89 | { |
| 90 | CreateLayout(); |
| 91 | UpdateShowDebuggingCheckbox(); |
| 92 | LoadUserStyle(); |
| 93 | ConnectLayout(); |
| 94 | |
| 95 | connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, |
| 96 | &InterfacePane::UpdateShowDebuggingCheckbox); |
| 97 | connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, |
| 98 | &InterfacePane::OnEmulationStateChanged); |
| 99 | |
| 100 | OnEmulationStateChanged(Core::GetState(Core::System::GetInstance())); |
| 101 | } |
| 102 | |
| 103 | void InterfacePane::CreateLayout() |
| 104 | { |
| 105 | m_main_layout = new QVBoxLayout; |
| 106 | // Create layout here |
| 107 | CreateUI(); |
| 108 | CreateInGame(); |
| 109 | AddDescriptions(); |
| 110 | |
| 111 | m_main_layout->addStretch(1); |
| 112 | setLayout(m_main_layout); |
| 113 | } |
| 114 | |
| 115 | void InterfacePane::CreateUI() |
| 116 | { |
| 117 | auto* groupbox = new QGroupBox(tr("User Interface")); |
| 118 | auto* groupbox_layout = new QVBoxLayout; |
| 119 | groupbox->setLayout(groupbox_layout); |
| 120 | m_main_layout->addWidget(groupbox); |
| 121 | |
| 122 | auto* combobox_layout = new QFormLayout; |
| 123 | combobox_layout->setFormAlignment(Qt::AlignLeft | Qt::AlignTop); |
| 124 | combobox_layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); |
| 125 | |
| 126 | groupbox_layout->addLayout(combobox_layout); |
| 127 | |
| 128 | m_combobox_language = MakeLanguageComboBox(); |
| 129 | combobox_layout->addRow(tr("&Language:"), m_combobox_language); |
| 130 | |
| 131 | // List available themes |
| 132 | auto theme_paths = Common::DoFileSearch( |
| 133 | {{File::GetUserPath(D_THEMES_IDX), File::GetSysDirectory() + THEMES_DIR}}); |
| 134 | std::vector<std::string> theme_names; |
| 135 | theme_names.reserve(theme_paths.size()); |
| 136 | std::ranges::transform(theme_paths, std::back_inserter(theme_names), PathToFileName); |
| 137 | |
| 138 | // Theme Combobox |
| 139 | m_combobox_theme = new ConfigStringChoice(theme_names, Config::MAIN_THEME_NAME); |
| 140 | combobox_layout->addRow(tr("&Theme:"), m_combobox_theme); |
| 141 | |
| 142 | // User Style Combobox |
| 143 | m_combobox_userstyle = new ToolTipComboBox; |
| 144 | m_label_userstyle = new QLabel(tr("Style:")); |
| 145 | combobox_layout->addRow(m_label_userstyle, m_combobox_userstyle); |
| 146 | |
| 147 | auto userstyle_search_results = Common::DoFileSearch(File::GetUserPath(D_STYLES_IDX)); |
| 148 | |
| 149 | m_combobox_userstyle->addItem(tr("(System)"), static_cast<int>(Settings::StyleType::System)); |
| 150 | |
| 151 | // TODO: Support forcing light/dark on other OSes too. |
| 152 | #ifdef _WIN32 |
| 153 | m_combobox_userstyle->addItem(tr("(Light)"), static_cast<int>(Settings::StyleType::Light)); |
| 154 | m_combobox_userstyle->addItem(tr("(Dark)"), static_cast<int>(Settings::StyleType::Dark)); |
| 155 | #endif |
| 156 | |
| 157 | m_combobox_userstyle->addItem(tr("(Fusion Light)"), |
| 158 | static_cast<int>(Settings::StyleType::FusionLight)); |
| 159 | m_combobox_userstyle->addItem(tr("(Fusion Dark Gray)"), |
| 160 | static_cast<int>(Settings::StyleType::FusionDarkGray)); |
| 161 | m_combobox_userstyle->addItem(tr("(Fusion Dark)"), |
| 162 | static_cast<int>(Settings::StyleType::FusionDark)); |
| 163 | |
| 164 | for (const std::string& path : userstyle_search_results) |
| 165 | { |
| 166 | const QFileInfo file_info(QString::fromStdString(path)); |
| 167 | m_combobox_userstyle->addItem(file_info.completeBaseName(), file_info.fileName()); |
| 168 | } |
| 169 | |
| 170 | // Checkboxes |
| 171 | m_checkbox_use_builtin_title_database = new ConfigBool(tr("Use Built-In Database of Game Names"), |
| 172 | Config::MAIN_USE_BUILT_IN_TITLE_DATABASE); |
| 173 | m_checkbox_use_covers = |
| 174 | new ConfigBool(tr("Download Game Covers from GameTDB.com for Use in Grid Mode"), |
| 175 | Config::MAIN_USE_GAME_COVERS); |
| 176 | m_checkbox_show_debugging_ui = new ToolTipCheckBox(tr("Enable Debugging UI")); |
| 177 | m_checkbox_focused_hotkeys = |
| 178 | new ConfigBool(tr("Hotkeys Require Window Focus"), Config::MAIN_FOCUSED_HOTKEYS); |
| 179 | m_checkbox_disable_screensaver = |
| 180 | new ConfigBool(tr("Inhibit Screensaver During Emulation"), Config::MAIN_DISABLE_SCREENSAVER); |
| 181 | m_checkbox_time_tracking = |
| 182 | new ConfigBool(tr("Enable Play Time Tracking"), Config::MAIN_TIME_TRACKING); |
| 183 | |
| 184 | groupbox_layout->addWidget(m_checkbox_use_builtin_title_database); |
| 185 | groupbox_layout->addWidget(m_checkbox_use_covers); |
| 186 | groupbox_layout->addWidget(m_checkbox_show_debugging_ui); |
| 187 | groupbox_layout->addWidget(m_checkbox_focused_hotkeys); |
| 188 | groupbox_layout->addWidget(m_checkbox_disable_screensaver); |
| 189 | groupbox_layout->addWidget(m_checkbox_time_tracking); |
| 190 | } |
| 191 | |
| 192 | void InterfacePane::CreateInGame() |
| 193 | { |
| 194 | auto* groupbox = new QGroupBox(tr("Render Window")); |
| 195 | auto* groupbox_layout = new QVBoxLayout; |
| 196 | groupbox->setLayout(groupbox_layout); |
| 197 | m_main_layout->addWidget(groupbox); |
| 198 | |
| 199 | m_checkbox_top_window = new ConfigBool(tr("Keep Window on Top"), Config::MAIN_KEEP_WINDOW_ON_TOP); |
| 200 | m_checkbox_confirm_on_stop = new ConfigBool(tr("Confirm on Stop"), Config::MAIN_CONFIRM_ON_STOP); |
| 201 | m_checkbox_use_panic_handlers = |
| 202 | new ConfigBool(tr("Use Panic Handlers"), Config::MAIN_USE_PANIC_HANDLERS); |
| 203 | m_checkbox_show_active_title = |
| 204 | new ConfigBool(tr("Show Active Title in Window Title"), Config::MAIN_SHOW_ACTIVE_TITLE); |
| 205 | m_checkbox_pause_on_focus_lost = |
| 206 | new ConfigBool(tr("Pause on Focus Loss"), Config::MAIN_PAUSE_ON_FOCUS_LOST); |
| 207 | |
| 208 | auto* mouse_groupbox = new QGroupBox(tr("Mouse Cursor Visibility")); |
| 209 | auto* m_vboxlayout_hide_mouse = new QVBoxLayout; |
| 210 | mouse_groupbox->setLayout(m_vboxlayout_hide_mouse); |
| 211 | |
| 212 | m_radio_cursor_visible_movement = |
| 213 | new ConfigRadioInt(tr("On Movement"), Config::MAIN_SHOW_CURSOR, |
| 214 | static_cast<int>(Config::ShowCursor::OnMovement)); |
| 215 | m_radio_cursor_visible_never = new ConfigRadioInt(tr("Never"), Config::MAIN_SHOW_CURSOR, |
| 216 | static_cast<int>(Config::ShowCursor::Never)); |
| 217 | m_radio_cursor_visible_always = new ConfigRadioInt( |
| 218 | tr("Always"), Config::MAIN_SHOW_CURSOR, static_cast<int>(Config::ShowCursor::Constantly)); |
| 219 | |
| 220 | m_vboxlayout_hide_mouse->addWidget(m_radio_cursor_visible_movement); |
| 221 | m_vboxlayout_hide_mouse->addWidget(m_radio_cursor_visible_never); |
| 222 | m_vboxlayout_hide_mouse->addWidget(m_radio_cursor_visible_always); |
| 223 | |
| 224 | m_checkbox_lock_mouse = new ConfigBool(tr("Lock Mouse Cursor"), Config::MAIN_LOCK_CURSOR); |
| 225 | // this ends up not being managed unless _WIN32, so lets not leak |
| 226 | m_checkbox_lock_mouse->setParent(this); |
| 227 | |
| 228 | mouse_groupbox->setLayout(m_vboxlayout_hide_mouse); |
| 229 | groupbox_layout->addWidget(m_checkbox_top_window); |
| 230 | groupbox_layout->addWidget(m_checkbox_confirm_on_stop); |
| 231 | groupbox_layout->addWidget(m_checkbox_use_panic_handlers); |
| 232 | groupbox_layout->addWidget(m_checkbox_show_active_title); |
| 233 | groupbox_layout->addWidget(m_checkbox_pause_on_focus_lost); |
| 234 | groupbox_layout->addWidget(mouse_groupbox); |
| 235 | #ifdef _WIN32 |
| 236 | groupbox_layout->addWidget(m_checkbox_lock_mouse); |
| 237 | #else |
| 238 | m_checkbox_lock_mouse->hide(); |
| 239 | #endif |
| 240 | } |
| 241 | |
| 242 | void InterfacePane::ConnectLayout() |
| 243 | { |
| 244 | connect(m_checkbox_use_builtin_title_database, &QCheckBox::toggled, &Settings::Instance(), |
| 245 | &Settings::GameListRefreshRequested); |
| 246 | connect(m_checkbox_use_covers, &QCheckBox::toggled, &Settings::Instance(), |
| 247 | &Settings::MetadataRefreshRequested); |
| 248 | connect(m_checkbox_show_debugging_ui, &QCheckBox::toggled, &Settings::Instance(), |
| 249 | &Settings::SetDebugModeEnabled); |
| 250 | connect(m_combobox_theme, &QComboBox::currentIndexChanged, &Settings::Instance(), |
| 251 | &Settings::ThemeChanged); |
| 252 | connect(m_combobox_userstyle, &QComboBox::currentIndexChanged, this, |
| 253 | &InterfacePane::OnUserStyleChanged); |
| 254 | connect(m_combobox_language, &QComboBox::currentIndexChanged, this, |
| 255 | &InterfacePane::OnLanguageChanged); |
| 256 | connect(m_checkbox_top_window, &QCheckBox::toggled, &Settings::Instance(), |
| 257 | &Settings::KeepWindowOnTopChanged); |
| 258 | connect(m_radio_cursor_visible_movement, &ConfigRadioInt::OnSelected, &Settings::Instance(), |
| 259 | &Settings::CursorVisibilityChanged); |
| 260 | connect(m_radio_cursor_visible_never, &ConfigRadioInt::OnSelected, &Settings::Instance(), |
| 261 | &Settings::CursorVisibilityChanged); |
| 262 | connect(m_radio_cursor_visible_always, &ConfigRadioInt::OnSelected, &Settings::Instance(), |
| 263 | &Settings::CursorVisibilityChanged); |
| 264 | connect(m_checkbox_lock_mouse, &QCheckBox::toggled, &Settings::Instance(), |
| 265 | &Settings::LockCursorChanged); |
| 266 | } |
| 267 | |
| 268 | void InterfacePane::UpdateShowDebuggingCheckbox() |
| 269 | { |
| 270 | SignalBlocking(m_checkbox_show_debugging_ui) |
| 271 | ->setChecked(Settings::Instance().IsDebugModeEnabled()); |
| 272 | |
| 273 | static constexpr char TR_SHOW_DEBUGGING_UI_DESCRIPTION[] = QT_TR_NOOP( |
| 274 | "Shows Dolphin's debugging user interface. This lets you view and modify a game's code and " |
| 275 | "memory contents, set debugging breakpoints, examine network requests, and more." |
| 276 | "<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"); |
| 277 | static constexpr char TR_DISABLED_IN_HARDCORE_DESCRIPTION[] = |
| 278 | QT_TR_NOOP("<dolphin_emphasis>Disabled in Hardcore Mode.</dolphin_emphasis>"); |
| 279 | |
| 280 | bool hardcore = AchievementManager::GetInstance().IsHardcoreModeActive(); |
| 281 | SignalBlocking(m_checkbox_show_debugging_ui)->setEnabled(!hardcore); |
| 282 | if (hardcore) |
| 283 | { |
| 284 | m_checkbox_show_debugging_ui->SetDescription(tr("%1<br><br>%2") |
| 285 | .arg(tr(TR_SHOW_DEBUGGING_UI_DESCRIPTION)) |
| 286 | .arg(tr(TR_DISABLED_IN_HARDCORE_DESCRIPTION))); |
| 287 | } |
| 288 | else |
| 289 | { |
| 290 | m_checkbox_show_debugging_ui->SetDescription(tr(TR_SHOW_DEBUGGING_UI_DESCRIPTION)); |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | void InterfacePane::LoadUserStyle() |
| 295 | { |
| 296 | const Settings::StyleType style_type = Settings::Instance().GetStyleType(); |
| 297 | const QString userstyle = Settings::Instance().GetUserStyleName(); |
| 298 | const int index = style_type == Settings::StyleType::User ? |
| 299 | m_combobox_userstyle->findData(userstyle) : |
| 300 | m_combobox_userstyle->findData(static_cast<int>(style_type)); |
| 301 | |
| 302 | if (index > 0) |
| 303 | SignalBlocking(m_combobox_userstyle)->setCurrentIndex(index); |
| 304 | } |
| 305 | |
| 306 | void InterfacePane::OnUserStyleChanged() |
| 307 | { |
| 308 | const auto selected_style = m_combobox_userstyle->currentData(); |
| 309 | bool is_builtin_type = false; |
| 310 | const int style_type_int = selected_style.toInt(&is_builtin_type); |
| 311 | Settings::Instance().SetStyleType(is_builtin_type ? |
| 312 | static_cast<Settings::StyleType>(style_type_int) : |
| 313 | Settings::StyleType::User); |
| 314 | if (!is_builtin_type) |
| 315 | Settings::Instance().SetUserStyleName(selected_style.toString()); |
| 316 | Settings::Instance().ApplyStyle(); |
| 317 | } |
| 318 | |
| 319 | void InterfacePane::OnLanguageChanged() |
| 320 | { |
| 321 | ModalMessageBox::information( |
| 322 | this, tr("Restart Required"), |
| 323 | tr("You must restart Dolphin in order for the change to take effect.")); |
| 324 | } |
| 325 | |
| 326 | void InterfacePane::OnEmulationStateChanged(Core::State state) |
| 327 | { |
| 328 | const bool uninitialized = state == Core::State::Uninitialized; |
| 329 | m_checkbox_time_tracking->setEnabled(uninitialized); |
| 330 | } |
| 331 | |
| 332 | void InterfacePane::AddDescriptions() |
| 333 | { |
| 334 | static constexpr char TR_TITLE_DATABASE_DESCRIPTION[] = QT_TR_NOOP( |
| 335 | "Uses Dolphin's database of properly formatted names in the game list's Title column." |
| 336 | "<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>"); |
| 337 | static constexpr char TR_THEME_DESCRIPTION[] = |
| 338 | QT_TR_NOOP("Changes the appearance and color of Dolphin's buttons." |
| 339 | "<br><br><dolphin_emphasis>If unsure, select Clean.</dolphin_emphasis>"); |
| 340 | static constexpr char TR_TOP_WINDOW_DESCRIPTION[] = |
| 341 | QT_TR_NOOP("Forces the render window to stay on top of other windows and applications." |
| 342 | "<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"); |
| 343 | static constexpr char TR_LANGUAGE_DESCRIPTION[] = QT_TR_NOOP( |
| 344 | "Sets the language displayed by Dolphin's user interface." |
| 345 | "<br><br>Changes to this setting only take effect once Dolphin is restarted." |
| 346 | "<br><br><dolphin_emphasis>If unsure, select <System Language>.</dolphin_emphasis>"); |
| 347 | static constexpr char TR_FOCUSED_HOTKEYS_DESCRIPTION[] = |
| 348 | QT_TR_NOOP("Requires the render window to be focused for hotkeys to take effect." |
| 349 | "<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>"); |
| 350 | static constexpr char TR_USE_COVERS_DESCRIPTION[] = |
| 351 | QT_TR_NOOP("Downloads full game covers from GameTDB.com to display in the game list's Grid " |
| 352 | "View. If this setting is unchecked, the game list displays a banner from the " |
| 353 | "game's save data, and if the game has no save file, displays a generic " |
| 354 | "banner instead." |
| 355 | "<br><br>List View will always use the save file banners." |
| 356 | "<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>"); |
| 357 | static constexpr char TR_DISABLE_SCREENSAVER_DESCRIPTION[] = |
| 358 | QT_TR_NOOP("Disables your screensaver while running a game." |
| 359 | "<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>"); |
| 360 | static constexpr char TR_TIME_TRACKING[] = QT_TR_NOOP( |
| 361 | "Tracks the time you spend playing games and shows it in the List View (as hours/minutes)." |
| 362 | "<br><br>This setting cannot be changed while emulation is active." |
| 363 | "<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>"); |
| 364 | static constexpr char TR_CONFIRM_ON_STOP_DESCRIPTION[] = |
| 365 | QT_TR_NOOP("Prompts you to confirm that you want to end emulation when you press Stop." |
| 366 | "<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>"); |
| 367 | static constexpr char TR_USE_PANIC_HANDLERS_DESCRIPTION[] = |
| 368 | QT_TR_NOOP("In the event of an error, Dolphin will halt to inform you of the error and " |
| 369 | "present choices on how to proceed. With this option disabled, Dolphin will " |
| 370 | "\"ignore\" all errors. Emulation will not be halted and you will not be notified." |
| 371 | "<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>"); |
| 372 | static constexpr char TR_SHOW_ACTIVE_TITLE_DESCRIPTION[] = |
| 373 | QT_TR_NOOP("Shows the active game title in the render window's title bar." |
| 374 | "<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>"); |
| 375 | static constexpr char TR_PAUSE_ON_FOCUS_LOST_DESCRIPTION[] = |
| 376 | QT_TR_NOOP("Pauses the game whenever the render window isn't focused." |
| 377 | "<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"); |
| 378 | static constexpr char TR_LOCK_MOUSE_DESCRIPTION[] = |
| 379 | QT_TR_NOOP("Locks the mouse cursor to the Render Widget as long as it has focus. You can " |
| 380 | "set a hotkey to unlock it." |
| 381 | "<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>"); |
| 382 | static constexpr char TR_CURSOR_VISIBLE_MOVEMENT_DESCRIPTION[] = |
| 383 | QT_TR_NOOP("Shows the mouse cursor briefly whenever it has recently moved, then hides it." |
| 384 | "<br><br><dolphin_emphasis>If unsure, select this mode.</dolphin_emphasis>"); |
| 385 | static constexpr char TR_CURSOR_VISIBLE_NEVER_DESCRIPTION[] = QT_TR_NOOP( |
| 386 | "Hides the mouse cursor whenever it is inside the render window and the render window is " |
| 387 | "focused." |
| 388 | "<br><br><dolphin_emphasis>If unsure, select "On Movement".</dolphin_emphasis>"); |
| 389 | static constexpr char TR_CURSOR_VISIBLE_ALWAYS_DESCRIPTION[] = QT_TR_NOOP( |
| 390 | "Shows the mouse cursor at all times." |
| 391 | "<br><br><dolphin_emphasis>If unsure, select "On Movement".</dolphin_emphasis>"); |
| 392 | static constexpr char TR_USER_STYLE_DESCRIPTION[] = |
| 393 | QT_TR_NOOP("Sets the style of Dolphin's user interface. Any custom styles that you have " |
| 394 | "added will be presented here, allowing you to switch to them." |
| 395 | "<br><br><dolphin_emphasis>If unsure, select (System).</dolphin_emphasis>"); |
| 396 | |
| 397 | m_checkbox_use_builtin_title_database->SetDescription(tr(TR_TITLE_DATABASE_DESCRIPTION)); |
| 398 | |
| 399 | m_combobox_theme->SetTitle(tr("Theme")); |
| 400 | m_combobox_theme->SetDescription(tr(TR_THEME_DESCRIPTION)); |
| 401 | |
| 402 | m_checkbox_top_window->SetDescription(tr(TR_TOP_WINDOW_DESCRIPTION)); |
| 403 | |
| 404 | m_combobox_language->SetTitle(tr("Language")); |
| 405 | m_combobox_language->SetDescription(tr(TR_LANGUAGE_DESCRIPTION)); |
| 406 | |
| 407 | m_checkbox_focused_hotkeys->SetDescription(tr(TR_FOCUSED_HOTKEYS_DESCRIPTION)); |
| 408 | |
| 409 | m_checkbox_use_covers->SetDescription(tr(TR_USE_COVERS_DESCRIPTION)); |
| 410 | |
| 411 | m_checkbox_disable_screensaver->SetDescription(tr(TR_DISABLE_SCREENSAVER_DESCRIPTION)); |
| 412 | |
| 413 | m_checkbox_time_tracking->SetDescription(tr(TR_TIME_TRACKING)); |
| 414 | |
| 415 | m_checkbox_confirm_on_stop->SetDescription(tr(TR_CONFIRM_ON_STOP_DESCRIPTION)); |
| 416 | |
| 417 | m_checkbox_use_panic_handlers->SetDescription(tr(TR_USE_PANIC_HANDLERS_DESCRIPTION)); |
| 418 | |
| 419 | m_checkbox_show_active_title->SetDescription(tr(TR_SHOW_ACTIVE_TITLE_DESCRIPTION)); |
| 420 | |
| 421 | m_checkbox_pause_on_focus_lost->SetDescription(tr(TR_PAUSE_ON_FOCUS_LOST_DESCRIPTION)); |
| 422 | |
| 423 | m_checkbox_lock_mouse->SetDescription(tr(TR_LOCK_MOUSE_DESCRIPTION)); |
| 424 | |
| 425 | m_radio_cursor_visible_movement->SetDescription(tr(TR_CURSOR_VISIBLE_MOVEMENT_DESCRIPTION)); |
| 426 | |
| 427 | m_radio_cursor_visible_never->SetDescription(tr(TR_CURSOR_VISIBLE_NEVER_DESCRIPTION)); |
| 428 | |
| 429 | m_radio_cursor_visible_always->SetDescription(tr(TR_CURSOR_VISIBLE_ALWAYS_DESCRIPTION)); |
| 430 | |
| 431 | m_combobox_userstyle->SetTitle(tr("Style")); |
| 432 | m_combobox_userstyle->SetDescription(tr(TR_USER_STYLE_DESCRIPTION)); |
| 433 | } |