Migrate most dialogs to use QDialogButtonBox

This commit is contained in:
Silent
2021-12-13 22:05:42 +01:00
parent 690fa6ec3c
commit 5d4622af9a
15 changed files with 167 additions and 350 deletions

View File

@ -76,8 +76,13 @@ SettingsDialog::SettingsDialog(QtHostInterface* host_interface, QWidget* parent
m_ui.settingsContainer->setCurrentIndex(0);
m_ui.helpText->setText(m_category_help_text[0]);
connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &SettingsDialog::onCategoryCurrentRowChanged);
connect(m_ui.closeButton, &QPushButton::clicked, this, &SettingsDialog::accept);
connect(m_ui.restoreDefaultsButton, &QPushButton::clicked, this, &SettingsDialog::onRestoreDefaultsClicked);
connect(m_ui.buttonBox, &QDialogButtonBox::rejected, this, &SettingsDialog::accept);
connect(m_ui.buttonBox, &QDialogButtonBox::clicked, this, [this](QAbstractButton* button) {
if (m_ui.buttonBox->buttonRole(button) == QDialogButtonBox::ResetRole)
{
onRestoreDefaultsClicked();
}
});
connect(m_console_settings, &ConsoleSettingsWidget::multitapModeChanged, m_controller_settings,
&ControllerSettingsWidget::updateMultitapControllerTitles);