InterfacePane.cpp 21 KB

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