Commit 4613a4a2 authored by SIELA1915's avatar SIELA1915

added bin for Windows and some improvements

parent 69322a6b
QMAKE_XCODE_DEVELOPER_PATH = /Applications/Xcode.app/Contents/Developer
QMAKE_XCODE_VERSION = 7.3
QMAKE_MAC_SDK.macosx.path = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
QMAKE_MAC_SDK.macosx.platform_path = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
QMAKE_MAC_SDK.macosx.version = 10.11
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_CXX = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_FIX_RPATH = \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool \
-id
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_AR = \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar \
cq
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_RANLIB = \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib \
-s
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_LINK = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_LINK_SHLIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
QMAKE_MAC_SDK.macosx.platform_name = macosx
......@@ -40,3 +40,6 @@ HEADERS += \
FORMS += \
settings.ui \
mainwindow.ui
TRANSLATIONS = rt_en.ts \
rt_de.ts
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.6.0, 2016-05-28T01:14:24. -->
<!-- Written by QtCreator 3.6.0, 2016-05-29T23:37:12. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
......
This diff is collapsed.
This diff is collapsed.
......@@ -22,10 +22,23 @@
#include "mainwindow.h"
#include <QApplication>
#include <QTranslator>
#include <QLibraryInfo>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTranslator qtTranslator;
qtTranslator.load("qt_" + QLocale::system().name(),
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
a.installTranslator(&qtTranslator);
QTranslator myappTranslator;
// myappTranslator.load("rt_" + QLocale::system().name());
myappTranslator.load("rt_de");
a.installTranslator(&myappTranslator);
MainWindow w;
w.show();
......
......@@ -59,15 +59,17 @@ MainWindow::MainWindow(QWidget *parent) :
destLang = settings.value("lang", 0).toInt();
QList<QVariant> chanDef({1, 1, 0, 1, 0, 0, 0, 0, 0, 0});
QList<QVariant> chanDef({1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0});
selChannels = settings.value("channels", QVariant::fromValue(chanDef)).toList();
oldChannels = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
channelNames = {tr("Around"), tr("Region"), tr("Team"), tr("Universe"), tr("Guild"), tr("Dynamic 1"), tr("Dynamic 2"), tr("Dynamic 3"), tr("Dynamic 4"), tr("Dynamic 5")};
if (selChannels.size() != MAX_CHAN) selChannels = chanDef;
oldChannels = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
channelNames = {tr("Around"), tr("Region"), tr("Team"), tr("Universe"), tr("Guild"), tr("User"), tr("Dynamic 0"), tr("Dynamic 1"), tr("Dynamic 2"), tr("Dynamic 3"), tr("Dynamic 4"), tr("Dynamic 5")};
Q_ASSERT(channelNames.size() == MAX_CHAN);
// QSignalMapper *mapper = new QSignalMapper(this);
for (int i = 0; i < 10; ++i) {
for (int i = 0; i < channelNames.size(); ++i) {
tabs.append(new QPushButton(channelNames[i], this));
tabs[i]->setVisible(false);
tabs[i]->setCheckable(true);
......@@ -145,7 +147,7 @@ void MainWindow::pinWindow(bool p)
void MainWindow::openSettings()
{
qInfo("Opacity before: %i", opacity);
Settings *setting = new Settings(0, selChannels, destLang, opacity, logLoc);
Settings *setting = new Settings(selChannels, this, destLang, opacity, logLoc);
if (setting->exec()) {
oldChannels = selChannels;
selChannels = setting->channels;
......@@ -222,8 +224,8 @@ QString MainWindow::translateTo(QString *lang, QString *text) {
}
else {
//failure
qDebug() << "Failure" <<reply->errorString();
return reply->errorString();
qDebug() << "Failure" << reply->errorString();
return "Couldn't reach Yandex.Translate because of " + reply->errorString() + "\n";
}
}
......@@ -260,7 +262,7 @@ void MainWindow::updateText(int b, bool c, int lines) {
tempLastLine = line;
if (lineLength != -1 && (append || (lines == 100))) {
QString sec = line.section(' ', 2, 2);
if (sec == "(" + channelCodes[b] + ")") {
if (sec == "(" + channelCodes[b] + ")" || channelCodes[b] == "") {
// qInfo("found line: %s", line.toStdString().c_str());
QString translated = translateTo(&languageCodes[destLang], &line);
filteredLog += translated;
......
......@@ -32,6 +32,8 @@
#include "settings.h"
#define MAX_CHAN 12
namespace Ui {
class MainWindow;
}
......@@ -66,7 +68,7 @@ private:
QList<QPushButton*> tabs;
QButtonGroup *actTabs;
QList<QString> channelNames;
QString channelCodes[10] = {"SAY", "REGION", "TEAM", "UNIVERSE", "GUILD", "DYN1", "DYN2", "DYN3", "DYN4", "DYN5"};
QString channelCodes[MAX_CHAN] = {"SAY", "REGION", "TEAM", "UNIVERSE", "GUILD", "", "DYN0", "DYN1", "DYN2", "DYN3", "DYN4", "DYN5"};
QString languages[5] = {"English", "German", "French", "Spanish", "Russian"};
QString languageCodes[5] = {"en", "de", "fr", "es", "ru"};
int destLang;
......
File added
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="de" sourcelanguage="en">
<context>
<name>MainWindow</name>
<message>
<location filename="mainwindow.ui" line="35"/>
<source>Rift-Translation</source>
<translation>Rift-Translation</translation>
</message>
<message>
<location filename="mainwindow.ui" line="48"/>
<source>TextLabel</source>
<translation>TextLabel</translation>
</message>
<message>
<location filename="mainwindow.ui" line="66"/>
<source>About</source>
<translation>Über</translation>
</message>
<message>
<location filename="mainwindow.ui" line="71"/>
<source>About Qt</source>
<translation>Über Qt</translation>
</message>
<message>
<location filename="mainwindow.ui" line="76"/>
<source>Settings...</source>
<translation>Einstellungen...</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="39"/>
<source>&amp;Help</source>
<translation>&amp;Hilfe</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="40"/>
<source>&amp;About</source>
<translation>&amp;Über</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="42"/>
<source>About &amp;QT</source>
<translation>Über &amp;Qt</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="44"/>
<source>&amp;Settings</source>
<translation>&amp;Einstellungen</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="46"/>
<source>&amp;Pin Window</source>
<translation>Fenster &amp;Pinnen</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="53"/>
<source>&amp;Window</source>
<translation>&amp;Fenster</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Around</source>
<translation>Umgebung</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Region</source>
<translation>Region</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Team</source>
<translation>Team</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Universe</source>
<translation>Universum</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Guild</source>
<translation>Gilde</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 1</source>
<translation>Dynamisch 1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 2</source>
<translation>Dynamisch 2</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 3</source>
<translation>Dynamisch 3</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 4</source>
<translation>Dynamisch 4</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 5</source>
<translation>Dynamisch 5</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>User</source>
<translation>User</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 0</source>
<translation>Dynamisch 0</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="125"/>
<source>About Rift-Translation</source>
<translation>Über Rift-Translation</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="126"/>
<source>The &lt;b&gt;Rift-Translator&lt;/b&gt; is a tool to translate Chat channels in Ryzom live.Powered by Yandex.Translate:</source>
<translation>&lt;b&gt;Rift-Translation&lt;/b&gt; ist ein Werkzeug um Chat Kanäle in Ryzom live zu übersetzen.Powered by Yandex.Translate:</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="185"/>
<source>Translating to </source>
<translation>Übersetzen zu </translation>
</message>
<message>
<location filename="mainwindow.cpp" line="185"/>
<source> Powered by Yandex.Translate: </source>
<translation> Powered by Yandex.Translate: </translation>
</message>
</context>
<context>
<name>Settings</name>
<message>
<location filename="settings.ui" line="17"/>
<source>Dialog</source>
<translation>Dialog</translation>
</message>
<message>
<location filename="settings.ui" line="50"/>
<source>Select language
to translate to:</source>
<translation>Ziel-Sprache
auswählen:</translation>
</message>
<message>
<location filename="settings.ui" line="62"/>
<source>English</source>
<translation>Englisch</translation>
</message>
<message>
<location filename="settings.ui" line="67"/>
<source>German</source>
<translation>Deutsch</translation>
</message>
<message>
<location filename="settings.ui" line="72"/>
<source>French</source>
<translation>Französisch</translation>
</message>
<message>
<location filename="settings.ui" line="77"/>
<source>Spanish</source>
<translation>Spanisch</translation>
</message>
<message>
<location filename="settings.ui" line="82"/>
<source>Russian</source>
<translation>Russisch</translation>
</message>
<message>
<location filename="settings.ui" line="112"/>
<source>Change log location</source>
<translation>Ort des Logs ändern</translation>
</message>
<message>
<location filename="settings.ui" line="123"/>
<source>Around</source>
<translation>Umgebung</translation>
</message>
<message>
<location filename="settings.ui" line="130"/>
<source>Dynamic 0</source>
<translation>Dynamisch 0</translation>
</message>
<message>
<location filename="settings.ui" line="144"/>
<source>Dynamic 1</source>
<translation>Dynamisch 1</translation>
</message>
<message>
<location filename="settings.ui" line="137"/>
<source>Region</source>
<translation>Region</translation>
</message>
<message>
<location filename="settings.ui" line="158"/>
<source>Dynamic 2</source>
<translation>Dynamisch 2</translation>
</message>
<message>
<location filename="settings.ui" line="151"/>
<source>Team</source>
<translation>Team</translation>
</message>
<message>
<location filename="settings.ui" line="172"/>
<source>Dynamic 3</source>
<translation>Dynamisch 3</translation>
</message>
<message>
<location filename="settings.ui" line="165"/>
<source>Universe</source>
<translation>Universum</translation>
</message>
<message>
<location filename="settings.ui" line="186"/>
<source>Dynamic 4</source>
<translation>Dynamisch 4</translation>
</message>
<message>
<location filename="settings.ui" line="179"/>
<source>Guild</source>
<translation>Gilde</translation>
</message>
<message>
<location filename="settings.ui" line="193"/>
<source>User</source>
<translation>User</translation>
</message>
<message>
<location filename="settings.ui" line="200"/>
<source>Dynamic 5</source>
<translation>Dynamisch 5</translation>
</message>
<message>
<location filename="settings.cpp" line="96"/>
<source>Open Chat Log File</source>
<translation>Chat Log Dokument öffnen</translation>
</message>
<message>
<location filename="settings.cpp" line="96"/>
<source>TXT Files (*.txt)</source>
<translation>TXT Dokumente (*.txt)</translation>
</message>
</context>
</TS>
File added
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en">
<context>
<name>MainWindow</name>
<message>
<location filename="mainwindow.ui" line="35"/>
<source>Rift-Translation</source>
<translation>Rift-Translation</translation>
</message>
<message>
<location filename="mainwindow.ui" line="48"/>
<source>TextLabel</source>
<translation>TextLabel</translation>
</message>
<message>
<location filename="mainwindow.ui" line="66"/>
<source>About</source>
<translation>About</translation>
</message>
<message>
<location filename="mainwindow.ui" line="71"/>
<source>About Qt</source>
<translation>About Qt</translation>
</message>
<message>
<location filename="mainwindow.ui" line="76"/>
<source>Settings...</source>
<translation>Preferences...</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="39"/>
<source>&amp;Help</source>
<translation>&amp;Help</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="40"/>
<source>&amp;About</source>
<translation>&amp;About</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="42"/>
<source>About &amp;QT</source>
<translation>About &amp;QT</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="44"/>
<source>&amp;Settings</source>
<translation>&amp;Preferences</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="46"/>
<source>&amp;Pin Window</source>
<translation>&amp;Pin Window</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="53"/>
<source>&amp;Window</source>
<translation>&amp;Window</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Around</source>
<translation>Around</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Region</source>
<translation>Region</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Team</source>
<translation>Team</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Universe</source>
<translation>Universe</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Guild</source>
<translation>Guild</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 1</source>
<translation>Dynamic 1</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 2</source>
<translation>Dynamic 2</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 3</source>
<translation>Dynamic 3</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 4</source>
<translation>Dynamic 4</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 5</source>
<translation>Dynamic 5</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>User</source>
<translation>User</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="67"/>
<source>Dynamic 0</source>
<translation>Dynamic 0</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="125"/>
<source>About Rift-Translation</source>
<translation>About Rift-Translation</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="126"/>
<source>The &lt;b&gt;Rift-Translator&lt;/b&gt; is a tool to translate Chat channels in Ryzom live.Powered by Yandex.Translate:</source>
<translation>&lt;b&gt;Rift-Translation&lt;/b&gt; is a tool to translate Chat channels in Ryzom live.Powered by Yandex.Translate:</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="185"/>
<source>Translating to </source>
<translation>Translating to </translation>
</message>
<message>
<location filename="mainwindow.cpp" line="185"/>
<source> Powered by Yandex.Translate: </source>
<translation> Powered by Yandex.Translate: </translation>
</message>
</context>
<context>
<name>Settings</name>
<message>
<location filename="settings.ui" line="17"/>
<source>Dialog</source>
<translation>Dialog</translation>
</message>
<message>
<location filename="settings.ui" line="50"/>
<source>Select language
to translate to:</source>
<translation>Select language
to translate to:</translation>
</message>
<message>
<location filename="settings.ui" line="62"/>
<source>English</source>
<translation>English</translation>
</message>
<message>
<location filename="settings.ui" line="67"/>
<source>German</source>
<translation>German</translation>
</message>
<message>
<location filename="settings.ui" line="72"/>
<source>French</source>
<translation>French</translation>
</message>
<message>
<location filename="settings.ui" line="77"/>
<source>Spanish</source>
<translation>Spanish</translation>
</message>
<message>
<location filename="settings.ui" line="82"/>
<source>Russian</source>
<translation>Russian</translation>
</message>
<message>
<location filename="settings.ui" line="112"/>
<source>Change log location</source>
<translation>Change log location</translation>
</message>
<message>
<location filename="settings.ui" line="123"/>
<source>Around</source>