InterfacePane: Add BalloonTip to title database checkbox

This commit is contained in:
Dentomologist 2023-11-04 15:00:58 -07:00 committed by Admiral H. Curtiss
parent 072b6cdb1d
commit ae0914174f
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
2 changed files with 18 additions and 9 deletions

View File

@ -23,6 +23,7 @@
#include "Core/Config/MainSettings.h" #include "Core/Config/MainSettings.h"
#include "Core/Config/UISettings.h" #include "Core/Config/UISettings.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h" #include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h" #include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/QtUtils/SignalBlocking.h" #include "DolphinQt/QtUtils/SignalBlocking.h"
@ -97,6 +98,7 @@ void InterfacePane::CreateLayout()
// Create layout here // Create layout here
CreateUI(); CreateUI();
CreateInGame(); CreateInGame();
AddDescriptions();
m_main_layout->addStretch(1); m_main_layout->addStretch(1);
setLayout(m_main_layout); setLayout(m_main_layout);
@ -153,7 +155,8 @@ void InterfacePane::CreateUI()
} }
// Checkboxes // 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 = m_checkbox_use_covers =
new QCheckBox(tr("Download Game Covers from GameTDB.com for Use in Grid Mode")); new QCheckBox(tr("Download Game Covers from GameTDB.com for Use in Grid Mode"));
m_checkbox_show_debugging_ui = new ToolTipCheckBox(tr("Enable Debugging UI")); m_checkbox_show_debugging_ui = new ToolTipCheckBox(tr("Enable Debugging UI"));
@ -220,8 +223,8 @@ void InterfacePane::CreateInGame()
void InterfacePane::ConnectLayout() void InterfacePane::ConnectLayout()
{ {
connect(m_checkbox_use_builtin_title_database, &QCheckBox::toggled, this, connect(m_checkbox_use_builtin_title_database, &QCheckBox::toggled, &Settings::Instance(),
&InterfacePane::OnSaveConfig); &Settings::GameListRefreshRequested);
connect(m_checkbox_use_covers, &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_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, this, &InterfacePane::OnSaveConfig);
@ -250,8 +253,6 @@ void InterfacePane::ConnectLayout()
void InterfacePane::LoadConfig() void InterfacePane::LoadConfig()
{ {
SignalBlocking(m_checkbox_use_builtin_title_database)
->setChecked(Config::Get(Config::MAIN_USE_BUILT_IN_TITLE_DATABASE));
SignalBlocking(m_checkbox_show_debugging_ui) SignalBlocking(m_checkbox_show_debugging_ui)
->setChecked(Settings::Instance().IsDebugModeEnabled()); ->setChecked(Settings::Instance().IsDebugModeEnabled());
@ -312,8 +313,6 @@ void InterfacePane::LoadConfig()
void InterfacePane::OnSaveConfig() void InterfacePane::OnSaveConfig()
{ {
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()); Settings::Instance().SetDebugModeEnabled(m_checkbox_show_debugging_ui->isChecked());
const auto selected_style = m_combobox_userstyle->currentData(); const auto selected_style = m_combobox_userstyle->currentData();
bool is_builtin_type = false; bool is_builtin_type = false;
@ -370,3 +369,12 @@ void InterfacePane::OnCursorVisibleAlways()
{ {
Settings::Instance().SetCursorVisibility(Config::ShowCursor::Constantly); Settings::Instance().SetCursorVisibility(Config::ShowCursor::Constantly);
} }
void InterfacePane::AddDescriptions()
{
static constexpr char TR_TITLE_DATABASE_DESCRIPTION[] = QT_TR_NOOP(
"Uses Dolphin's database of properly formatted names in the Game List Title column."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
m_checkbox_use_builtin_title_database->SetDescription(tr(TR_TITLE_DATABASE_DESCRIPTION));
}

View File

@ -5,6 +5,7 @@
#include <QWidget> #include <QWidget>
class ConfigBool;
class QCheckBox; class QCheckBox;
class QComboBox; class QComboBox;
class QLabel; class QLabel;
@ -22,6 +23,7 @@ private:
void CreateLayout(); void CreateLayout();
void CreateUI(); void CreateUI();
void CreateInGame(); void CreateInGame();
void AddDescriptions();
void ConnectLayout(); void ConnectLayout();
void LoadConfig(); void LoadConfig();
void OnSaveConfig(); void OnSaveConfig();
@ -36,8 +38,7 @@ private:
QComboBox* m_combobox_userstyle; QComboBox* m_combobox_userstyle;
QLabel* m_label_userstyle; QLabel* m_label_userstyle;
QCheckBox* m_checkbox_top_window; QCheckBox* m_checkbox_top_window;
QCheckBox* m_checkbox_use_builtin_title_database; ConfigBool* m_checkbox_use_builtin_title_database;
QCheckBox* m_checkbox_use_userstyle;
ToolTipCheckBox* m_checkbox_show_debugging_ui; ToolTipCheckBox* m_checkbox_show_debugging_ui;
QCheckBox* m_checkbox_focused_hotkeys; QCheckBox* m_checkbox_focused_hotkeys;
QCheckBox* m_checkbox_use_covers; QCheckBox* m_checkbox_use_covers;