summaryrefslogtreecommitdiffhomepage
path: root/proto-flightgear
diff options
context:
space:
mode:
Diffstat (limited to 'proto-flightgear')
-rw-r--r--proto-flightgear/ftnoir_protocol_fg.cpp6
-rw-r--r--proto-flightgear/ftnoir_protocol_fg.h20
-rw-r--r--proto-flightgear/ftnoir_protocol_fg_dialog.cpp8
-rw-r--r--proto-flightgear/lang/de_DE.ts37
-rw-r--r--proto-flightgear/lang/nl_NL.ts18
-rw-r--r--proto-flightgear/lang/ru_RU.ts18
-rw-r--r--proto-flightgear/lang/stub.ts18
-rw-r--r--proto-flightgear/lang/zh_CN.ts20
8 files changed, 129 insertions, 16 deletions
diff --git a/proto-flightgear/ftnoir_protocol_fg.cpp b/proto-flightgear/ftnoir_protocol_fg.cpp
index b36a2f47..d777d801 100644
--- a/proto-flightgear/ftnoir_protocol_fg.cpp
+++ b/proto-flightgear/ftnoir_protocol_fg.cpp
@@ -13,7 +13,7 @@
// For Todd and Arda Kutlu
-void flightgear::pose(const double* headpose) {
+void flightgear::pose(const double* headpose, const double*) {
FlightData.x = -headpose[TX] * 1e-2;
FlightData.y = headpose[TY] * 1e-2;
FlightData.z = headpose[TZ] * 1e-2;
@@ -22,7 +22,7 @@ void flightgear::pose(const double* headpose) {
FlightData.r = -headpose[Roll];
FlightData.status = 1;
QHostAddress destIP(quint32(s.ip1 << 24 | s.ip2 << 16 | s.ip3 << 8 | s.ip4));
- (void) outSocket.writeDatagram(reinterpret_cast<const char*>(&FlightData), sizeof(FlightData), destIP, static_cast<quint16>(s.port));
+ (void) outSocket.writeDatagram(reinterpret_cast<const char*>(&FlightData), sizeof(FlightData), destIP, quint16(s.port));
}
module_status flightgear::initialize()
@@ -30,7 +30,7 @@ module_status flightgear::initialize()
if (outSocket.bind(QHostAddress::Any, 0, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint))
return status_ok();
else
- return error(otr_tr("Can't bind to [%1.%2.%3.%4]:%5")
+ return error(tr("Can't bind to [%1.%2.%3.%4]:%5")
.arg(s.ip1).arg(s.ip2).arg(s.ip3).arg(s.ip4)
.arg(s.port));
}
diff --git a/proto-flightgear/ftnoir_protocol_fg.h b/proto-flightgear/ftnoir_protocol_fg.h
index f92c3072..3a08b546 100644
--- a/proto-flightgear/ftnoir_protocol_fg.h
+++ b/proto-flightgear/ftnoir_protocol_fg.h
@@ -15,6 +15,7 @@
#include <QMessageBox>
#include "api/plugin-api.hpp"
#include "options/options.hpp"
+#include "compat/tr.hpp"
using namespace options;
// x,y,z position in meters, heading, pitch and roll in degrees
@@ -38,11 +39,13 @@ struct settings : opts {
{}
};
-class flightgear : public IProtocol
+class flightgear : TR, public IProtocol
{
+ Q_OBJECT
+
public:
- void pose(const double *headpose);
- QString game_name() { return otr_tr("FlightGear"); }
+ void pose(const double *headpose, const double*) override;
+ QString game_name() override { return tr("FlightGear"); }
module_status initialize() override;
private:
settings s;
@@ -56,8 +59,8 @@ class FGControls: public IProtocolDialog
Q_OBJECT
public:
FGControls();
- void register_protocol(IProtocol *) {}
- void unregister_protocol() {}
+ void register_protocol(IProtocol *) override {}
+ void unregister_protocol() override {}
private:
Ui::UICFGControls ui;
settings s;
@@ -68,7 +71,8 @@ private slots:
class flightgearDll : public Metadata
{
-public:
- QString name() { return otr_tr("FlightGear"); }
- QIcon icon() { return QIcon(":/images/flightgear.png"); }
+ Q_OBJECT
+
+ QString name() override { return tr("FlightGear"); }
+ QIcon icon() override { return QIcon(":/images/flightgear.png"); }
};
diff --git a/proto-flightgear/ftnoir_protocol_fg_dialog.cpp b/proto-flightgear/ftnoir_protocol_fg_dialog.cpp
index f6f8e00d..d2098577 100644
--- a/proto-flightgear/ftnoir_protocol_fg_dialog.cpp
+++ b/proto-flightgear/ftnoir_protocol_fg_dialog.cpp
@@ -37,10 +37,10 @@ FGControls::FGControls()
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
connect(ui.buttonBox, &QDialogButtonBox::helpRequested,
- ui.buttonBox, []()
- {
- static const QString contrib_dir = "file:///" + QDir::toNativeSeparators(QStringLiteral("%1/%2/%3").
- arg(OPENTRACK_BASE_PATH, OPENTRACK_CONTRIB_PATH, "FlightGear"));
+ ui.buttonBox, [] {
+ static const QString contrib_dir =
+ "file:///" + QDir::toNativeSeparators(QStringLiteral("%1/%2/%3").
+ arg(OPENTRACK_BASE_PATH, OPENTRACK_CONTRIB_PATH, "FlightGear"));
QDesktopServices::openUrl(contrib_dir);
});
}
diff --git a/proto-flightgear/lang/de_DE.ts b/proto-flightgear/lang/de_DE.ts
new file mode 100644
index 00000000..436087bc
--- /dev/null
+++ b/proto-flightgear/lang/de_DE.ts
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="de_DE">
+<context>
+ <name>UICFGControls</name>
+ <message>
+ <source>FlightGear protocol settings</source>
+ <translation>FlightGear-Protokolleinstellungen</translation>
+ </message>
+ <message>
+ <source>IP address</source>
+ <translation>IP-Adresse</translation>
+ </message>
+ <message>
+ <source>Port</source>
+ <translation>Port</translation>
+ </message>
+</context>
+<context>
+ <name>flightgear</name>
+ <message>
+ <source>Can&apos;t bind to [%1.%2.%3.%4]:%5</source>
+ <translation>Konnte nicht an [%1.%2.%3.%4]:%5 binden</translation>
+ </message>
+ <message>
+ <source>FlightGear</source>
+ <translation>FlightGear</translation>
+ </message>
+</context>
+<context>
+ <name>flightgearDll</name>
+ <message>
+ <source>FlightGear</source>
+ <translation>FlightGear</translation>
+ </message>
+</context>
+</TS>
diff --git a/proto-flightgear/lang/nl_NL.ts b/proto-flightgear/lang/nl_NL.ts
index 18ffbe20..d8c3d3ec 100644
--- a/proto-flightgear/lang/nl_NL.ts
+++ b/proto-flightgear/lang/nl_NL.ts
@@ -16,4 +16,22 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>flightgear</name>
+ <message>
+ <source>Can&apos;t bind to [%1.%2.%3.%4]:%5</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>FlightGear</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>flightgearDll</name>
+ <message>
+ <source>FlightGear</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/proto-flightgear/lang/ru_RU.ts b/proto-flightgear/lang/ru_RU.ts
index b97f008d..c204410d 100644
--- a/proto-flightgear/lang/ru_RU.ts
+++ b/proto-flightgear/lang/ru_RU.ts
@@ -16,4 +16,22 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>flightgear</name>
+ <message>
+ <source>Can&apos;t bind to [%1.%2.%3.%4]:%5</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>FlightGear</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>flightgearDll</name>
+ <message>
+ <source>FlightGear</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/proto-flightgear/lang/stub.ts b/proto-flightgear/lang/stub.ts
index 688104c8..dc093c57 100644
--- a/proto-flightgear/lang/stub.ts
+++ b/proto-flightgear/lang/stub.ts
@@ -16,4 +16,22 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>flightgear</name>
+ <message>
+ <source>Can&apos;t bind to [%1.%2.%3.%4]:%5</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>FlightGear</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>flightgearDll</name>
+ <message>
+ <source>FlightGear</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/proto-flightgear/lang/zh_CN.ts b/proto-flightgear/lang/zh_CN.ts
index 688104c8..ba70f8a0 100644
--- a/proto-flightgear/lang/zh_CN.ts
+++ b/proto-flightgear/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>UICFGControls</name>
<message>
@@ -16,4 +16,22 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>flightgear</name>
+ <message>
+ <source>Can&apos;t bind to [%1.%2.%3.%4]:%5</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>FlightGear</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>flightgearDll</name>
+ <message>
+ <source>FlightGear</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>