summaryrefslogtreecommitdiffhomepage
path: root/video-ps3eye/module.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-08-18 19:44:11 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-08-18 19:47:12 +0200
commite8f5b7ec366f1cf7660e870335b4e503e4527990 (patch)
treee5a345b1f17ed89286d169cec873a675bb13f48b /video-ps3eye/module.cpp
parent721fa3ce414386e0da8da8529f60ba983812c1c3 (diff)
video/ps3eye: add missing translation strings
Diffstat (limited to 'video-ps3eye/module.cpp')
-rw-r--r--video-ps3eye/module.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/video-ps3eye/module.cpp b/video-ps3eye/module.cpp
index 34987241..25d82170 100644
--- a/video-ps3eye/module.cpp
+++ b/video-ps3eye/module.cpp
@@ -190,13 +190,13 @@ bool ps3eye_camera::start(info& args)
}
if (ptr.out.error_string[0] == '\0')
- error = "Unknown error";
+ error = QString{};
else
error = QString::fromLatin1((const char*)ptr.out.error_string,
strnlen((const char*)ptr.out.error_string, sizeof(ptr.out.error_string)));
- run_in_thread_async(qApp, [=]() {
- QMessageBox::critical(nullptr, "Can't open camera", "PS3 Eye driver error: " + error, QMessageBox::Close);
+ run_in_thread_async(qApp, [error = std::move(error)] {
+ dialog::show_open_failure_msgbox(error);
});
return false;
@@ -267,6 +267,14 @@ dialog::dialog(QWidget* parent) : QWidget(parent)
connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &dialog::do_cancel);
connect(&t, &QTimer::timeout, this, [this] { s.set_exposure(); s.set_gain(); });
}
+void dialog::show_open_failure_msgbox(const QString& error)
+{
+ const QString& error_ = error.isNull() ? tr("Unknown error") : error;
+ QMessageBox::critical(nullptr,
+ tr("Can't open camera"),
+ tr("PS3 Eye driver error: %1").arg(error_),
+ QMessageBox::Close);
+}
// XXX copypasta -sh 20200329
void settings::set_gain()