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
2025-09-02 02:08:17 +08:00
committed by GitHub
parent 47e0d488d8
commit b4a82bfcdd
3 changed files with 22 additions and 0 deletions

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) {

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) {

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) {