Qt: Add interface section to per-game settings

This commit is contained in:
Connor McLaughlin 2022-10-22 13:43:26 +10:00 committed by refractionpcsx2
parent fb9c9cb172
commit a3b3edb565
3 changed files with 29 additions and 17 deletions

View File

@ -78,7 +78,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget
m_ui.inhibitScreensaver, tr("Inhibit Screensaver"), tr("Checked"), m_ui.inhibitScreensaver, tr("Inhibit Screensaver"), tr("Checked"),
tr("Prevents the screen saver from activating and the host from sleeping while emulation is running.")); tr("Prevents the screen saver from activating and the host from sleeping while emulation is running."));
if (AutoUpdaterDialog::isSupported()) if (!dialog->isPerGameSettings() && AutoUpdaterDialog::isSupported())
{ {
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.autoUpdateEnabled, "AutoUpdater", "CheckAtStartup", true); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.autoUpdateEnabled, "AutoUpdater", "CheckAtStartup", true);
dialog->registerWidgetHelp(m_ui.autoUpdateEnabled, tr("Enable Automatic Update Check"), tr("Checked"), dialog->registerWidgetHelp(m_ui.autoUpdateEnabled, tr("Enable Automatic Update Check"), tr("Checked"),
@ -104,6 +104,16 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget
m_ui.discordPresence->setEnabled(false); m_ui.discordPresence->setEnabled(false);
#endif #endif
if (dialog->isPerGameSettings())
{
// language/theme doesn't make sense to have in per-game settings
m_ui.verticalLayout->removeWidget(m_ui.preferencesGroup);
m_ui.preferencesGroup->hide();
// start paused doesn't make sense, because settings are applied after ELF load.
m_ui.pauseOnStart->setEnabled(false);
}
dialog->registerWidgetHelp( dialog->registerWidgetHelp(
m_ui.confirmShutdown, tr("Confirm Shutdown"), tr("Checked"), m_ui.confirmShutdown, tr("Confirm Shutdown"), tr("Checked"),
tr("Determines whether a prompt will be displayed to confirm shutting down the virtual machine " tr("Determines whether a prompt will be displayed to confirm shutting down the virtual machine "

View File

@ -140,7 +140,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="preferencesGroup">
<property name="title"> <property name="title">
<string>Preferences</string> <string>Preferences</string>
</property> </property>

View File

@ -77,21 +77,7 @@ void SettingsDialog::setupUi(const GameList::Entry* game)
m_ui.setupUi(this); m_ui.setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
// We don't include interface/game list/bios settings from per-game settings. if (isPerGameSettings())
if (!isPerGameSettings())
{
addWidget(m_interface_settings = new InterfaceSettingsWidget(this, m_ui.settingsContainer), tr("Interface"),
QStringLiteral("settings-3-line"),
tr("<strong>Interface Settings</strong><hr>These options control how the software looks and behaves.<br><br>Mouse over an option for "
"additional information."));
addWidget(m_game_list_settings = new GameListSettingsWidget(this, m_ui.settingsContainer), tr("Game List"),
QStringLiteral("folder-settings-line"),
tr("<strong>Game List Settings</strong><hr>The list above shows the directories which will be searched by PCSX2 to populate the game "
"list. Search directories can be added, removed, and switched to recursive/non-recursive."));
addWidget(m_bios_settings = new BIOSSettingsWidget(this, m_ui.settingsContainer), tr("BIOS"), QStringLiteral("hard-drive-2-line"),
tr("<strong>BIOS Settings</strong><hr>Configure your BIOS here.<br><br>Mouse over an option for additional information."));
}
else
{ {
if (game) if (game)
{ {
@ -102,6 +88,22 @@ void SettingsDialog::setupUi(const GameList::Entry* game)
m_ui.restoreDefaultsButton->setVisible(false); m_ui.restoreDefaultsButton->setVisible(false);
} }
addWidget(m_interface_settings = new InterfaceSettingsWidget(this, m_ui.settingsContainer), tr("Interface"),
QStringLiteral("settings-3-line"),
tr("<strong>Interface Settings</strong><hr>These options control how the software looks and behaves.<br><br>Mouse over an option for "
"additional information."));
// We don't include game list/bios settings in per-game settings.
if (!isPerGameSettings())
{
addWidget(m_game_list_settings = new GameListSettingsWidget(this, m_ui.settingsContainer), tr("Game List"),
QStringLiteral("folder-settings-line"),
tr("<strong>Game List Settings</strong><hr>The list above shows the directories which will be searched by PCSX2 to populate the game "
"list. Search directories can be added, removed, and switched to recursive/non-recursive."));
addWidget(m_bios_settings = new BIOSSettingsWidget(this, m_ui.settingsContainer), tr("BIOS"), QStringLiteral("hard-drive-2-line"),
tr("<strong>BIOS Settings</strong><hr>Configure your BIOS here.<br><br>Mouse over an option for additional information."));
}
// Common to both per-game and global settings. // Common to both per-game and global settings.
addWidget(m_emulation_settings = new EmulationSettingsWidget(this, m_ui.settingsContainer), tr("Emulation"), QStringLiteral("dashboard-line"), addWidget(m_emulation_settings = new EmulationSettingsWidget(this, m_ui.settingsContainer), tr("Emulation"), QStringLiteral("dashboard-line"),
tr("<strong>Emulation Settings</strong><hr>These options determine the configuration of frame pacing and game settings.<br><br>Mouse over an option for additional information.")); tr("<strong>Emulation Settings</strong><hr>These options determine the configuration of frame pacing and game settings.<br><br>Mouse over an option for additional information."));