configure_motion_touch: Use functor versions of invokeMethod
Same behavior, but ensures that the functions we're calling exist, since they can be checked at compile-time.
This commit is contained in:
parent
f56226e17f
commit
5c4ed30c21
|
@ -42,23 +42,25 @@ CalibrationConfigurationDialog::CalibrationConfigurationDialog(QWidget* parent,
|
||||||
job = std::make_unique<CalibrationConfigurationJob>(
|
job = std::make_unique<CalibrationConfigurationJob>(
|
||||||
host, port,
|
host, port,
|
||||||
[this](CalibrationConfigurationJob::Status status) {
|
[this](CalibrationConfigurationJob::Status status) {
|
||||||
QString text;
|
QMetaObject::invokeMethod(this, [status, this] {
|
||||||
switch (status) {
|
QString text;
|
||||||
case CalibrationConfigurationJob::Status::Ready:
|
switch (status) {
|
||||||
text = tr("Touch the top left corner <br>of your touchpad.");
|
case CalibrationConfigurationJob::Status::Ready:
|
||||||
break;
|
text = tr("Touch the top left corner <br>of your touchpad.");
|
||||||
case CalibrationConfigurationJob::Status::Stage1Completed:
|
break;
|
||||||
text = tr("Now touch the bottom right corner <br>of your touchpad.");
|
case CalibrationConfigurationJob::Status::Stage1Completed:
|
||||||
break;
|
text = tr("Now touch the bottom right corner <br>of your touchpad.");
|
||||||
case CalibrationConfigurationJob::Status::Completed:
|
break;
|
||||||
text = tr("Configuration completed!");
|
case CalibrationConfigurationJob::Status::Completed:
|
||||||
break;
|
text = tr("Configuration completed!");
|
||||||
default:
|
break;
|
||||||
break;
|
default:
|
||||||
}
|
break;
|
||||||
QMetaObject::invokeMethod(this, "UpdateLabelText", Q_ARG(QString, text));
|
}
|
||||||
|
UpdateLabelText(text);
|
||||||
|
});
|
||||||
if (status == CalibrationConfigurationJob::Status::Completed) {
|
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_) {
|
[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()),
|
ui->udp_server->text().toStdString(), static_cast<u16>(ui->udp_port->text().toInt()),
|
||||||
[this] {
|
[this] {
|
||||||
LOG_INFO(Frontend, "UDP input test success");
|
LOG_INFO(Frontend, "UDP input test success");
|
||||||
QMetaObject::invokeMethod(this, "ShowUDPTestResult", Q_ARG(bool, true));
|
QMetaObject::invokeMethod(this, [this] { ShowUDPTestResult(true); });
|
||||||
},
|
},
|
||||||
[this] {
|
[this] {
|
||||||
LOG_ERROR(Frontend, "UDP input test failed");
|
LOG_ERROR(Frontend, "UDP input test failed");
|
||||||
QMetaObject::invokeMethod(this, "ShowUDPTestResult", Q_ARG(bool, false));
|
QMetaObject::invokeMethod(this, [this] { ShowUDPTestResult(false); });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue