Qt: Make general settings overridable per-game

This commit is contained in:
Connor McLaughlin 2022-07-23 00:16:28 +10:00
parent 75b4891f78
commit 667726bbb3
2 changed files with 15 additions and 8 deletions

View File

@ -38,6 +38,11 @@ GeneralSettingsWidget::GeneralSettingsWidget(SettingsDialog* dialog, QWidget* pa
onRenderToSeparateWindowChanged(); onRenderToSeparateWindowChanged();
if (m_dialog->isPerGameSettings())
{
m_ui.applyGameSettings->setEnabled(false);
}
dialog->registerWidgetHelp( dialog->registerWidgetHelp(
m_ui.confirmPowerOff, tr("Confirm Power Off"), tr("Checked"), m_ui.confirmPowerOff, tr("Confirm Power Off"), tr("Checked"),
tr("Determines whether a prompt will be displayed to confirm shutting down the emulator/game " tr("Determines whether a prompt will be displayed to confirm shutting down the emulator/game "

View File

@ -60,13 +60,14 @@ SettingsDialog::~SettingsDialog()
} }
void SettingsDialog::addPages() void SettingsDialog::addPages()
{
if (!isPerGameSettings())
{ {
addWidget(m_general_settings = new GeneralSettingsWidget(this, m_ui.settingsContainer), tr("General"), addWidget(m_general_settings = new GeneralSettingsWidget(this, m_ui.settingsContainer), tr("General"),
QStringLiteral("settings-3-line"), QStringLiteral("settings-3-line"),
tr("<strong>General Settings</strong><hr>These options control how the emulator looks and " tr("<strong>General Settings</strong><hr>These options control how the emulator looks and "
"behaves.<br><br>Mouse over an option for additional information.")); "behaves.<br><br>Mouse over an option for additional information."));
if (!isPerGameSettings())
{
addWidget( addWidget(
m_game_list_settings = new GameListSettingsWidget(this, m_ui.settingsContainer), tr("Game List"), m_game_list_settings = new GameListSettingsWidget(this, m_ui.settingsContainer), tr("Game List"),
QStringLiteral("folder-settings-line"), QStringLiteral("folder-settings-line"),
@ -74,10 +75,6 @@ void SettingsDialog::addPages()
"DuckStation to populate the game list. Search directories can be added, removed, and switched to " "DuckStation to populate the game list. Search directories can be added, removed, and switched to "
"recursive/non-recursive.")); "recursive/non-recursive."));
} }
else
{
m_ui.buttonBox->button(QDialogButtonBox::RestoreDefaults)->setVisible(false);
}
addWidget(m_bios_settings = new BIOSSettingsWidget(this, m_ui.settingsContainer), tr("BIOS"), addWidget(m_bios_settings = new BIOSSettingsWidget(this, m_ui.settingsContainer), tr("BIOS"),
QStringLiteral("hard-drive-2-line"), QStringLiteral("hard-drive-2-line"),
@ -162,6 +159,11 @@ void SettingsDialog::addPages()
tr("<strong>Advanced Settings</strong><hr>These options control logging and internal behavior of the " tr("<strong>Advanced Settings</strong><hr>These options control logging and internal behavior of the "
"emulator. Mouse over an option for additional information.")); "emulator. Mouse over an option for additional information."));
if (isPerGameSettings())
{
m_ui.buttonBox->button(QDialogButtonBox::RestoreDefaults)->setVisible(false);
}
m_ui.settingsCategory->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); m_ui.settingsCategory->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
m_ui.settingsCategory->setCurrentRow(0); m_ui.settingsCategory->setCurrentRow(0);
m_ui.settingsContainer->setCurrentIndex(0); m_ui.settingsContainer->setCurrentIndex(0);