summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2022-02-01 14:48:52 -0500
committerGravatar GitHub2022-02-01 14:48:52 -0500
commita28a10bc546c2e4bfa693b49fd40b7578e69decb (patch)
tree570fe3eac267c185de6cbbde7302799be82b3d6c
parentMerge pull request #7830 from lioncash/player-copy (diff)
parentconfigure_motion_touch: Use functor versions of invokeMethod (diff)
downloadyuzu-a28a10bc546c2e4bfa693b49fd40b7578e69decb.tar.gz
yuzu-a28a10bc546c2e4bfa693b49fd40b7578e69decb.tar.xz
yuzu-a28a10bc546c2e4bfa693b49fd40b7578e69decb.zip
Merge pull request #7831 from lioncash/motion
configure_motion_touch: Use functor versions of invokeMethod
Diffstat (limited to '')
-rw-r--r--src/yuzu/configuration/configure_motion_touch.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/yuzu/configuration/configure_motion_touch.cpp b/src/yuzu/configuration/configure_motion_touch.cpp
index 8539a5c8b..4340de304 100644
--- a/src/yuzu/configuration/configure_motion_touch.cpp
+++ b/src/yuzu/configuration/configure_motion_touch.cpp
@@ -42,23 +42,25 @@ CalibrationConfigurationDialog::CalibrationConfigurationDialog(QWidget* parent,
42 job = std::make_unique<CalibrationConfigurationJob>( 42 job = std::make_unique<CalibrationConfigurationJob>(
43 host, port, 43 host, port,
44 [this](CalibrationConfigurationJob::Status status) { 44 [this](CalibrationConfigurationJob::Status status) {
45 QString text; 45 QMetaObject::invokeMethod(this, [status, this] {
46 switch (status) { 46 QString text;
47 case CalibrationConfigurationJob::Status::Ready: 47 switch (status) {
48 text = tr("Touch the top left corner <br>of your touchpad."); 48 case CalibrationConfigurationJob::Status::Ready:
49 break; 49 text = tr("Touch the top left corner <br>of your touchpad.");
50 case CalibrationConfigurationJob::Status::Stage1Completed: 50 break;
51 text = tr("Now touch the bottom right corner <br>of your touchpad."); 51 case CalibrationConfigurationJob::Status::Stage1Completed:
52 break; 52 text = tr("Now touch the bottom right corner <br>of your touchpad.");
53 case CalibrationConfigurationJob::Status::Completed: 53 break;
54 text = tr("Configuration completed!"); 54 case CalibrationConfigurationJob::Status::Completed:
55 break; 55 text = tr("Configuration completed!");
56 default: 56 break;
57 break; 57 default:
58 } 58 break;
59 QMetaObject::invokeMethod(this, "UpdateLabelText", Q_ARG(QString, text)); 59 }
60 UpdateLabelText(text);
61 });
60 if (status == CalibrationConfigurationJob::Status::Completed) { 62 if (status == CalibrationConfigurationJob::Status::Completed) {
61 QMetaObject::invokeMethod(this, "UpdateButtonText", Q_ARG(QString, tr("OK"))); 63 QMetaObject::invokeMethod(this, [this] { UpdateButtonText(tr("OK")); });
62 } 64 }
63 }, 65 },
64 [this](u16 min_x_, u16 min_y_, u16 max_x_, u16 max_y_) { 66 [this](u16 min_x_, u16 min_y_, u16 max_x_, u16 max_y_) {
@@ -215,11 +217,11 @@ void ConfigureMotionTouch::OnCemuhookUDPTest() {
215 ui->udp_server->text().toStdString(), static_cast<u16>(ui->udp_port->text().toInt()), 217 ui->udp_server->text().toStdString(), static_cast<u16>(ui->udp_port->text().toInt()),
216 [this] { 218 [this] {
217 LOG_INFO(Frontend, "UDP input test success"); 219 LOG_INFO(Frontend, "UDP input test success");
218 QMetaObject::invokeMethod(this, "ShowUDPTestResult", Q_ARG(bool, true)); 220 QMetaObject::invokeMethod(this, [this] { ShowUDPTestResult(true); });
219 }, 221 },
220 [this] { 222 [this] {
221 LOG_ERROR(Frontend, "UDP input test failed"); 223 LOG_ERROR(Frontend, "UDP input test failed");
222 QMetaObject::invokeMethod(this, "ShowUDPTestResult", Q_ARG(bool, false)); 224 QMetaObject::invokeMethod(this, [this] { ShowUDPTestResult(false); });
223 }); 225 });
224} 226}
225 227