summaryrefslogtreecommitdiffhomepage
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
parent721fa3ce414386e0da8da8529f60ba983812c1c3 (diff)
video/ps3eye: add missing translation strings
-rw-r--r--video-ps3eye/lang/nl_NL.ts15
-rw-r--r--video-ps3eye/lang/ru_RU.ts15
-rw-r--r--video-ps3eye/lang/stub.ts15
-rw-r--r--video-ps3eye/lang/zh_CN.ts15
-rw-r--r--video-ps3eye/module.cpp14
-rw-r--r--video-ps3eye/module.hpp1
6 files changed, 72 insertions, 3 deletions
diff --git a/video-ps3eye/lang/nl_NL.ts b/video-ps3eye/lang/nl_NL.ts
index c98370ec..81ffc826 100644
--- a/video-ps3eye/lang/nl_NL.ts
+++ b/video-ps3eye/lang/nl_NL.ts
@@ -20,4 +20,19 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>dialog</name>
+ <message>
+ <source>Can&apos;t open camera</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PS3 Eye driver error: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Unknown error</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/video-ps3eye/lang/ru_RU.ts b/video-ps3eye/lang/ru_RU.ts
index c98370ec..81ffc826 100644
--- a/video-ps3eye/lang/ru_RU.ts
+++ b/video-ps3eye/lang/ru_RU.ts
@@ -20,4 +20,19 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>dialog</name>
+ <message>
+ <source>Can&apos;t open camera</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PS3 Eye driver error: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Unknown error</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/video-ps3eye/lang/stub.ts b/video-ps3eye/lang/stub.ts
index c98370ec..81ffc826 100644
--- a/video-ps3eye/lang/stub.ts
+++ b/video-ps3eye/lang/stub.ts
@@ -20,4 +20,19 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>dialog</name>
+ <message>
+ <source>Can&apos;t open camera</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PS3 Eye driver error: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Unknown error</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/video-ps3eye/lang/zh_CN.ts b/video-ps3eye/lang/zh_CN.ts
index c98370ec..81ffc826 100644
--- a/video-ps3eye/lang/zh_CN.ts
+++ b/video-ps3eye/lang/zh_CN.ts
@@ -20,4 +20,19 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>dialog</name>
+ <message>
+ <source>Can&apos;t open camera</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PS3 Eye driver error: %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Unknown error</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
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()
diff --git a/video-ps3eye/module.hpp b/video-ps3eye/module.hpp
index 6dcec66a..595d446a 100644
--- a/video-ps3eye/module.hpp
+++ b/video-ps3eye/module.hpp
@@ -47,6 +47,7 @@ protected:
public:
explicit dialog(QWidget* parent = nullptr);
+ static void show_open_failure_msgbox(const QString& error);
};
struct ps3eye_camera final : video::impl::camera