From ac3a854f45fb811fec882ea9b55c81be08e33f37 Mon Sep 17 00:00:00 2001 From: vitor-k Date: Sat, 31 Aug 2019 21:58:07 -0300 Subject: [PATCH] Add cancel option to analog stick configuration --- .../configuration/configure_input.cpp | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/citra_qt/configuration/configure_input.cpp b/src/citra_qt/configuration/configure_input.cpp index de5250f2ae..642d5f14af 100644 --- a/src/citra_qt/configuration/configure_input.cpp +++ b/src/citra_qt/configuration/configure_input.cpp @@ -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); + } }); }