Merge pull request #4911 from vitor-k/master

Add a cancel option to analog stick configuration
This commit is contained in:
Pengfei Zhu 2019-09-01 21:50:10 +08:00 committed by GitHub
commit 05a07f944b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,16 +231,19 @@ ConfigureInput::ConfigureInput(QWidget* parent)
});
}
connect(analog_map_stick[analog_id], &QPushButton::clicked, [=]() {
QMessageBox::information(this, tr("Information"),
tr("After pressing OK, first move your joystick horizontally, "
"and then vertically."));
HandleClick(analog_map_stick[analog_id],
[=](const Common::ParamPackage& params) {
analogs_param[analog_id] = params;
ApplyConfiguration();
Settings::SaveProfile(ui->profile->currentIndex());
},
InputCommon::Polling::DeviceType::Analog);
if (QMessageBox::information(
this, tr("Information"),
tr("After pressing OK, first move your joystick horizontally, "
"and then vertically."),
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
HandleClick(analog_map_stick[analog_id],
[=](const Common::ParamPackage& params) {
analogs_param[analog_id] = params;
ApplyConfiguration();
Settings::SaveProfile(ui->profile->currentIndex());
},
InputCommon::Polling::DeviceType::Analog);
}
});
}