Qt: prevent saving/canceling for remapping/hotkeys dialogs while waiting for inputs (#3499)

* prevent saving/canceling dialog while mapping mode is enabled

* do not disable cancel button

* diable defaults button
This commit is contained in:
rainmakerv2 authored and GitHub committed 2025-09-01 11:08:17 -07:00
1 parent 47e0d488d8
commit b4a82bfcdd
3 files changed
+22

No files matched your search

+8
View File
@@ -756,6 +756,10 @@ void ControlSettings::DisableMappingButtons() {
for (const auto& i : AxisList) {
i->setEnabled(false);
}
ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false);
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
ui->buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(false);
}
void ControlSettings::EnableMappingButtons() {
@@ -766,6 +770,10 @@ void ControlSettings::EnableMappingButtons() {
for (const auto& i : AxisList) {
i->setEnabled(true);
}
ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(true);
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
ui->buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(true);
}
void ControlSettings::ConnectAxisInputs(QPushButton*& button) {
+6
View File
@@ -70,12 +70,18 @@ void hotkeys::DisableMappingButtons() {
for (const auto& i : ButtonsList) {
i->setEnabled(false);
}
ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false);
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
}
void hotkeys::EnableMappingButtons() {
for (const auto& i : ButtonsList) {
i->setEnabled(true);
}
ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(true);
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
}
void hotkeys::SaveHotkeys(bool CloseOnSave) {
+8
View File
@@ -162,12 +162,20 @@ void KBMSettings::DisableMappingButtons() {
for (const auto& i : ButtonsList) {
i->setEnabled(false);
}
ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false);
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
ui->buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(false);
}
void KBMSettings::EnableMappingButtons() {
for (const auto& i : ButtonsList) {
i->setEnabled(true);
}
ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(true);
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
ui->buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(true);
}
void KBMSettings::SaveKBMConfig(bool close_on_save) {