From e59200b8c2bfbc8de96997da87e8618d1d7f7d64 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 10 Aug 2020 22:40:38 +1000 Subject: [PATCH] Qt/ConsoleSettingsWidget: Support adding help --- src/duckstation-qt/consolesettingswidget.cpp | 10 ++++++++-- src/duckstation-qt/consolesettingswidget.h | 3 ++- src/duckstation-qt/settingsdialog.cpp | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/duckstation-qt/consolesettingswidget.cpp b/src/duckstation-qt/consolesettingswidget.cpp index 1bd67b926..20aa5d11a 100644 --- a/src/duckstation-qt/consolesettingswidget.cpp +++ b/src/duckstation-qt/consolesettingswidget.cpp @@ -1,10 +1,11 @@ #include "consolesettingswidget.h" +#include "settingsdialog.h" #include "settingwidgetbinder.h" #include static constexpr char BIOS_IMAGE_FILTER[] = "Binary Images (*.bin);;All Files (*.*)"; -ConsoleSettingsWidget::ConsoleSettingsWidget(QtHostInterface* host_interface, QWidget* parent /* = nullptr */) +ConsoleSettingsWidget::ConsoleSettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog) : QWidget(parent), m_host_interface(host_interface) { m_ui.setupUi(this); @@ -26,9 +27,14 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(QtHostInterface* host_interface, QW Settings::DEFAULT_CPU_EXECUTION_MODE); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cdromReadThread, "CDROM", "ReadThread"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cdromRegionCheck, "CDROM", "RegionCheck"); - SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cdromLoadImageToRAM, "CDROM", "LoadImageToRAM", false); + SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cdromLoadImageToRAM, "CDROM", "LoadImageToRAM", + false); connect(m_ui.biosPathBrowse, &QPushButton::pressed, this, &ConsoleSettingsWidget::onBrowseBIOSPathButtonClicked); + + dialog->registerWidgetHelp(m_ui.fastBoot, tr("Fast Boot"), tr("Unchecked"), + tr("Patches the BIOS to skip the console's boot animation. Does not work with all games, " + "but usually safe to enabled.")); } ConsoleSettingsWidget::~ConsoleSettingsWidget() = default; diff --git a/src/duckstation-qt/consolesettingswidget.h b/src/duckstation-qt/consolesettingswidget.h index dd8fba125..ac640747e 100644 --- a/src/duckstation-qt/consolesettingswidget.h +++ b/src/duckstation-qt/consolesettingswidget.h @@ -5,13 +5,14 @@ #include "ui_consolesettingswidget.h" class QtHostInterface; +class SettingsDialog; class ConsoleSettingsWidget : public QWidget { Q_OBJECT public: - explicit ConsoleSettingsWidget(QtHostInterface* host_interface, QWidget* parent = nullptr); + explicit ConsoleSettingsWidget(QtHostInterface* host_interface, QWidget* parent, SettingsDialog* dialog); ~ConsoleSettingsWidget(); private Q_SLOTS: diff --git a/src/duckstation-qt/settingsdialog.cpp b/src/duckstation-qt/settingsdialog.cpp index 6d7ec2840..4158837b3 100644 --- a/src/duckstation-qt/settingsdialog.cpp +++ b/src/duckstation-qt/settingsdialog.cpp @@ -22,7 +22,7 @@ SettingsDialog::SettingsDialog(QtHostInterface* host_interface, QWidget* parent setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); m_general_settings = new GeneralSettingsWidget(host_interface, m_ui.settingsContainer, this); - m_console_settings = new ConsoleSettingsWidget(host_interface, m_ui.settingsContainer); + m_console_settings = new ConsoleSettingsWidget(host_interface, m_ui.settingsContainer, this); m_game_list_settings = new GameListSettingsWidget(host_interface, m_ui.settingsContainer); m_hotkey_settings = new HotkeySettingsWidget(host_interface, m_ui.settingsContainer); m_controller_settings = new ControllerSettingsWidget(host_interface, m_ui.settingsContainer);