summaryrefslogtreecommitdiffhomepage
path: root/tracker-fusion
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-fusion')
-rw-r--r--tracker-fusion/fusion.cpp33
-rw-r--r--tracker-fusion/fusion.h16
-rw-r--r--tracker-fusion/lang/de_DE.ts56
-rw-r--r--tracker-fusion/lang/nl_NL.ts7
-rw-r--r--tracker-fusion/lang/ru_RU.ts7
-rw-r--r--tracker-fusion/lang/stub.ts7
-rw-r--r--tracker-fusion/lang/zh_CN.ts9
7 files changed, 105 insertions, 30 deletions
diff --git a/tracker-fusion/fusion.cpp b/tracker-fusion/fusion.cpp
index 98e2465e..fba38d3d 100644
--- a/tracker-fusion/fusion.cpp
+++ b/tracker-fusion/fusion.cpp
@@ -6,23 +6,24 @@
* notice appear in all copies.
*/
+#undef NDEBUG
+
#include "fusion.h"
#include "compat/library-path.hpp"
#include <QDebug>
#include <QMessageBox>
#include <QApplication>
+#include <cassert>
-static const QString own_name = QStringLiteral("fusion");
+static const char* own_name = "fusion";
static auto get_modules()
{
- return Modules(OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH);
+ return Modules(OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH, dylib_load_quiet);
}
-fusion_tracker::fusion_tracker()
-{
-}
+fusion_tracker::fusion_tracker() = default;
fusion_tracker::~fusion_tracker()
{
@@ -32,13 +33,6 @@ fusion_tracker::~fusion_tracker()
rot_dylib = nullptr;
pos_dylib = nullptr;
-
- if (other_frame)
- {
- if (other_frame->layout())
- delete other_frame->layout();
- other_frame = nullptr;
- }
}
const QString& fusion_tracker::caption()
@@ -110,7 +104,6 @@ module_status fusion_tracker::start_tracker(QFrame* frame)
if (frame->layout() == nullptr)
{
status = rot_tracker->start_tracker(frame);
- other_frame = nullptr;
if (!status.is_ok())
{
err = rot_dylib->name + QStringLiteral(":\n ") + status.error;
@@ -119,16 +112,10 @@ module_status fusion_tracker::start_tracker(QFrame* frame)
}
else
{
- other_frame->setVisible(false);
other_frame->setFixedSize(320, 240); // XXX magic frame size
+ other_frame->setVisible(false);
- rot_tracker->start_tracker(other_frame.get());
-
- if (other_frame->layout() == nullptr)
- other_frame = nullptr;
- else
- other_frame->hide();
-
+ rot_tracker->start_tracker(&*other_frame);
}
end:
@@ -159,8 +146,8 @@ fusion_dialog::fusion_dialog()
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
- ui.rot_tracker->addItem("");
- ui.pos_tracker->addItem("");
+ ui.rot_tracker->addItem({});
+ ui.pos_tracker->addItem({});
Modules libs = get_modules();
diff --git a/tracker-fusion/fusion.h b/tracker-fusion/fusion.h
index 6b0e0b1e..daadf27d 100644
--- a/tracker-fusion/fusion.h
+++ b/tracker-fusion/fusion.h
@@ -1,13 +1,16 @@
#pragma once
+
#include "api/plugin-api.hpp"
#include "api/plugin-support.hpp"
+#include "options/options.hpp"
+using namespace options;
+
+#include <memory>
+
#include <QObject>
#include <QFrame>
#include <QCoreApplication>
-#include "options/options.hpp"
-using namespace options;
-
struct fusion_settings final : opts
{
value<QVariant> rot_tracker_name, pos_tracker_name;
@@ -21,7 +24,7 @@ class fusion_tracker : public QObject, public ITracker
double rot_tracker_data[6] {}, pos_tracker_data[6] {};
- std::unique_ptr<QFrame> other_frame;
+ std::unique_ptr<QFrame> other_frame { std::make_unique<QFrame>() };
std::shared_ptr<dylib> rot_dylib, pos_dylib;
std::shared_ptr<ITracker> rot_tracker, pos_tracker;
@@ -51,8 +54,9 @@ private slots:
class fusion_metadata : public Metadata
{
-public:
- QString name() { return otr_tr("Fusion"); }
+ Q_OBJECT
+
+ QString name() { return tr("Fusion"); }
QIcon icon() { return QIcon(":/images/fusion-tracker-logo.png"); }
};
diff --git a/tracker-fusion/lang/de_DE.ts b/tracker-fusion/lang/de_DE.ts
new file mode 100644
index 00000000..3019b655
--- /dev/null
+++ b/tracker-fusion/lang/de_DE.ts
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="de_DE">
+<context>
+ <name>fusion_dialog</name>
+ <message>
+ <source>Fusion tracker only works when distinct trackers are selected for rotation and position.</source>
+ <translation>Der Fusion-Tracker funktioniert nur, wenn für Rotation und Position unterschiedliche Tracker ausgewählt wurden.</translation>
+ </message>
+</context>
+<context>
+ <name>fusion_metadata</name>
+ <message>
+ <source>Fusion</source>
+ <translation>Fusion</translation>
+ </message>
+</context>
+<context>
+ <name>fusion_tracker</name>
+ <message>
+ <source>Fusion tracker</source>
+ <translation>Fusion-Tracker</translation>
+ </message>
+ <message>
+ <source>Trackers not selected.</source>
+ <translation>Keine Tracker ausgewählt.</translation>
+ </message>
+ <message>
+ <source>Select different trackers for rotation and position.</source>
+ <translation>Wähle unterschiedliche Tracker für Rotation und Position.</translation>
+ </message>
+</context>
+<context>
+ <name>fusion_ui</name>
+ <message>
+ <source>Fusion</source>
+ <translation>Fusion</translation>
+ </message>
+ <message>
+ <source>Set distinct trackers for rotation and position input.</source>
+ <translation>Wähle unterschiedliche Tracker für Rotations- und Positionseingabe.</translation>
+ </message>
+ <message>
+ <source>Configure the trackers on the main window. It&apos;s required that they&apos;re both distinct, and both are set to something.</source>
+ <translation>Konfiguriere die Tracker im Hauptfenster. Es ist unbedingt erforderlich, dass zwei unterschiedliche Tracker ausgewählt werden, und beides zumindest irgendeinen Tracker auswählt.</translation>
+ </message>
+ <message>
+ <source>Rotation</source>
+ <translation>Rotation</translation>
+ </message>
+ <message>
+ <source>Position</source>
+ <translation>Position</translation>
+ </message>
+</context>
+</TS>
diff --git a/tracker-fusion/lang/nl_NL.ts b/tracker-fusion/lang/nl_NL.ts
index b19667b0..3ad3efec 100644
--- a/tracker-fusion/lang/nl_NL.ts
+++ b/tracker-fusion/lang/nl_NL.ts
@@ -9,6 +9,13 @@
</message>
</context>
<context>
+ <name>fusion_metadata</name>
+ <message>
+ <source>Fusion</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>fusion_tracker</name>
<message>
<source>Fusion tracker</source>
diff --git a/tracker-fusion/lang/ru_RU.ts b/tracker-fusion/lang/ru_RU.ts
index 1555f7ad..9453b167 100644
--- a/tracker-fusion/lang/ru_RU.ts
+++ b/tracker-fusion/lang/ru_RU.ts
@@ -9,6 +9,13 @@
</message>
</context>
<context>
+ <name>fusion_metadata</name>
+ <message>
+ <source>Fusion</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>fusion_tracker</name>
<message>
<source>Fusion tracker</source>
diff --git a/tracker-fusion/lang/stub.ts b/tracker-fusion/lang/stub.ts
index fd5cb84f..7aed6201 100644
--- a/tracker-fusion/lang/stub.ts
+++ b/tracker-fusion/lang/stub.ts
@@ -9,6 +9,13 @@
</message>
</context>
<context>
+ <name>fusion_metadata</name>
+ <message>
+ <source>Fusion</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>fusion_tracker</name>
<message>
<source>Fusion tracker</source>
diff --git a/tracker-fusion/lang/zh_CN.ts b/tracker-fusion/lang/zh_CN.ts
index fd5cb84f..e1345e4c 100644
--- a/tracker-fusion/lang/zh_CN.ts
+++ b/tracker-fusion/lang/zh_CN.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1">
+<TS version="2.1" language="zh_CN">
<context>
<name>fusion_dialog</name>
<message>
@@ -9,6 +9,13 @@
</message>
</context>
<context>
+ <name>fusion_metadata</name>
+ <message>
+ <source>Fusion</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>fusion_tracker</name>
<message>
<source>Fusion tracker</source>