2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #7831 from lioncash/motion

configure_motion_touch: Use functor versions of invokeMethod
This commit is contained in:
Morph 2022-02-01 14:48:52 -05:00 committed by GitHub
commit a28a10bc54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,6 +42,7 @@ CalibrationConfigurationDialog::CalibrationConfigurationDialog(QWidget* parent,
job = std::make_unique<CalibrationConfigurationJob>(
host, port,
[this](CalibrationConfigurationJob::Status status) {
QMetaObject::invokeMethod(this, [status, this] {
QString text;
switch (status) {
case CalibrationConfigurationJob::Status::Ready:
@ -56,9 +57,10 @@ CalibrationConfigurationDialog::CalibrationConfigurationDialog(QWidget* parent,
default:
break;
}
QMetaObject::invokeMethod(this, "UpdateLabelText", Q_ARG(QString, text));
UpdateLabelText(text);
});
if (status == CalibrationConfigurationJob::Status::Completed) {
QMetaObject::invokeMethod(this, "UpdateButtonText", Q_ARG(QString, tr("OK")));
QMetaObject::invokeMethod(this, [this] { UpdateButtonText(tr("OK")); });
}
},
[this](u16 min_x_, u16 min_y_, u16 max_x_, u16 max_y_) {
@ -215,11 +217,11 @@ void ConfigureMotionTouch::OnCemuhookUDPTest() {
ui->udp_server->text().toStdString(), static_cast<u16>(ui->udp_port->text().toInt()),
[this] {
LOG_INFO(Frontend, "UDP input test success");
QMetaObject::invokeMethod(this, "ShowUDPTestResult", Q_ARG(bool, true));
QMetaObject::invokeMethod(this, [this] { ShowUDPTestResult(true); });
},
[this] {
LOG_ERROR(Frontend, "UDP input test failed");
QMetaObject::invokeMethod(this, "ShowUDPTestResult", Q_ARG(bool, false));
QMetaObject::invokeMethod(this, [this] { ShowUDPTestResult(false); });
});
}