Merge branch 'master' of https://github.com/dolphin-emu/dolphin into dolphin-emu-master

This commit is contained in:
Nayla Hanegan 2024-08-23 13:38:17 -04:00
commit 7e6752e8fc
516 changed files with 60670 additions and 270317 deletions

View file

@ -100,7 +100,7 @@ void AdvancedPane::CreateLayout()
clock_override_layout->addLayout(cpu_clock_override_slider_layout);
m_cpu_clock_override_slider = new QSlider(Qt::Horizontal);
m_cpu_clock_override_slider->setRange(0, 150);
m_cpu_clock_override_slider->setRange(1, 400);
cpu_clock_override_slider_layout->addWidget(m_cpu_clock_override_slider);
m_cpu_clock_override_slider_label = new QLabel();
@ -203,8 +203,7 @@ void AdvancedPane::ConnectLayout()
});
connect(m_cpu_clock_override_slider, &QSlider::valueChanged, [this](int oc_factor) {
// Vaguely exponential scaling?
const float factor = std::exp2f((m_cpu_clock_override_slider->value() - 100.f) / 25.f);
const float factor = m_cpu_clock_override_slider->value() / 100.f;
Config::SetBaseOrCurrent(Config::MAIN_OVERCLOCK, factor);
Update();
});
@ -271,8 +270,8 @@ void AdvancedPane::Update()
{
const QSignalBlocker blocker(m_cpu_clock_override_slider);
m_cpu_clock_override_slider->setValue(static_cast<int>(
std::round(std::log2f(Config::Get(Config::MAIN_OVERCLOCK)) * 25.f + 100.f)));
m_cpu_clock_override_slider->setValue(
static_cast<int>(std::round(Config::Get(Config::MAIN_OVERCLOCK) * 100.f)));
}
m_cpu_clock_override_slider_label->setText([] {

View file

@ -434,7 +434,7 @@ void GameCubePane::BrowseMemcard(ExpansionInterface::Slot slot)
ASSERT(ExpansionInterface::IsMemcardSlot(slot));
const QString filename = DolphinFileDialog::getSaveFileName(
this, tr("Choose a file to open or create"),
this, tr("Choose a File to Open or Create"),
QString::fromStdString(File::GetUserPath(D_GCUSER_IDX)),
tr("GameCube Memory Cards (*.raw *.gcp)"), nullptr, QFileDialog::DontConfirmOverwrite);
@ -538,8 +538,7 @@ void GameCubePane::BrowseGCIFolder(ExpansionInterface::Slot slot)
ASSERT(ExpansionInterface::IsMemcardSlot(slot));
const QString path = DolphinFileDialog::getExistingDirectory(
this, tr("Choose the GCI base folder"),
QString::fromStdString(File::GetUserPath(D_GCUSER_IDX)));
this, tr("Choose GCI Base Folder"), QString::fromStdString(File::GetUserPath(D_GCUSER_IDX)));
if (!path.isEmpty())
SetGCIFolder(slot, path);
@ -645,7 +644,7 @@ void GameCubePane::BrowseAGPRom(ExpansionInterface::Slot slot)
ASSERT(ExpansionInterface::IsMemcardSlot(slot));
QString filename = DolphinFileDialog::getSaveFileName(
this, tr("Choose a file to open"), QString::fromStdString(File::GetUserPath(D_GCUSER_IDX)),
this, tr("Choose a File to Open"), QString::fromStdString(File::GetUserPath(D_GCUSER_IDX)),
tr("Game Boy Advance Carts (*.gba)"), nullptr, QFileDialog::DontConfirmOverwrite);
if (!filename.isEmpty())

View file

@ -24,8 +24,11 @@
#include "Core/PowerPC/PowerPC.h"
#include "Core/System.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipPushButton.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
#include "DolphinQt/QtUtils/SignalBlocking.h"
#include "DolphinQt/Settings.h"
@ -52,6 +55,7 @@ GeneralPane::GeneralPane(QWidget* parent) : QWidget(parent)
{
CreateLayout();
LoadConfig();
AddDescriptions();
ConnectLayout();
@ -81,14 +85,10 @@ void GeneralPane::CreateLayout()
void GeneralPane::OnEmulationStateChanged(Core::State state)
{
const bool running = state != Core::State::Uninitialized;
const bool hardcore = AchievementManager::GetInstance().IsHardcoreModeActive();
m_checkbox_dualcore->setEnabled(!running);
#ifdef USE_RETRO_ACHIEVEMENTS
bool hardcore = AchievementManager::GetInstance().IsHardcoreModeActive();
m_checkbox_cheats->setEnabled(!running && !hardcore);
#else // USE_RETRO_ACHIEVEMENTS
m_checkbox_cheats->setEnabled(!running);
#endif // USE_RETRO_ACHIEVEMENTS
m_checkbox_override_region_settings->setEnabled(!running);
#ifdef USE_DISCORD_PRESENCE
m_checkbox_discord_presence->setEnabled(!running);
@ -134,17 +134,18 @@ void GeneralPane::CreateBasic()
basic_group->setLayout(basic_group_layout);
m_main_layout->addWidget(basic_group);
m_checkbox_dualcore = new QCheckBox(tr("Enable Dual Core (speedup)"));
m_checkbox_dualcore = new ConfigBool(tr("Enable Dual Core (speedhack)"), Config::MAIN_CPU_THREAD);
basic_group_layout->addWidget(m_checkbox_dualcore);
m_checkbox_override_region_settings = new QCheckBox(tr("Allow Mismatched Region Settings"));
basic_group_layout->addWidget(m_checkbox_override_region_settings);
m_checkbox_auto_disc_change = new QCheckBox(tr("Change Discs Automatically"));
m_checkbox_auto_disc_change =
new ConfigBool(tr("Change Discs Automatically"), Config::MAIN_AUTO_DISC_CHANGE);
basic_group_layout->addWidget(m_checkbox_auto_disc_change);
#ifdef USE_DISCORD_PRESENCE
m_checkbox_discord_presence = new QCheckBox(tr("Show Current Game on Discord"));
m_checkbox_discord_presence = new ToolTipCheckBox(tr("Show Current Game on Discord"));
basic_group_layout->addWidget(m_checkbox_discord_presence);
#endif
@ -153,7 +154,7 @@ void GeneralPane::CreateBasic()
speed_limit_layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
basic_group_layout->addLayout(speed_limit_layout);
m_combobox_speedlimit = new QComboBox();
m_combobox_speedlimit = new ToolTipComboBox();
m_combobox_speedlimit->addItem(tr("Unlimited"));
for (int i = 10; i <= 200; i += 10) // from 10% to 200%
@ -182,17 +183,11 @@ void GeneralPane::CreateFallbackRegion()
fallback_region_dropdown_layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
fallback_region_group_layout->addLayout(fallback_region_dropdown_layout);
m_combobox_fallback_region = new QComboBox(this);
m_combobox_fallback_region = new ToolTipComboBox();
fallback_region_dropdown_layout->addRow(tr("Fallback Region:"), m_combobox_fallback_region);
for (const QString& option : {tr("NTSC-J"), tr("NTSC-U"), tr("PAL"), tr("NTSC-K")})
m_combobox_fallback_region->addItem(option);
auto* fallback_region_description =
new QLabel(tr("Dolphin will use this for titles whose region cannot be determined "
"automatically."));
fallback_region_description->setWordWrap(true);
fallback_region_group_layout->addWidget(fallback_region_description);
}
#if defined(USE_ANALYTICS) && USE_ANALYTICS
@ -203,9 +198,8 @@ void GeneralPane::CreateAnalytics()
analytics_group->setLayout(analytics_group_layout);
m_main_layout->addWidget(analytics_group);
m_checkbox_enable_analytics = new QCheckBox(tr("Enable Usage Statistics Reporting"));
m_button_generate_new_identity =
new NonDefaultQPushButton(tr("Generate a New Statistics Identity"));
m_checkbox_enable_analytics = new ToolTipCheckBox(tr("Enable Usage Statistics Reporting"));
m_button_generate_new_identity = new ToolTipPushButton(tr("Generate a New Statistics Identity"));
analytics_group_layout->addWidget(m_checkbox_enable_analytics);
analytics_group_layout->addWidget(m_button_generate_new_identity);
}
@ -340,12 +334,6 @@ void GeneralPane::OnSaveConfig()
Settings::Instance().SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked());
DolphinAnalytics::Instance().ReloadConfig();
#endif
Config::SetBaseOrCurrent(Config::MAIN_CPU_THREAD, m_checkbox_dualcore->isChecked());
Settings::Instance().SetCheatsEnabled(m_checkbox_cheats->isChecked());
Config::SetBaseOrCurrent(Config::MAIN_OVERRIDE_REGION_SETTINGS,
m_checkbox_override_region_settings->isChecked());
Config::SetBase(Config::MAIN_AUTO_DISC_CHANGE, m_checkbox_auto_disc_change->isChecked());
Config::SetBaseOrCurrent(Config::MAIN_ENABLE_CHEATS, m_checkbox_cheats->isChecked());
Settings::Instance().SetFallbackRegion(
UpdateFallbackRegionFromIndex(m_combobox_fallback_region->currentIndex()));
@ -371,4 +359,107 @@ void GeneralPane::OnCodeHandlerChanged(int index)
int code_handler_value = m_combobox_codehandler->itemData(index).toInt();
Config::SetBaseOrCurrent(Config::MAIN_CODE_HANDLER, code_handler_value);
Config::Save();
void GeneralPane::AddDescriptions()
{
static constexpr char TR_DUALCORE_DESCRIPTION[] =
QT_TR_NOOP("Separates CPU and GPU emulation work to separate threads. Reduces single-thread "
"burden by spreading Dolphin's heaviest load across two cores, which usually "
"improves performance. However, it can result in glitches and crashes."
"<br><br>This setting cannot be changed while emulation is active."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
static constexpr char TR_CHEATS_DESCRIPTION[] = QT_TR_NOOP(
"Enables the use of AR and Gecko cheat codes which can be used to modify games' behavior. "
"These codes can be configured with the Cheats Manager in the Tools menu."
"<br><br>This setting cannot be changed while emulation is active."
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
static constexpr char TR_OVERRIDE_REGION_SETTINGS_DESCRIPTION[] =
QT_TR_NOOP("Lets you use languages and other region-related settings that the game may not "
"be designed for. May cause various crashes and bugs."
"<br><br>This setting cannot be changed while emulation is active."
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
static constexpr char TR_AUTO_DISC_CHANGE_DESCRIPTION[] = QT_TR_NOOP(
"Automatically changes the game disc when requested by games with two discs. This feature "
"requires the game to be launched in one of the following ways:"
"<br>- From the game list, with both discs being present in the game list."
"<br>- With File > Open or the command line interface, with the paths to both discs being "
"provided."
"<br>- By launching an M3U file with File > Open or the command line interface."
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
#ifdef USE_DISCORD_PRESENCE
static constexpr char TR_DISCORD_PRESENCE_DESCRIPTION[] =
QT_TR_NOOP("Shows which game is active and the duration of your current play session in your "
"Discord status."
"<br><br>This setting cannot be changed while emulation is active."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
#endif
static constexpr char TR_SPEEDLIMIT_DESCRIPTION[] =
QT_TR_NOOP("Controls how fast emulation runs relative to the original hardware."
"<br><br>Values higher than 100% will emulate faster than the original hardware "
"can run, if your hardware is able to keep up. Values lower than 100% will slow "
"emulation instead. Unlimited will emulate as fast as your hardware is able to."
"<br><br><dolphin_emphasis>If unsure, select 100%.</dolphin_emphasis>");
static constexpr char TR_UPDATE_TRACK_DESCRIPTION[] = QT_TR_NOOP(
"Selects which update track Dolphin uses when checking for updates at startup. If a new "
"update is available, Dolphin will show a list of changes made since your current version "
"and ask you if you want to update."
"<br><br>The Dev track has the latest version of Dolphin which often updates multiple times "
"per day. Select this track if you want the newest features and fixes."
"<br><br>The Releases track has an update every few months. Some reasons you might prefer to "
"use this track:"
"<br>- You prefer using versions that have had additional testing."
"<br>- NetPlay requires players to have the same Dolphin version, and the latest Release "
"version will have the most players to match with."
"<br>- You frequently use Dolphin's savestate system, which doesn't guarantee backward "
"compatibility of savestates between Dolphin versions. If this applies to you, make sure you "
"make an in-game save before updating (i.e. save your game in the same way you would on a "
"physical GameCube or Wii), then load the in-game save after updating Dolphin and before "
"making any new savestates."
"<br><br>Selecting \"Don't Update\" will prevent Dolphin from automatically checking for "
"updates."
"<br><br><dolphin_emphasis>If unsure, select Releases.</dolphin_emphasis>");
static constexpr char TR_FALLBACK_REGION_DESCRIPTION[] =
QT_TR_NOOP("Sets the region used for titles whose region cannot be determined automatically."
"<br><br>This setting cannot be changed while emulation is active.");
#if defined(USE_ANALYTICS) && USE_ANALYTICS
static constexpr char TR_ENABLE_ANALYTICS_DESCRIPTION[] = QT_TR_NOOP(
"If selected, Dolphin can collect data on its performance, feature usage, emulated games, "
"and configuration, as well as data on your system's hardware and operating system."
"<br><br>No private data is ever collected. This data helps us understand how people and "
"emulated games use Dolphin and prioritize our efforts. It also helps us identify rare "
"configurations that are causing bugs, performance and stability issues.");
static constexpr char TR_GENERATE_NEW_IDENTITY_DESCRIPTION[] =
QT_TR_NOOP("Generate a new anonymous ID for your usage statistics. This will cause any "
"future statistics to be unassociated with your previous statistics.");
#endif
m_checkbox_dualcore->SetDescription(tr(TR_DUALCORE_DESCRIPTION));
m_checkbox_cheats->SetDescription(tr(TR_CHEATS_DESCRIPTION));
m_checkbox_override_region_settings->SetDescription(tr(TR_OVERRIDE_REGION_SETTINGS_DESCRIPTION));
m_checkbox_auto_disc_change->SetDescription(tr(TR_AUTO_DISC_CHANGE_DESCRIPTION));
#ifdef USE_DISCORD_PRESENCE
m_checkbox_discord_presence->SetDescription(tr(TR_DISCORD_PRESENCE_DESCRIPTION));
#endif
m_combobox_speedlimit->SetTitle(tr("Speed Limit"));
m_combobox_speedlimit->SetDescription(tr(TR_SPEEDLIMIT_DESCRIPTION));
if (AutoUpdateChecker::SystemSupportsAutoUpdates())
{
m_combobox_update_track->SetTitle(tr("Auto Update"));
m_combobox_update_track->SetDescription(tr(TR_UPDATE_TRACK_DESCRIPTION));
}
m_combobox_fallback_region->SetTitle(tr("Fallback Region"));
m_combobox_fallback_region->SetDescription(tr(TR_FALLBACK_REGION_DESCRIPTION));
#if defined(USE_ANALYTICS) && USE_ANALYTICS
m_checkbox_enable_analytics->SetDescription(tr(TR_ENABLE_ANALYTICS_DESCRIPTION));
m_button_generate_new_identity->SetTitle(tr("Generate a New Statistics Identity"));
m_button_generate_new_identity->SetDescription(tr(TR_GENERATE_NEW_IDENTITY_DESCRIPTION));
#endif
}

View file

@ -5,6 +5,7 @@
#include <QWidget>
class ConfigBool;
class QCheckBox;
class QComboBox;
class QLabel;
@ -12,6 +13,9 @@ class QPushButton;
class QRadioButton;
class QSlider;
class QVBoxLayout;
class ToolTipCheckBox;
class ToolTipComboBox;
class ToolTipPushButton;
namespace Core
{
@ -30,6 +34,8 @@ private:
void CreateBasic();
//void CreateAutoUpdate();
void CreateFallbackRegion();
void AddDescriptions();
void LoadConfig();
void OnSaveConfig();
void OnEmulationStateChanged(Core::State state);
@ -38,25 +44,23 @@ private:
// Widgets
QVBoxLayout* m_main_layout;
QComboBox* m_combobox_speedlimit;
QComboBox* m_combobox_update_track;
QComboBox* m_combobox_fallback_region;
QCheckBox* m_checkbox_dualcore;
QCheckBox* m_checkbox_cheats;
QCheckBox* m_checkbox_override_region_settings;
QCheckBox* m_checkbox_auto_disc_change;
QComboBox* m_combobox_codehandler;
ToolTipComboBox* m_combobox_speedlimit;
ToolTipComboBox* m_combobox_update_track;
ToolTipComboBox* m_combobox_fallback_region;
ConfigBool* m_checkbox_dualcore;
ConfigBool* m_checkbox_cheats;
ConfigBool* m_checkbox_override_region_settings;
ConfigBool* m_checkbox_auto_disc_change;
#ifdef USE_DISCORD_PRESENCE
QCheckBox* m_checkbox_discord_presence;
ToolTipCheckBox* m_checkbox_discord_presence;
#endif
QLabel* m_label_speedlimit;
// Analytics related
#if defined(USE_ANALYTICS) && USE_ANALYTICS
void CreateAnalytics();
void GenerateNewIdentity();
QPushButton* m_button_generate_new_identity;
QCheckBox* m_checkbox_enable_analytics;
ToolTipPushButton* m_button_generate_new_identity;
ToolTipCheckBox* m_checkbox_enable_analytics;
#endif
};

View file

@ -24,55 +24,60 @@
#include "Core/Config/MainSettings.h"
#include "Core/Config/UISettings.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
#include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/QtUtils/SignalBlocking.h"
#include "DolphinQt/Settings.h"
#include "UICommon/GameFile.h"
static QComboBox* MakeLanguageComboBox()
static ConfigStringChoice* MakeLanguageComboBox()
{
static const struct
{
const QString name;
const char* id;
} languages[] = {
{QStringLiteral(u"Bahasa Melayu"), "ms"}, // Malay
{QStringLiteral(u"Catal\u00E0"), "ca"}, // Catalan
{QStringLiteral(u"\u010Ce\u0161tina"), "cs"}, // Czech
{QStringLiteral(u"Dansk"), "da"}, // Danish
{QStringLiteral(u"Deutsch"), "de"}, // German
{QStringLiteral(u"English"), "en"}, // English
{QStringLiteral(u"Espa\u00F1ol"), "es"}, // Spanish
{QStringLiteral(u"Fran\u00E7ais"), "fr"}, // French
{QStringLiteral(u"Hrvatski"), "hr"}, // Croatian
{QStringLiteral(u"Italiano"), "it"}, // Italian
{QStringLiteral(u"Magyar"), "hu"}, // Hungarian
{QStringLiteral(u"Nederlands"), "nl"}, // Dutch
{QStringLiteral(u"Norsk bokm\u00E5l"), "nb"}, // Norwegian
{QStringLiteral(u"Polski"), "pl"}, // Polish
{QStringLiteral(u"Portugu\u00EAs"), "pt"}, // Portuguese
{QStringLiteral(u"Portugu\u00EAs (Brasil)"), "pt_BR"}, // Portuguese (Brazil)
{QStringLiteral(u"Rom\u00E2n\u0103"), "ro"}, // Romanian
{QStringLiteral(u"Srpski"), "sr"}, // Serbian
{QStringLiteral(u"Suomi"), "fi"}, // Finnish
{QStringLiteral(u"Svenska"), "sv"}, // Swedish
{QStringLiteral(u"T\u00FCrk\u00E7e"), "tr"}, // Turkish
{QStringLiteral(u"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"), "el"}, // Greek
{QStringLiteral(u"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"), "ru"}, // Russian
{QStringLiteral(u"\u0627\u0644\u0639\u0631\u0628\u064A\u0629"), "ar"}, // Arabic
{QStringLiteral(u"\u0641\u0627\u0631\u0633\u06CC"), "fa"}, // Farsi
{QStringLiteral(u"\uD55C\uAD6D\uC5B4"), "ko"}, // Korean
{QStringLiteral(u"\u65E5\u672C\u8A9E"), "ja"}, // Japanese
{QStringLiteral(u"\u7B80\u4F53\u4E2D\u6587"), "zh_CN"}, // Simplified Chinese
{QStringLiteral(u"\u7E41\u9AD4\u4E2D\u6587"), "zh_TW"}, // Traditional Chinese
using QPair = std::pair<QString, QString>;
std::vector<QPair> languages = {
QPair{QObject::tr("<System Language>"), QString{}},
QPair{QStringLiteral(u"Bahasa Melayu"), QStringLiteral("ms")}, // Malay
QPair{QStringLiteral(u"Catal\u00E0"), QStringLiteral("ca")}, // Catalan
QPair{QStringLiteral(u"\u010Ce\u0161tina"), QStringLiteral("cs")}, // Czech
QPair{QStringLiteral(u"Dansk"), QStringLiteral("da")}, // Danish
QPair{QStringLiteral(u"Deutsch"), QStringLiteral("de")}, // German
QPair{QStringLiteral(u"English"), QStringLiteral("en")}, // English
QPair{QStringLiteral(u"Espa\u00F1ol"), QStringLiteral("es")}, // Spanish
QPair{QStringLiteral(u"Fran\u00E7ais"), QStringLiteral("fr")}, // French
QPair{QStringLiteral(u"Hrvatski"), QStringLiteral("hr")}, // Croatian
QPair{QStringLiteral(u"Italiano"), QStringLiteral("it")}, // Italian
QPair{QStringLiteral(u"Magyar"), QStringLiteral("hu")}, // Hungarian
QPair{QStringLiteral(u"Nederlands"), QStringLiteral("nl")}, // Dutch
QPair{QStringLiteral(u"Norsk bokm\u00E5l"), QStringLiteral("nb")}, // Norwegian
QPair{QStringLiteral(u"Polski"), QStringLiteral("pl")}, // Polish
QPair{QStringLiteral(u"Portugu\u00EAs"), QStringLiteral("pt")}, // Portuguese
QPair{QStringLiteral(u"Portugu\u00EAs (Brasil)"),
QStringLiteral("pt_BR")}, // Portuguese (Brazil)
QPair{QStringLiteral(u"Rom\u00E2n\u0103"), QStringLiteral("ro")}, // Romanian
QPair{QStringLiteral(u"Srpski"), QStringLiteral("sr")}, // Serbian
QPair{QStringLiteral(u"Suomi"), QStringLiteral("fi")}, // Finnish
QPair{QStringLiteral(u"Svenska"), QStringLiteral("sv")}, // Swedish
QPair{QStringLiteral(u"T\u00FCrk\u00E7e"), QStringLiteral("tr")}, // Turkish
QPair{QStringLiteral(u"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"),
QStringLiteral("el")}, // Greek
QPair{QStringLiteral(u"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"),
QStringLiteral("ru")}, // Russian
QPair{QStringLiteral(u"\u0627\u0644\u0639\u0631\u0628\u064A\u0629"),
QStringLiteral("ar")}, // Arabic
QPair{QStringLiteral(u"\u0641\u0627\u0631\u0633\u06CC"), QStringLiteral("fa")}, // Farsi
QPair{QStringLiteral(u"\uD55C\uAD6D\uC5B4"), QStringLiteral("ko")}, // Korean
QPair{QStringLiteral(u"\u65E5\u672C\u8A9E"), QStringLiteral("ja")}, // Japanese
QPair{QStringLiteral(u"\u7B80\u4F53\u4E2D\u6587"),
QStringLiteral("zh_CN")}, // Simplified Chinese
QPair{QStringLiteral(u"\u7E41\u9AD4\u4E2D\u6587"),
QStringLiteral("zh_TW")}, // Traditional Chinese
};
auto* combobox = new QComboBox();
combobox->addItem(QObject::tr("<System Language>"), QString{});
for (const auto& lang : languages)
combobox->addItem(lang.name, QString::fromLatin1(lang.id));
auto* const combobox = new ConfigStringChoice(languages, Config::MAIN_INTERFACE_LANGUAGE);
// The default, QComboBox::AdjustToContentsOnFirstShow, causes a noticeable pause when opening the
// SettingWindow for the first time. The culprit seems to be non-Latin graphemes in the above
@ -85,11 +90,12 @@ static QComboBox* MakeLanguageComboBox()
InterfacePane::InterfacePane(QWidget* parent) : QWidget(parent)
{
CreateLayout();
LoadConfig();
UpdateShowDebuggingCheckbox();
LoadUserStyle();
ConnectLayout();
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
&InterfacePane::LoadConfig);
&InterfacePane::UpdateShowDebuggingCheckbox);
}
void InterfacePane::CreateLayout()
@ -98,6 +104,7 @@ void InterfacePane::CreateLayout()
// Create layout here
CreateUI();
CreateInGame();
AddDescriptions();
m_main_layout->addStretch(1);
setLayout(m_main_layout);
@ -119,20 +126,20 @@ void InterfacePane::CreateUI()
m_combobox_language = MakeLanguageComboBox();
combobox_layout->addRow(tr("&Language:"), m_combobox_language);
// List avalable themes
auto theme_paths =
Common::DoFileSearch({File::GetUserPath(D_THEMES_IDX), File::GetSysDirectory() + THEMES_DIR});
std::vector<std::string> theme_names;
theme_names.reserve(theme_paths.size());
std::transform(theme_paths.cbegin(), theme_paths.cend(), std::back_inserter(theme_names),
PathToFileName);
// Theme Combobox
m_combobox_theme = new QComboBox;
m_combobox_theme = new ConfigStringChoice(theme_names, Config::MAIN_THEME_NAME);
combobox_layout->addRow(tr("&Theme:"), m_combobox_theme);
// List avalable themes
auto theme_search_results =
Common::DoFileSearch({File::GetUserPath(D_THEMES_IDX), File::GetSysDirectory() + THEMES_DIR});
for (const std::string& path : theme_search_results)
{
const QString qt_name = QString::fromStdString(PathToFileName(path));
m_combobox_theme->addItem(qt_name);
}
// User Style Combobox
m_combobox_userstyle = new QComboBox;
m_combobox_userstyle = new ToolTipComboBox;
m_label_userstyle = new QLabel(tr("Style:"));
combobox_layout->addRow(m_label_userstyle, m_combobox_userstyle);
auto userstyle_search_results = Common::DoFileSearch({File::GetUserPath(D_STYLES_IDX)});
@ -154,12 +161,16 @@ void InterfacePane::CreateUI()
}
// Checkboxes
m_checkbox_use_builtin_title_database = new QCheckBox(tr("Use Built-In Database of Game Names"));
m_checkbox_use_builtin_title_database = new ConfigBool(tr("Use Built-In Database of Game Names"),
Config::MAIN_USE_BUILT_IN_TITLE_DATABASE);
m_checkbox_use_covers =
new QCheckBox(tr("Download Game Covers from GameTDB.com for Use in Grid Mode"));
new ConfigBool(tr("Download Game Covers from GameTDB.com for Use in Grid Mode"),
Config::MAIN_USE_GAME_COVERS);
m_checkbox_show_debugging_ui = new ToolTipCheckBox(tr("Enable Debugging UI"));
m_checkbox_focused_hotkeys = new QCheckBox(tr("Hotkeys Require Window Focus"));
m_checkbox_disable_screensaver = new QCheckBox(tr("Inhibit Screensaver During Emulation"));
m_checkbox_focused_hotkeys =
new ConfigBool(tr("Hotkeys Require Window Focus"), Config::MAIN_FOCUSED_HOTKEYS);
m_checkbox_disable_screensaver =
new ConfigBool(tr("Inhibit Screensaver During Emulation"), Config::MAIN_DISABLE_SCREENSAVER);
groupbox_layout->addWidget(m_checkbox_use_builtin_title_database);
groupbox_layout->addWidget(m_checkbox_use_covers);
@ -175,34 +186,36 @@ void InterfacePane::CreateInGame()
groupbox->setLayout(groupbox_layout);
m_main_layout->addWidget(groupbox);
m_checkbox_top_window = new QCheckBox(tr("Keep Window on Top"));
m_checkbox_confirm_on_stop = new QCheckBox(tr("Confirm on Stop"));
m_checkbox_use_panic_handlers = new QCheckBox(tr("Use Panic Handlers"));
m_checkbox_enable_osd = new QCheckBox(tr("Show On-Screen Display Messages"));
m_checkbox_show_active_title = new QCheckBox(tr("Show Active Title in Window Title"));
m_checkbox_pause_on_focus_lost = new QCheckBox(tr("Pause on Focus Loss"));
m_checkbox_top_window = new ConfigBool(tr("Keep Window on Top"), Config::MAIN_KEEP_WINDOW_ON_TOP);
m_checkbox_confirm_on_stop = new ConfigBool(tr("Confirm on Stop"), Config::MAIN_CONFIRM_ON_STOP);
m_checkbox_use_panic_handlers =
new ConfigBool(tr("Use Panic Handlers"), Config::MAIN_USE_PANIC_HANDLERS);
m_checkbox_enable_osd =
new ConfigBool(tr("Show On-Screen Display Messages"), Config::MAIN_OSD_MESSAGES);
m_checkbox_show_active_title =
new ConfigBool(tr("Show Active Title in Window Title"), Config::MAIN_SHOW_ACTIVE_TITLE);
m_checkbox_pause_on_focus_lost =
new ConfigBool(tr("Pause on Focus Loss"), Config::MAIN_PAUSE_ON_FOCUS_LOST);
auto* mouse_groupbox = new QGroupBox(tr("Mouse Cursor Visibility"));
auto* m_vboxlayout_hide_mouse = new QVBoxLayout;
mouse_groupbox->setLayout(m_vboxlayout_hide_mouse);
m_radio_cursor_visible_movement = new QRadioButton(tr("On Movement"));
m_radio_cursor_visible_movement->setToolTip(
tr("Mouse Cursor hides after inactivity and returns upon Mouse Cursor movement."));
m_radio_cursor_visible_never = new QRadioButton(tr("Never"));
m_radio_cursor_visible_never->setToolTip(
tr("Mouse Cursor will never be visible while a game is running."));
m_radio_cursor_visible_always = new QRadioButton(tr("Always"));
m_radio_cursor_visible_always->setToolTip(tr("Mouse Cursor will always be visible."));
m_radio_cursor_visible_movement =
new ConfigRadioInt(tr("On Movement"), Config::MAIN_SHOW_CURSOR,
static_cast<int>(Config::ShowCursor::OnMovement));
m_radio_cursor_visible_never = new ConfigRadioInt(tr("Never"), Config::MAIN_SHOW_CURSOR,
static_cast<int>(Config::ShowCursor::Never));
m_radio_cursor_visible_always = new ConfigRadioInt(
tr("Always"), Config::MAIN_SHOW_CURSOR, static_cast<int>(Config::ShowCursor::Constantly));
m_vboxlayout_hide_mouse->addWidget(m_radio_cursor_visible_movement);
m_vboxlayout_hide_mouse->addWidget(m_radio_cursor_visible_never);
m_vboxlayout_hide_mouse->addWidget(m_radio_cursor_visible_always);
m_checkbox_lock_mouse = new ConfigBool(tr("Lock Mouse Cursor"), Config::MAIN_LOCK_CURSOR);
// this ends up not being managed unless _WIN32, so lets not leak
m_checkbox_lock_mouse = new QCheckBox(tr("Lock Mouse Cursor"), this);
m_checkbox_lock_mouse->setToolTip(tr("Will lock the Mouse Cursor to the Render Widget as long as "
"it has focus. You can set a hotkey to unlock it."));
m_checkbox_lock_mouse->setParent(this);
mouse_groupbox->setLayout(m_vboxlayout_hide_mouse);
groupbox_layout->addWidget(m_checkbox_top_window);
@ -221,62 +234,58 @@ void InterfacePane::CreateInGame()
void InterfacePane::ConnectLayout()
{
connect(m_checkbox_use_builtin_title_database, &QCheckBox::toggled, this,
&InterfacePane::OnSaveConfig);
connect(m_checkbox_use_covers, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_disable_screensaver, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_show_debugging_ui, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_focused_hotkeys, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_combobox_theme, &QComboBox::currentIndexChanged, this, [this](int index) {
Settings::Instance().SetThemeName(m_combobox_theme->itemText(index));
});
connect(m_checkbox_use_builtin_title_database, &QCheckBox::toggled, &Settings::Instance(),
&Settings::GameListRefreshRequested);
connect(m_checkbox_use_covers, &QCheckBox::toggled, &Settings::Instance(),
&Settings::MetadataRefreshRequested);
connect(m_checkbox_show_debugging_ui, &QCheckBox::toggled, &Settings::Instance(),
&Settings::SetDebugModeEnabled);
connect(m_combobox_theme, &QComboBox::currentIndexChanged, &Settings::Instance(),
&Settings::ThemeChanged);
connect(m_combobox_userstyle, &QComboBox::currentIndexChanged, this,
&InterfacePane::OnSaveConfig);
connect(m_combobox_language, &QComboBox::currentIndexChanged, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_top_window, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_confirm_on_stop, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_use_panic_handlers, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_show_active_title, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_enable_osd, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_pause_on_focus_lost, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_radio_cursor_visible_movement, &QRadioButton::toggled, this,
&InterfacePane::OnCursorVisibleMovement);
connect(m_radio_cursor_visible_never, &QRadioButton::toggled, this,
&InterfacePane::OnCursorVisibleNever);
connect(m_radio_cursor_visible_always, &QRadioButton::toggled, this,
&InterfacePane::OnCursorVisibleAlways);
&InterfacePane::OnUserStyleChanged);
connect(m_combobox_language, &QComboBox::currentIndexChanged, this,
&InterfacePane::OnLanguageChanged);
connect(m_checkbox_top_window, &QCheckBox::toggled, &Settings::Instance(),
&Settings::KeepWindowOnTopChanged);
connect(m_radio_cursor_visible_movement, &ConfigRadioInt::OnSelected, &Settings::Instance(),
&Settings::CursorVisibilityChanged);
connect(m_radio_cursor_visible_never, &ConfigRadioInt::OnSelected, &Settings::Instance(),
&Settings::CursorVisibilityChanged);
connect(m_radio_cursor_visible_always, &ConfigRadioInt::OnSelected, &Settings::Instance(),
&Settings::CursorVisibilityChanged);
connect(m_checkbox_lock_mouse, &QCheckBox::toggled, &Settings::Instance(),
&Settings::SetLockCursor);
&Settings::LockCursorChanged);
}
void InterfacePane::LoadConfig()
void InterfacePane::UpdateShowDebuggingCheckbox()
{
SignalBlocking(m_checkbox_use_builtin_title_database)
->setChecked(Config::Get(Config::MAIN_USE_BUILT_IN_TITLE_DATABASE));
SignalBlocking(m_checkbox_show_debugging_ui)
->setChecked(Settings::Instance().IsDebugModeEnabled());
#ifdef USE_RETRO_ACHIEVEMENTS
static constexpr char TR_SHOW_DEBUGGING_UI_DESCRIPTION[] = QT_TR_NOOP(
"Shows Dolphin's debugging user interface. This lets you view and modify a game's code and "
"memory contents, set debugging breakpoints, examine network requests, and more."
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
static constexpr char TR_DISABLED_IN_HARDCORE_DESCRIPTION[] =
QT_TR_NOOP("<dolphin_emphasis>Disabled in Hardcore Mode.</dolphin_emphasis>");
bool hardcore = AchievementManager::GetInstance().IsHardcoreModeActive();
SignalBlocking(m_checkbox_show_debugging_ui)->setEnabled(!hardcore);
if (hardcore)
{
m_checkbox_show_debugging_ui->SetDescription(
tr("<dolphin_emphasis>Disabled in Hardcore Mode.</dolphin_emphasis>"));
m_checkbox_show_debugging_ui->SetDescription(tr("%1<br><br>%2")
.arg(tr(TR_SHOW_DEBUGGING_UI_DESCRIPTION))
.arg(tr(TR_DISABLED_IN_HARDCORE_DESCRIPTION)));
}
else
{
m_checkbox_show_debugging_ui->SetDescription({});
m_checkbox_show_debugging_ui->SetDescription(tr(TR_SHOW_DEBUGGING_UI_DESCRIPTION));
}
#endif // USE_RETRO_ACHIEVEMENTS
SignalBlocking(m_combobox_language)
->setCurrentIndex(m_combobox_language->findData(
QString::fromStdString(Config::Get(Config::MAIN_INTERFACE_LANGUAGE))));
SignalBlocking(m_combobox_theme)
->setCurrentIndex(
m_combobox_theme->findText(QString::fromStdString(Config::Get(Config::MAIN_THEME_NAME))));
}
void InterfacePane::LoadUserStyle()
{
const Settings::StyleType style_type = Settings::Instance().GetStyleType();
const QString userstyle = Settings::Instance().GetUserStyleName();
const int index = style_type == Settings::StyleType::User ?
@ -285,37 +294,10 @@ void InterfacePane::LoadConfig()
if (index > 0)
SignalBlocking(m_combobox_userstyle)->setCurrentIndex(index);
// Render Window Options
SignalBlocking(m_checkbox_top_window)
->setChecked(Settings::Instance().IsKeepWindowOnTopEnabled());
SignalBlocking(m_checkbox_confirm_on_stop)->setChecked(Config::Get(Config::MAIN_CONFIRM_ON_STOP));
SignalBlocking(m_checkbox_use_panic_handlers)
->setChecked(Config::Get(Config::MAIN_USE_PANIC_HANDLERS));
SignalBlocking(m_checkbox_enable_osd)->setChecked(Config::Get(Config::MAIN_OSD_MESSAGES));
SignalBlocking(m_checkbox_show_active_title)
->setChecked(Config::Get(Config::MAIN_SHOW_ACTIVE_TITLE));
SignalBlocking(m_checkbox_pause_on_focus_lost)
->setChecked(Config::Get(Config::MAIN_PAUSE_ON_FOCUS_LOST));
SignalBlocking(m_checkbox_use_covers)->setChecked(Config::Get(Config::MAIN_USE_GAME_COVERS));
SignalBlocking(m_checkbox_focused_hotkeys)->setChecked(Config::Get(Config::MAIN_FOCUSED_HOTKEYS));
SignalBlocking(m_radio_cursor_visible_movement)
->setChecked(Settings::Instance().GetCursorVisibility() == Config::ShowCursor::OnMovement);
SignalBlocking(m_radio_cursor_visible_always)
->setChecked(Settings::Instance().GetCursorVisibility() == Config::ShowCursor::Constantly);
SignalBlocking(m_radio_cursor_visible_never)
->setChecked(Settings::Instance().GetCursorVisibility() == Config::ShowCursor::Never);
SignalBlocking(m_checkbox_lock_mouse)->setChecked(Settings::Instance().GetLockCursor());
SignalBlocking(m_checkbox_disable_screensaver)
->setChecked(Config::Get(Config::MAIN_DISABLE_SCREENSAVER));
}
void InterfacePane::OnSaveConfig()
void InterfacePane::OnUserStyleChanged()
{
Config::SetBase(Config::MAIN_USE_BUILT_IN_TITLE_DATABASE,
m_checkbox_use_builtin_title_database->isChecked());
Settings::Instance().SetDebugModeEnabled(m_checkbox_show_debugging_ui->isChecked());
const auto selected_style = m_combobox_userstyle->currentData();
bool is_builtin_type = false;
const int style_type_int = selected_style.toInt(&is_builtin_type);
@ -325,49 +307,114 @@ void InterfacePane::OnSaveConfig()
if (!is_builtin_type)
Settings::Instance().SetUserStyleName(selected_style.toString());
Settings::Instance().ApplyStyle();
// Render Window Options
Settings::Instance().SetKeepWindowOnTop(m_checkbox_top_window->isChecked());
Config::SetBase(Config::MAIN_CONFIRM_ON_STOP, m_checkbox_confirm_on_stop->isChecked());
Config::SetBase(Config::MAIN_USE_PANIC_HANDLERS, m_checkbox_use_panic_handlers->isChecked());
Config::SetBase(Config::MAIN_OSD_MESSAGES, m_checkbox_enable_osd->isChecked());
Config::SetBase(Config::MAIN_SHOW_ACTIVE_TITLE, m_checkbox_show_active_title->isChecked());
Config::SetBase(Config::MAIN_PAUSE_ON_FOCUS_LOST, m_checkbox_pause_on_focus_lost->isChecked());
auto new_language = m_combobox_language->currentData().toString().toStdString();
if (new_language != Config::Get(Config::MAIN_INTERFACE_LANGUAGE))
{
Config::SetBase(Config::MAIN_INTERFACE_LANGUAGE, new_language);
ModalMessageBox::information(
this, tr("Restart Required"),
tr("You must restart Dolphin in order for the change to take effect."));
}
const bool use_covers = m_checkbox_use_covers->isChecked();
if (use_covers != Config::Get(Config::MAIN_USE_GAME_COVERS))
{
Config::SetBase(Config::MAIN_USE_GAME_COVERS, use_covers);
Settings::Instance().RefreshMetadata();
}
Config::SetBase(Config::MAIN_FOCUSED_HOTKEYS, m_checkbox_focused_hotkeys->isChecked());
Config::SetBase(Config::MAIN_DISABLE_SCREENSAVER, m_checkbox_disable_screensaver->isChecked());
Config::Save();
}
void InterfacePane::OnCursorVisibleMovement()
void InterfacePane::OnLanguageChanged()
{
Settings::Instance().SetCursorVisibility(Config::ShowCursor::OnMovement);
ModalMessageBox::information(
this, tr("Restart Required"),
tr("You must restart Dolphin in order for the change to take effect."));
}
void InterfacePane::OnCursorVisibleNever()
void InterfacePane::AddDescriptions()
{
Settings::Instance().SetCursorVisibility(Config::ShowCursor::Never);
}
static constexpr char TR_TITLE_DATABASE_DESCRIPTION[] = QT_TR_NOOP(
"Uses Dolphin's database of properly formatted names in the game list's Title column."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
static constexpr char TR_THEME_DESCRIPTION[] =
QT_TR_NOOP("Changes the appearance and color of Dolphin's buttons."
"<br><br><dolphin_emphasis>If unsure, select Clean.</dolphin_emphasis>");
static constexpr char TR_TOP_WINDOW_DESCRIPTION[] =
QT_TR_NOOP("Forces the render window to stay on top of other windows and applications."
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
static constexpr char TR_LANGUAGE_DESCRIPTION[] = QT_TR_NOOP(
"Sets the language displayed by Dolphin's user interface."
"<br><br>Changes to this setting only take effect once Dolphin is restarted."
"<br><br><dolphin_emphasis>If unsure, select &lt;System Language&gt;.</dolphin_emphasis>");
static constexpr char TR_FOCUSED_HOTKEYS_DESCRIPTION[] =
QT_TR_NOOP("Requires the render window to be focused for hotkeys to take effect."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
static constexpr char TR_USE_COVERS_DESCRIPTION[] =
QT_TR_NOOP("Downloads full game covers from GameTDB.com to display in the game list's Grid "
"View. If this setting is unchecked, the game list displays a banner from the "
"game's save data, and if the game has no save file, displays a generic "
"banner instead."
"<br><br>List View will always use the save file banners."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
static constexpr char TR_DISABLE_SCREENSAVER_DESCRIPTION[] =
QT_TR_NOOP("Disables your screensaver while running a game."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
static constexpr char TR_CONFIRM_ON_STOP_DESCRIPTION[] =
QT_TR_NOOP("Prompts you to confirm that you want to end emulation when you press Stop."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
static constexpr char TR_USE_PANIC_HANDLERS_DESCRIPTION[] =
QT_TR_NOOP("In the event of an error, Dolphin will halt to inform you of the error and "
"present choices on how to proceed. With this option disabled, Dolphin will "
"\"ignore\" all errors. Emulation will not be halted and you will not be notified."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
static constexpr char TR_ENABLE_OSD_DESCRIPTION[] =
QT_TR_NOOP("Shows on-screen display messages over the render window. These messages "
"disappear after several seconds."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
static constexpr char TR_SHOW_ACTIVE_TITLE_DESCRIPTION[] =
QT_TR_NOOP("Shows the active game title in the render window's title bar."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
static constexpr char TR_PAUSE_ON_FOCUS_LOST_DESCRIPTION[] =
QT_TR_NOOP("Pauses the game whenever the render window isn't focused."
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
static constexpr char TR_LOCK_MOUSE_DESCRIPTION[] =
QT_TR_NOOP("Locks the mouse cursor to the Render Widget as long as it has focus. You can "
"set a hotkey to unlock it."
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
static constexpr char TR_CURSOR_VISIBLE_MOVEMENT_DESCRIPTION[] =
QT_TR_NOOP("Shows the mouse cursor briefly whenever it has recently moved, then hides it."
"<br><br><dolphin_emphasis>If unsure, select this mode.</dolphin_emphasis>");
static constexpr char TR_CURSOR_VISIBLE_NEVER_DESCRIPTION[] = QT_TR_NOOP(
"Hides the mouse cursor whenever it is inside the render window and the render window is "
"focused."
"<br><br><dolphin_emphasis>If unsure, select &quot;On Movement&quot;.</dolphin_emphasis>");
static constexpr char TR_CURSOR_VISIBLE_ALWAYS_DESCRIPTION[] = QT_TR_NOOP(
"Shows the mouse cursor at all times."
"<br><br><dolphin_emphasis>If unsure, select &quot;On Movement&quot;.</dolphin_emphasis>");
static constexpr char TR_USER_STYLE_DESCRIPTION[] =
QT_TR_NOOP("Sets the style of Dolphin's user interface. Any custom styles that you have "
"added will be presented here, allowing you to switch to them."
"<br><br><dolphin_emphasis>If unsure, select (System).</dolphin_emphasis>");
void InterfacePane::OnCursorVisibleAlways()
{
Settings::Instance().SetCursorVisibility(Config::ShowCursor::Constantly);
m_checkbox_use_builtin_title_database->SetDescription(tr(TR_TITLE_DATABASE_DESCRIPTION));
m_combobox_theme->SetTitle(tr("Theme"));
m_combobox_theme->SetDescription(tr(TR_THEME_DESCRIPTION));
m_checkbox_top_window->SetDescription(tr(TR_TOP_WINDOW_DESCRIPTION));
m_combobox_language->SetTitle(tr("Language"));
m_combobox_language->SetDescription(tr(TR_LANGUAGE_DESCRIPTION));
m_checkbox_focused_hotkeys->SetDescription(tr(TR_FOCUSED_HOTKEYS_DESCRIPTION));
m_checkbox_use_covers->SetDescription(tr(TR_USE_COVERS_DESCRIPTION));
m_checkbox_disable_screensaver->SetDescription(tr(TR_DISABLE_SCREENSAVER_DESCRIPTION));
m_checkbox_confirm_on_stop->SetDescription(tr(TR_CONFIRM_ON_STOP_DESCRIPTION));
m_checkbox_use_panic_handlers->SetDescription(tr(TR_USE_PANIC_HANDLERS_DESCRIPTION));
m_checkbox_enable_osd->SetDescription(tr(TR_ENABLE_OSD_DESCRIPTION));
m_checkbox_show_active_title->SetDescription(tr(TR_SHOW_ACTIVE_TITLE_DESCRIPTION));
m_checkbox_pause_on_focus_lost->SetDescription(tr(TR_PAUSE_ON_FOCUS_LOST_DESCRIPTION));
m_checkbox_lock_mouse->SetDescription(tr(TR_LOCK_MOUSE_DESCRIPTION));
m_radio_cursor_visible_movement->SetDescription(tr(TR_CURSOR_VISIBLE_MOVEMENT_DESCRIPTION));
m_radio_cursor_visible_never->SetDescription(tr(TR_CURSOR_VISIBLE_NEVER_DESCRIPTION));
m_radio_cursor_visible_always->SetDescription(tr(TR_CURSOR_VISIBLE_ALWAYS_DESCRIPTION));
m_combobox_userstyle->SetTitle(tr("Style"));
m_combobox_userstyle->SetDescription(tr(TR_USER_STYLE_DESCRIPTION));
}

View file

@ -5,12 +5,13 @@
#include <QWidget>
class QCheckBox;
class QComboBox;
class ConfigBool;
class ConfigRadioInt;
class ConfigStringChoice;
class QLabel;
class QRadioButton;
class QVBoxLayout;
class ToolTipCheckBox;
class ToolTipComboBox;
class InterfacePane final : public QWidget
{
@ -22,34 +23,33 @@ private:
void CreateLayout();
void CreateUI();
void CreateInGame();
void AddDescriptions();
void ConnectLayout();
void LoadConfig();
void OnSaveConfig();
void OnCursorVisibleMovement();
void OnCursorVisibleNever();
void OnCursorVisibleAlways();
void UpdateShowDebuggingCheckbox();
void LoadUserStyle();
void OnUserStyleChanged();
void OnLanguageChanged();
QVBoxLayout* m_main_layout;
QComboBox* m_combobox_language;
ConfigStringChoice* m_combobox_language;
QComboBox* m_combobox_theme;
QComboBox* m_combobox_userstyle;
ConfigStringChoice* m_combobox_theme;
ToolTipComboBox* m_combobox_userstyle;
QLabel* m_label_userstyle;
QCheckBox* m_checkbox_top_window;
QCheckBox* m_checkbox_use_builtin_title_database;
QCheckBox* m_checkbox_use_userstyle;
ConfigBool* m_checkbox_top_window;
ConfigBool* m_checkbox_use_builtin_title_database;
ToolTipCheckBox* m_checkbox_show_debugging_ui;
QCheckBox* m_checkbox_focused_hotkeys;
QCheckBox* m_checkbox_use_covers;
QCheckBox* m_checkbox_disable_screensaver;
ConfigBool* m_checkbox_focused_hotkeys;
ConfigBool* m_checkbox_use_covers;
ConfigBool* m_checkbox_disable_screensaver;
QCheckBox* m_checkbox_confirm_on_stop;
QCheckBox* m_checkbox_use_panic_handlers;
QCheckBox* m_checkbox_enable_osd;
QCheckBox* m_checkbox_show_active_title;
QCheckBox* m_checkbox_pause_on_focus_lost;
QRadioButton* m_radio_cursor_visible_movement;
QRadioButton* m_radio_cursor_visible_never;
QRadioButton* m_radio_cursor_visible_always;
QCheckBox* m_checkbox_lock_mouse;
ConfigBool* m_checkbox_confirm_on_stop;
ConfigBool* m_checkbox_use_panic_handlers;
ConfigBool* m_checkbox_enable_osd;
ConfigBool* m_checkbox_show_active_title;
ConfigBool* m_checkbox_pause_on_focus_lost;
ConfigRadioInt* m_radio_cursor_visible_movement;
ConfigRadioInt* m_radio_cursor_visible_never;
ConfigRadioInt* m_radio_cursor_visible_always;
ConfigBool* m_checkbox_lock_mouse;
};

View file

@ -113,7 +113,7 @@ void USBDeviceAddToWhitelistDialog::RefreshDeviceList()
auto whitelist = Config::GetUSBDeviceWhitelist();
for (const auto& device : current_devices)
{
if (whitelist.count({device.first.first, device.first.second}) != 0)
if (whitelist.contains({device.first.first, device.first.second}))
continue;
usb_inserted_devices_list->addItem(QString::fromStdString(device.second));
}

View file

@ -503,7 +503,7 @@ void WiiPane::PopulateUSBPassthroughListWidget()
void WiiPane::BrowseSDRaw()
{
QString file = QDir::toNativeSeparators(DolphinFileDialog::getOpenFileName(
this, tr("Select a SD Card Image"),
this, tr("Select SD Card Image"),
QString::fromStdString(Config::Get(Config::MAIN_WII_SD_CARD_IMAGE_PATH)),
tr("SD Card Image (*.raw);;"
"All Files (*)")));
@ -520,7 +520,7 @@ void WiiPane::SetSDRaw(const QString& path)
void WiiPane::BrowseSDSyncFolder()
{
QString file = QDir::toNativeSeparators(DolphinFileDialog::getExistingDirectory(
this, tr("Select a Folder to sync with the SD Card Image"),
this, tr("Select a Folder to Sync with the SD Card Image"),
QString::fromStdString(Config::Get(Config::MAIN_WII_SD_CARD_SYNC_FOLDER_PATH))));
if (!file.isEmpty())
SetSDSyncFolder(file);