diff options
| author | Dentomologist <dentomologist@gmail.com> | 2023-11-11 16:04:50 -0800 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2024-05-31 18:59:24 +0200 |
| commit | afe5bfd5127cda889dac46907c3b94b9641cfbee (patch) | |
| tree | 338482bf1daf7ea2f2b335ec027e89b1b8bd8329 /Source | |
| parent | 7d704ca9caa4ab5045743f1cc584e6f329d24505 (diff) | |
InterfacePane: Add BalloonTip to debugging enabled checkbox
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinQt/Settings/InterfacePane.cpp | 29 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Settings/InterfacePane.h | 1 |
2 files changed, 23 insertions, 7 deletions
diff --git a/Source/Core/DolphinQt/Settings/InterfacePane.cpp b/Source/Core/DolphinQt/Settings/InterfacePane.cpp index 198d0810e8..603e7a8447 100644 --- a/Source/Core/DolphinQt/Settings/InterfacePane.cpp +++ b/Source/Core/DolphinQt/Settings/InterfacePane.cpp @@ -91,7 +91,7 @@ InterfacePane::InterfacePane(QWidget* parent) : QWidget(parent) ConnectLayout(); connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, - &InterfacePane::LoadConfig); + &InterfacePane::UpdateShowDebuggingCheckbox); } void InterfacePane::CreateLayout() @@ -228,7 +228,8 @@ void InterfacePane::ConnectLayout() &Settings::GameListRefreshRequested); 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_show_debugging_ui, &QCheckBox::toggled, &Settings::Instance(), + &Settings::SetDebugModeEnabled); connect(m_checkbox_focused_hotkeys, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); connect(m_combobox_theme, &QComboBox::currentIndexChanged, this, [this](int index) { Settings::Instance().TriggerThemeChanged(); }); @@ -253,24 +254,39 @@ void InterfacePane::ConnectLayout() &Settings::SetLockCursor); } -void InterfacePane::LoadConfig() +void InterfacePane::UpdateShowDebuggingCheckbox() { SignalBlocking(m_checkbox_show_debugging_ui) ->setChecked(Settings::Instance().IsDebugModeEnabled()); + 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>"); + #ifdef USE_RETRO_ACHIEVEMENTS 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)); } +#else + m_checkbox_show_debugging_ui->SetDescription(tr(TR_SHOW_DEBUGGING_UI_DESCRIPTION)); #endif // USE_RETRO_ACHIEVEMENTS +} + +void InterfacePane::LoadConfig() +{ + UpdateShowDebuggingCheckbox(); const Settings::StyleType style_type = Settings::Instance().GetStyleType(); const QString userstyle = Settings::Instance().GetUserStyleName(); @@ -306,7 +322,6 @@ void InterfacePane::LoadConfig() void InterfacePane::OnSaveConfig() { - 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); diff --git a/Source/Core/DolphinQt/Settings/InterfacePane.h b/Source/Core/DolphinQt/Settings/InterfacePane.h index 2cdc9e1ebe..b1d0f11c2d 100644 --- a/Source/Core/DolphinQt/Settings/InterfacePane.h +++ b/Source/Core/DolphinQt/Settings/InterfacePane.h @@ -26,6 +26,7 @@ private: void CreateInGame(); void AddDescriptions(); void ConnectLayout(); + void UpdateShowDebuggingCheckbox(); void LoadConfig(); void OnSaveConfig(); void OnCursorVisibleMovement(); |
