added language change, translation files updated

This commit is contained in:
Rafael 2016-04-14 01:27:29 +02:00
parent c9eea52af7
commit dcb95f5c77
20 changed files with 703 additions and 375 deletions

View File

@ -17,7 +17,9 @@
*****************************************************************************/
#define _CRT_SECURE_NO_WARNINGS
#include "config.h"
#include "AppEnv.h"
#include "StringParser.h"
#include "StandardPaths.h"
#include <QDir>
#include <QDebug>
@ -30,6 +32,8 @@ AppEnv::AppEnv()
}
// Folder Stuff
QString AppEnv::getGameFolder(bool *ok)
{
QDir dir;
@ -104,3 +108,25 @@ bool AppEnv::setGameFolder(QString gameFolder)
}
return false;
}
QString AppEnv::getLangFolder()
{
return StringParser::convertBuildedString(QString::fromUtf8(GTA5SYNC_LANG));
}
QString AppEnv::getPluginsFolder()
{
return StringParser::convertBuildedString(QString::fromUtf8(GTA5SYNC_PLUG));
}
// Web Stuff
QByteArray AppEnv::getUserAgent()
{
return QString("Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 gta5sync/1.0").toUtf8();
}
QUrl AppEnv::getPlayerFetchingUrl(QString crewID, QString pageNumber)
{
return QUrl(QString("https://socialclub.rockstargames.com/crewsapi/GetMembersList?crewId=%1&pageNumber=%2").arg(crewID, pageNumber));
}

View File

@ -20,13 +20,22 @@
#define APPENV_H
#include <QString>
#include <QUrl>
class AppEnv
{
public:
AppEnv();
// Folder Stuff
static QString getGameFolder(bool *ok = 0);
static bool setGameFolder(QString gameFolder);
static QString getLangFolder();
static QString getPluginsFolder();
// Web Stuff
static QByteArray getUserAgent();
static QUrl getPlayerFetchingUrl(QString crewID, QString pageNumber);
};
#endif // APPENV_H

View File

@ -18,6 +18,7 @@
#include "StandardPaths.h"
#include "CrewDatabase.h"
#include "config.h"
#include <QFile>
#include <QDir>
@ -29,7 +30,7 @@ CrewDatabase::CrewDatabase(QObject *parent) : QObject(parent)
QString dirPath = dir.absolutePath();
QString defaultConfPath = dirPath + QDir::separator() + "crews.ini";
QSettings confPathSettings("Syping","gta5sync");
QSettings confPathSettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
confPathSettings.beginGroup("Database");
QString confPathFile = confPathSettings.value("Crews", defaultConfPath).toString();
confPathSettings.endGroup();

View File

@ -18,6 +18,7 @@
#include "DatabaseThread.h"
#include "CrewDatabase.h"
#include "AppEnv.h"
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
@ -85,20 +86,19 @@ void DatabaseThread::scanCrewMembersList(QStringList crewList, int maxPages, int
{
QNetworkAccessManager *netManager = new QNetworkAccessManager();
QString memberListUrl = "https://socialclub.rockstargames.com/crewsapi/GetMembersList?crewId=" + crewID + "&pageNumber=" + QString::number(currentPage);
QNetworkRequest netRequest(memberListUrl);
netRequest.setRawHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 gta5sync/1.0");
QNetworkRequest netRequest(AppEnv::getPlayerFetchingUrl(crewID, QString::number(currentPage)));
netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent());
netRequest.setRawHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
netRequest.setRawHeader("Accept-Language", "en-US;q=0.5,en;q=0.3");
netRequest.setRawHeader("Connection", "keep-alive");
QNetworkReply *netReply = netManager->get(netRequest);
QEventLoop downloadLoop;
QObject::connect(netReply, SIGNAL(finished()), &downloadLoop, SLOT(quit()));
QTimer::singleShot(30000, &downloadLoop, SLOT(quit()));
downloadLoop.exec();
QEventLoop *downloadLoop = new QEventLoop();
QObject::connect(netReply, SIGNAL(finished()), downloadLoop, SLOT(quit()));
QTimer::singleShot(30000, downloadLoop, SLOT(quit()));
downloadLoop->exec();
delete downloadLoop;
if (netReply->isFinished())
{
@ -128,9 +128,10 @@ void DatabaseThread::scanCrewMembersList(QStringList crewList, int maxPages, int
}
}
QEventLoop waitingLoop;
QTimer::singleShot(requestDelay, &waitingLoop, SLOT(quit()));
waitingLoop.exec();
QEventLoop *waitingLoop = new QEventLoop();
QTimer::singleShot(requestDelay, waitingLoop, SLOT(quit()));
waitingLoop->exec();
delete waitingLoop;
currentPage++;
}

View File

@ -18,15 +18,119 @@
#include "OptionsDialog.h"
#include "ui_OptionsDialog.h"
#include "AppEnv.h"
#include "config.h"
#include <QMessageBox>
#include <QStringList>
#include <QLocale>
#include <QString>
#include <QDebug>
#include <QList>
#include <QDir>
OptionsDialog::OptionsDialog(QWidget *parent) :
QDialog(parent),
OptionsDialog::OptionsDialog(ProfileDatabase *profileDB, QWidget *parent) :
QDialog(parent), profileDB(profileDB),
ui(new Ui::OptionsDialog)
{
ui->setupUi(this);
setupTreeWidget();
setupLanguageBox();
}
OptionsDialog::~OptionsDialog()
{
foreach(QTreeWidgetItem *playerItem, playerItems)
{
delete playerItem;
}
delete ui;
}
void OptionsDialog::setupTreeWidget()
{
foreach(const QString &playerIDStr, profileDB->getPlayers())
{
bool ok;
int playerID = playerIDStr.toInt(&ok);
if (ok)
{
QString playerName = profileDB->getPlayerName(playerID);
QStringList playerTreeViewList;
playerTreeViewList << playerIDStr;
playerTreeViewList << playerName;
QTreeWidgetItem *playerItem = new QTreeWidgetItem(playerTreeViewList);
ui->twPlayers->addTopLevelItem(playerItem);
playerItems.append(playerItem);
}
}
ui->twPlayers->sortItems(1, Qt::AscendingOrder);
}
void OptionsDialog::setupLanguageBox()
{
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
settings.beginGroup("Interface");
currentLanguage = settings.value("Language","System").toString();
settings.endGroup();
QString cbSysStr = tr("%1 (%2 if available) [sys]", "System like PC System = %1, System Language like Deutsch = %2").arg(tr("System",
"System like PC System"), QLocale::system().nativeLanguageName());
ui->cbLanguage->addItem(cbSysStr, "System");
QString cbEngStr = "English (English) [en]";
ui->cbLanguage->addItem(QIcon::fromTheme("flag-us"), cbEngStr, "en");
if (currentLanguage == "en")
{
ui->cbLanguage->setCurrentText(cbEngStr);
}
QDir langDir;
langDir.setNameFilters(QStringList("gta5sync_*.qm"));
langDir.setPath(AppEnv::getLangFolder());
QStringList langFiles;
langFiles << langDir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::NoSort);
langDir.setPath(":/tr");
langFiles << langDir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::NoSort);
langFiles.removeDuplicates();
foreach(const QString &langFile, langFiles)
{
QString lang = langFile;
lang.remove("gta5sync_");
lang.remove(".qm");
QLocale langLocale(lang);
QString languageNameInternational = QLocale::languageToString(langLocale.language());
QString languageNameNative = langLocale.nativeLanguageName();
QString cbLangStr = languageNameNative + " (" + languageNameInternational + ") [" + lang + "]";
QString langIconStr = "flag-" + lang;
ui->cbLanguage->addItem(QIcon::fromTheme(langIconStr), cbLangStr, lang);
if (currentLanguage == lang)
{
ui->cbLanguage->setCurrentText(cbLangStr);
}
}
}
void OptionsDialog::on_cmdOK_clicked()
{
applySettings();
close();
}
void OptionsDialog::applySettings()
{
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
settings.beginGroup("Interface");
settings.setValue("Language", ui->cbLanguage->currentData());
settings.endGroup();
if (ui->cbLanguage->currentData().toString() != currentLanguage)
{
QMessageBox::information(this, tr("%1", "%1").arg(GTA5SYNC_APPSTR), tr("The language change will take effect after you restart %1.").arg(GTA5SYNC_APPSTR));
}
}

View File

@ -1,4 +1,4 @@
/*****************************************************************************
/******************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping
*
@ -19,7 +19,10 @@
#ifndef OPTIONSDIALOG_H
#define OPTIONSDIALOG_H
#include <QList>
#include <QDialog>
#include <QTreeWidgetItem>
#include "ProfileDatabase.h"
namespace Ui {
class OptionsDialog;
@ -30,11 +33,20 @@ class OptionsDialog : public QDialog
Q_OBJECT
public:
explicit OptionsDialog(QWidget *parent = 0);
explicit OptionsDialog(ProfileDatabase *profileDB, QWidget *parent = 0);
~OptionsDialog();
private slots:
void on_cmdOK_clicked();
private:
ProfileDatabase *profileDB;
Ui::OptionsDialog *ui;
QList<QTreeWidgetItem*> playerItems;
QString currentLanguage;
void setupTreeWidget();
void setupLanguageBox();
void applySettings();
};
#endif // OPTIONSDIALOG_H

View File

@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>gta5sync - Options</string>
<string>gta5sync - Settings</string>
</property>
<property name="modal">
<bool>true</bool>
@ -75,9 +75,54 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabPlayers">
<attribute name="title">
<string>Players</string>
</attribute>
<layout class="QVBoxLayout" name="vlPlayers">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTreeWidget" name="twPlayers">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>ID</string>
</property>
</column>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabLocalization">
<attribute name="title">
<string>Localization</string>
<string>Language</string>
</attribute>
<layout class="QVBoxLayout" name="vlLocalization">
<item>
@ -87,13 +132,7 @@
</property>
<layout class="QVBoxLayout" name="vlLanguage">
<item>
<widget class="QComboBox" name="cbLanguage">
<item>
<property name="text">
<string>System</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="cbLanguage"/>
</item>
</layout>
</widget>

View File

@ -19,6 +19,7 @@
#include "PictureExport.h"
#include "PictureDialog.h"
#include "SidebarGenerator.h"
#include "config.h"
#include <QMessageBox>
#include <QFileDialog>
#include <QSettings>
@ -30,7 +31,7 @@ PictureExport::PictureExport()
void PictureExport::exportPicture(QWidget *parent, SnapmaticPicture *picture)
{
QSettings settings("Syping", "gta5sync");
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
settings.beginGroup("FileDialogs");
fileDialogPreSave:

View File

@ -18,6 +18,7 @@
#include "ProfileDatabase.h"
#include "StandardPaths.h"
#include "config.h"
#include <QFile>
#include <QDir>
@ -29,7 +30,7 @@ ProfileDatabase::ProfileDatabase(QObject *parent) : QObject(parent)
QString dirPath = dir.absolutePath();
QString defaultConfPath = dirPath + QDir::separator() + "players.ini";
QSettings confPathSettings("Syping","gta5sync");
QSettings confPathSettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
confPathSettings.beginGroup("Database");
QString confPathFile = confPathSettings.value("Players", defaultConfPath).toString();
confPathSettings.endGroup();

View File

@ -27,6 +27,7 @@
#include "StandardPaths.h"
#include "ProfileLoader.h"
#include "ExportThread.h"
#include "config.h"
#include <QProgressDialog>
#include <QProgressBar>
#include <QInputDialog>
@ -339,7 +340,7 @@ void ProfileInterface::on_cmdCloseProfile_clicked()
void ProfileInterface::on_cmdImport_clicked()
{
QSettings settings("Syping", "gta5sync");
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
settings.beginGroup("FileDialogs");
fileDialogPreOpen:

View File

@ -19,6 +19,7 @@
#include "SidebarGenerator.h"
#include "SavegameWidget.h"
#include "SavegameCopy.h"
#include "config.h"
#include <QMessageBox>
#include <QFileDialog>
#include <QSettings>
@ -30,7 +31,7 @@ SavegameCopy::SavegameCopy()
void SavegameCopy::copySavegame(QWidget *parent, QString sgdPath)
{
QSettings settings("Syping", "gta5sync");
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
settings.beginGroup("FileDialogs");
fileDialogPreSave:

View File

@ -17,10 +17,14 @@
*****************************************************************************/
#include "StringParser.h"
#include "config.h"
#include <QApplication>
#include <QTextCodec>
#include <QByteArray>
#include <QFileInfo>
#include <QString>
#include <QList>
#include <QDir>
StringParser::StringParser()
{
@ -46,3 +50,12 @@ QString StringParser::convertLogStringForDraw(const QString &inputStr)
QString outputStr = inputStr;
return outputStr.replace("&c;",",").replace("&u;","&");
}
QString StringParser::convertBuildedString(const QString &buildedStr)
{
QString outputStr = buildedStr;
outputStr.replace("$SEPARATOR", QDir::separator());
outputStr.replace("$SHAREDIR", QString::fromUtf8(GTA5SYNC_SHARE));
outputStr.replace("$RUNDIR", QFileInfo(qApp->applicationFilePath()).absoluteDir().absolutePath());
return outputStr;
}

View File

@ -29,6 +29,7 @@ public:
static QString parseTitleString(const QByteArray &commitBytes, int maxLength);
static QString convertDrawStringForLog(const QString &inputStr);
static QString convertLogStringForDraw(const QString &inputStr);
static QString convertBuildedString(const QString &buildedStr);
};
#endif // STRINGPARSER_H

View File

@ -24,6 +24,7 @@
#include "AboutDialog.h"
#include "IconLoader.h"
#include "AppEnv.h"
#include "config.h"
#include <QFileDialog>
#include <QHBoxLayout>
#include <QSpacerItem>
@ -45,7 +46,7 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, D
profileOpen = 0;
profileUI = 0;
ui->menuProfile->setEnabled(false);
defaultWindowTitle = this->windowTitle();
defaultWindowTitle = tr("gta5sync - %1");
this->setWindowTitle(defaultWindowTitle.arg(tr("Select Profile")));
}
@ -70,7 +71,7 @@ void UserInterface::setupDirEnv()
}
// profiles init
QSettings SyncSettings("Syping", "gta5sync");
QSettings SyncSettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
SyncSettings.beginGroup("Profile");
QString defaultProfile = SyncSettings.value("Default", "").toString();
@ -242,7 +243,7 @@ void UserInterface::on_actionDelete_selected_triggered()
void UserInterface::on_actionOptions_triggered()
{
OptionsDialog *optionsDialog = new OptionsDialog(this);
OptionsDialog *optionsDialog = new OptionsDialog(profileDB, this);
optionsDialog->setWindowFlags(optionsDialog->windowFlags()^Qt::WindowContextHelpButtonHint);
optionsDialog->setModal(true);
optionsDialog->show();

View File

@ -128,7 +128,7 @@
<x>0</x>
<y>0</y>
<width>625</width>
<height>25</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -192,7 +192,7 @@
</action>
<action name="actionOptions">
<property name="text">
<string>&amp;Options</string>
<string>&amp;Settings</string>
</property>
<property name="shortcut">
<string>Ctrl+O</string>

50
config.h Executable file
View File

@ -0,0 +1,50 @@
/*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef CONFIG_H
#define CONFIG_H
#ifndef GTA5SYNC_APPVENDOR
#define GTA5SYNC_APPVENDOR "Syping"
#endif
#ifndef GTA5SYNC_APPSTR
#define GTA5SYNC_APPSTR "gta5sync"
#endif
#ifndef GTA5SYNC_APPVER
#define GTA5SYNC_APPVER "1.0.0"
#endif
#ifndef GTA5SYNC_BUILDTYPE
#define GTA5SYNC_BUILDTYPE "Custom"
#endif
#ifndef GTA5SYNC_SHARE
#define GTA5SYNC_SHARE "$RUNDIR"
#endif
#ifndef GTA5SYNC_LANG
#define GTA5SYNC_LANG "$SHAREDIR$SEPARATORlang"
#endif
#ifndef GTA5SYNC_PLUG
#define GTA5SYNC_PLUG "$RUNDIR$SEPARATORplugins"
#endif
#endif // CONFIG_H

View File

@ -1,146 +1,147 @@
#/*****************************************************************************
#* gta5sync GRAND THEFT AUTO V SYNC
#* Copyright (C) 2015-2016 Syping
#*
#* This program is free software: you can redistribute it and/or modify
#* it under the terms of the GNU General Public License as published by
#* the Free Software Foundation, either version 3 of the License, or
#* (at your option) any later version.
#*
#* This program is distributed in the hope that it will be useful,
#* but WITHOUT ANY WARRANTY; without even the implied warranty of
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#* GNU General Public License for more details.
#*
#* You should have received a copy of the GNU General Public License
#* along with this program. If not, see <http://www.gnu.org/licenses/>.
#*****************************************************************************/
QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = gta5sync
TEMPLATE = app
SOURCES += main.cpp \
AboutDialog.cpp \
AppEnv.cpp \
CrewDatabase.cpp \
DatabaseThread.cpp \
ExportThread.cpp \
IconLoader.cpp \
OptionsDialog.cpp \
PictureCopy.cpp \
PictureDialog.cpp \
PictureExport.cpp \
PictureWidget.cpp \
ProfileDatabase.cpp \
ProfileInterface.cpp \
ProfileLoader.cpp \
ProfileWidget.cpp \
SavegameCopy.cpp \
SavegameData.cpp \
SavegameDialog.cpp \
SavegameWidget.cpp \
SidebarGenerator.cpp \
SnapmaticPicture.cpp \
SnapmaticWidget.cpp \
StandardPaths.cpp \
StringParser.cpp \
UserInterface.cpp \
uimod/UiModLabel.cpp
HEADERS += \
AboutDialog.h \
AppEnv.h \
CrewDatabase.h \
DatabaseThread.h \
ExportThread.h \
IconLoader.h \
OptionsDialog.h \
PictureCopy.h \
PictureDialog.h \
PictureExport.h \
PictureWidget.h \
ProfileDatabase.h \
ProfileInterface.h \
ProfileLoader.h \
ProfileWidget.h \
SavegameCopy.h \
SavegameData.h \
SavegameDialog.h \
SavegameWidget.h \
SidebarGenerator.h \
SnapmaticPicture.h \
SnapmaticWidget.h \
StandardPaths.h \
StringParser.h \
UserInterface.h \
uimod/UiModLabel.h
FORMS += \
AboutDialog.ui \
OptionsDialog.ui \
PictureDialog.ui \
ProfileInterface.ui \
SavegameDialog.ui \
SavegameWidget.ui \
SnapmaticWidget.ui \
UserInterface.ui
TRANSLATIONS += \
res/gta5sync_de.ts \
lang/gta5sync_ru.ts
RESOURCES += \
res/app.qrc
DISTFILES += res/app.rc \
res/gta5sync.desktop \
res/gta5sync_de.ts \
lang/gta5sync_ru.qm \
lang/qtbase_ru.qm \
lang/README.txt \
lang/gta5sync_ru.ts \
lang/qt_ru.qm
INCLUDEPATH += ./uimod
# WINDOWS ONLY
win32: DEFINES += GTA5SYNC_WIN
win32: RC_FILE += res/app.rc
win32: LIBS += -luser32
# QT4 ONLY STUFF
isEqual(QT_MAJOR_VERSION, 4): INCLUDEPATH += ./qjson4
isEqual(QT_MAJOR_VERSION, 4): HEADERS += qjson4/QJsonArray.h \
qjson4/QJsonDocument.h \
qjson4/QJsonObject.h \
qjson4/QJsonParseError.h \
qjson4/QJsonValue.h \
qjson4/QJsonValueRef.h \
qjson4/QJsonParser.h \
qjson4/QJsonRoot.h
isEqual(QT_MAJOR_VERSION, 4): SOURCES += qjson4/QJsonArray.cpp \
qjson4/QJsonDocument.cpp \
qjson4/QJsonObject.cpp \
qjson4/QJsonParseError.cpp \
qjson4/QJsonValue.cpp \
qjson4/QJsonValueRef.cpp \
qjson4/QJsonParser.cpp
# UNIX SYSTEM STUFF
unix: !macx: appfiles.path = $$(INSTALL_PATH)/share/applications
unix: !macx: appfiles.files = $$PWD/res/gta5sync.desktop
unix: !macx: pixmaps.path = $$(INSTALL_PATH)/share/pixmaps
unix: !macx: pixmaps.files = $$PWD/res/gta5sync.xpm
unix: !macx: target.path = $$(INSTALL_PATH)/bin
unix: !macx: INSTALLS += target pixmaps appfiles
# STATIC BUILD STUFF
static: isEqual(QT_MAJOR_VERSION, 4): QTPLUGIN += qjpcodecs
#/*****************************************************************************
#* gta5sync GRAND THEFT AUTO V SYNC
#* Copyright (C) 2015-2016 Syping
#*
#* This program is free software: you can redistribute it and/or modify
#* it under the terms of the GNU General Public License as published by
#* the Free Software Foundation, either version 3 of the License, or
#* (at your option) any later version.
#*
#* This program is distributed in the hope that it will be useful,
#* but WITHOUT ANY WARRANTY; without even the implied warranty of
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#* GNU General Public License for more details.
#*
#* You should have received a copy of the GNU General Public License
#* along with this program. If not, see <http://www.gnu.org/licenses/>.
#*****************************************************************************/
QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = gta5sync
TEMPLATE = app
SOURCES += main.cpp \
AboutDialog.cpp \
AppEnv.cpp \
CrewDatabase.cpp \
DatabaseThread.cpp \
ExportThread.cpp \
IconLoader.cpp \
OptionsDialog.cpp \
PictureCopy.cpp \
PictureDialog.cpp \
PictureExport.cpp \
PictureWidget.cpp \
ProfileDatabase.cpp \
ProfileInterface.cpp \
ProfileLoader.cpp \
ProfileWidget.cpp \
SavegameCopy.cpp \
SavegameData.cpp \
SavegameDialog.cpp \
SavegameWidget.cpp \
SidebarGenerator.cpp \
SnapmaticPicture.cpp \
SnapmaticWidget.cpp \
StandardPaths.cpp \
StringParser.cpp \
UserInterface.cpp \
uimod/UiModLabel.cpp
HEADERS += \
AboutDialog.h \
AppEnv.h \
config.h \
CrewDatabase.h \
DatabaseThread.h \
ExportThread.h \
IconLoader.h \
OptionsDialog.h \
PictureCopy.h \
PictureDialog.h \
PictureExport.h \
PictureWidget.h \
ProfileDatabase.h \
ProfileInterface.h \
ProfileLoader.h \
ProfileWidget.h \
SavegameCopy.h \
SavegameData.h \
SavegameDialog.h \
SavegameWidget.h \
SidebarGenerator.h \
SnapmaticPicture.h \
SnapmaticWidget.h \
StandardPaths.h \
StringParser.h \
UserInterface.h \
uimod/UiModLabel.h
FORMS += \
AboutDialog.ui \
OptionsDialog.ui \
PictureDialog.ui \
ProfileInterface.ui \
SavegameDialog.ui \
SavegameWidget.ui \
SnapmaticWidget.ui \
UserInterface.ui
TRANSLATIONS += \
res/gta5sync_de.ts \
lang/gta5sync_ru.ts
RESOURCES += \
res/app.qrc
DISTFILES += res/app.rc \
res/gta5sync.desktop \
res/gta5sync_de.ts \
lang/gta5sync_ru.qm \
lang/qtbase_ru.qm \
lang/README.txt \
lang/gta5sync_ru.ts \
lang/qt_ru.qm
INCLUDEPATH += ./uimod
# WINDOWS ONLY
win32: DEFINES += GTA5SYNC_WIN
win32: RC_FILE += res/app.rc
win32: LIBS += -luser32
# QT4 ONLY STUFF
isEqual(QT_MAJOR_VERSION, 4): INCLUDEPATH += ./qjson4
isEqual(QT_MAJOR_VERSION, 4): HEADERS += qjson4/QJsonArray.h \
qjson4/QJsonDocument.h \
qjson4/QJsonObject.h \
qjson4/QJsonParseError.h \
qjson4/QJsonValue.h \
qjson4/QJsonValueRef.h \
qjson4/QJsonParser.h \
qjson4/QJsonRoot.h
isEqual(QT_MAJOR_VERSION, 4): SOURCES += qjson4/QJsonArray.cpp \
qjson4/QJsonDocument.cpp \
qjson4/QJsonObject.cpp \
qjson4/QJsonParseError.cpp \
qjson4/QJsonValue.cpp \
qjson4/QJsonValueRef.cpp \
qjson4/QJsonParser.cpp
# UNIX SYSTEM STUFF
unix: !macx: appfiles.path = $$(INSTALL_PATH)/share/applications
unix: !macx: appfiles.files = $$PWD/res/gta5sync.desktop
unix: !macx: pixmaps.path = $$(INSTALL_PATH)/share/pixmaps
unix: !macx: pixmaps.files = $$PWD/res/gta5sync.xpm
unix: !macx: target.path = $$(INSTALL_PATH)/bin
unix: !macx: INSTALLS += target pixmaps appfiles
# STATIC BUILD STUFF
static: isEqual(QT_MAJOR_VERSION, 4): QTPLUGIN += qjpcodecs

View File

@ -31,7 +31,7 @@
<name>OptionsDialog</name>
<message>
<location filename="../OptionsDialog.ui" line="14"/>
<source>gta5sync - Options</source>
<source>gta5sync - Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -61,41 +61,70 @@
</message>
<message>
<location filename="../OptionsDialog.ui" line="80"/>
<source>Localization</source>
<source>Players</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.ui" line="86"/>
<location filename="../OptionsDialog.ui" line="111"/>
<source>ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.ui" line="116"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.ui" line="125"/>
<location filename="../OptionsDialog.ui" line="131"/>
<source>Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.ui" line="93"/>
<source>System</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.ui" line="118"/>
<location filename="../OptionsDialog.ui" line="157"/>
<source>Sync</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.ui" line="124"/>
<location filename="../OptionsDialog.ui" line="163"/>
<source>Sync is not implemented at current time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.ui" line="156"/>
<location filename="../OptionsDialog.ui" line="195"/>
<source>&amp;OK</source>
<extracomment>OK, Cancel, Apply</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.ui" line="163"/>
<location filename="../OptionsDialog.ui" line="202"/>
<source>&amp;Cancel</source>
<extracomment>OK, Cancel, Apply</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="78"/>
<source>%1 (%2 if available) [sys]</source>
<comment>System like PC System = %1, System Language like Deutsch = %2</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="78"/>
<source>System</source>
<comment>System like PC System</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="134"/>
<source>%1</source>
<comment>%1</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="134"/>
<source>The language change will take effect after you restart %1.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PictureDialog</name>
@ -123,7 +152,7 @@
<message>
<location filename="../PictureDialog.ui" line="126"/>
<location filename="../PictureCopy.cpp" line="47"/>
<location filename="../PictureExport.cpp" line="46"/>
<location filename="../PictureExport.cpp" line="47"/>
<source>&amp;Export</source>
<translation type="unfinished"></translation>
</message>
@ -180,31 +209,31 @@
<translation>Без группы</translation>
</message>
<message>
<location filename="../PictureExport.cpp" line="45"/>
<location filename="../PictureExport.cpp" line="46"/>
<source>Export as JPG picture...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureExport.cpp" line="49"/>
<location filename="../PictureExport.cpp" line="50"/>
<source>JPEG picture (*.jpg)</source>
<translation>Картинка JPEG (*.jpg)</translation>
</message>
<message>
<location filename="../PictureExport.cpp" line="50"/>
<location filename="../PictureExport.cpp" line="51"/>
<source>Portable Network Graphics (*.png)</source>
<translation>Картинка Portable Network Graphics (*.png)</translation>
</message>
<message>
<location filename="../PictureExport.cpp" line="102"/>
<location filename="../PictureExport.cpp" line="106"/>
<location filename="../PictureExport.cpp" line="120"/>
<location filename="../PictureExport.cpp" line="126"/>
<location filename="../PictureExport.cpp" line="103"/>
<location filename="../PictureExport.cpp" line="107"/>
<location filename="../PictureExport.cpp" line="121"/>
<location filename="../PictureExport.cpp" line="127"/>
<source>Export as JPG picture</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureCopy.cpp" line="69"/>
<location filename="../PictureExport.cpp" line="102"/>
<location filename="../PictureExport.cpp" line="103"/>
<source>Overwrite %1 with current Snapmatic picture?</source>
<translation>Перезаписать %1 текущей картинкой Snapmatic?</translation>
</message>
@ -218,18 +247,18 @@
</message>
<message>
<location filename="../PictureCopy.cpp" line="73"/>
<location filename="../PictureExport.cpp" line="106"/>
<location filename="../PictureExport.cpp" line="107"/>
<source>Failed to overwrite %1 with current Snapmatic picture</source>
<translation>Не удалось перезаписать %1 картинкой Snapmatic</translation>
</message>
<message>
<location filename="../PictureExport.cpp" line="120"/>
<location filename="../PictureExport.cpp" line="121"/>
<source>Failed to export current Snapmatic picture</source>
<translation>Не удалось экспортировать текущую картинку Snapmatic</translation>
</message>
<message>
<location filename="../PictureCopy.cpp" line="92"/>
<location filename="../PictureExport.cpp" line="126"/>
<location filename="../PictureExport.cpp" line="127"/>
<source>No valid file is selected</source>
<translation>Выбранный файл неверен</translation>
</message>
@ -299,136 +328,136 @@
<translation type="obsolete">Закрыть профиль</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="101"/>
<location filename="../ProfileInterface.cpp" line="102"/>
<source>Loading...</source>
<translation>Загрузка...</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="352"/>
<location filename="../ProfileInterface.cpp" line="353"/>
<source>Import...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="353"/>
<location filename="../ProfileInterface.cpp" line="393"/>
<location filename="../ProfileInterface.cpp" line="398"/>
<location filename="../ProfileInterface.cpp" line="423"/>
<location filename="../ProfileInterface.cpp" line="440"/>
<location filename="../ProfileInterface.cpp" line="470"/>
<location filename="../ProfileInterface.cpp" line="475"/>
<location filename="../ProfileInterface.cpp" line="485"/>
<location filename="../ProfileInterface.cpp" line="496"/>
<location filename="../ProfileInterface.cpp" line="533"/>
<location filename="../ProfileInterface.cpp" line="539"/>
<location filename="../ProfileInterface.cpp" line="354"/>
<location filename="../ProfileInterface.cpp" line="394"/>
<location filename="../ProfileInterface.cpp" line="399"/>
<location filename="../ProfileInterface.cpp" line="424"/>
<location filename="../ProfileInterface.cpp" line="441"/>
<location filename="../ProfileInterface.cpp" line="471"/>
<location filename="../ProfileInterface.cpp" line="476"/>
<location filename="../ProfileInterface.cpp" line="486"/>
<location filename="../ProfileInterface.cpp" line="497"/>
<location filename="../ProfileInterface.cpp" line="534"/>
<location filename="../ProfileInterface.cpp" line="540"/>
<source>Import</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="356"/>
<location filename="../ProfileInterface.cpp" line="357"/>
<source>All profile files (SGTA* PGTA*)</source>
<translation>Все файлы профиля (SGTA* PGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="357"/>
<location filename="../ProfileInterface.cpp" line="358"/>
<source>Savegames files (SGTA*)</source>
<translation>Файлы сохранения (SGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="358"/>
<location filename="../ProfileInterface.cpp" line="359"/>
<source>Snapmatic pictures (PGTA*)</source>
<translation>Картинка Snapmatic (PGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="359"/>
<location filename="../ProfileInterface.cpp" line="360"/>
<source>All files (**)</source>
<translation>Все файлы (**)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="393"/>
<location filename="../ProfileInterface.cpp" line="394"/>
<source>Import failed with...
%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="423"/>
<location filename="../ProfileInterface.cpp" line="424"/>
<source>Failed to read Snapmatic picture</source>
<translation>Не удалось загрузить картинку Snapmatic</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="440"/>
<location filename="../ProfileInterface.cpp" line="441"/>
<source>Failed to read Savegame file</source>
<translation>Не удалось загрузить файл сохранения</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="470"/>
<location filename="../ProfileInterface.cpp" line="471"/>
<source>Can&apos;t import %1 because of not valid file format</source>
<translation>Не получилось импортировать %1 из-за неправильного формата файла</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="398"/>
<location filename="../ProfileInterface.cpp" line="475"/>
<location filename="../ProfileInterface.cpp" line="399"/>
<location filename="../ProfileInterface.cpp" line="476"/>
<source>No valid file is selected</source>
<translation>Выбранный файл неверен</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="485"/>
<location filename="../ProfileInterface.cpp" line="486"/>
<source>Failed to import the Snapmatic picture, file not begin with PGTA</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="496"/>
<location filename="../ProfileInterface.cpp" line="497"/>
<source>Failed to import the Snapmatic picture, can&apos;t copy the file into profile</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="533"/>
<location filename="../ProfileInterface.cpp" line="534"/>
<source>Failed to import the Savegame, can&apos;t copy the file into profile</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="539"/>
<location filename="../ProfileInterface.cpp" line="540"/>
<source>Failed to import the Savegame, no Savegame slot is left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="618"/>
<location filename="../ProfileInterface.cpp" line="636"/>
<location filename="../ProfileInterface.cpp" line="619"/>
<location filename="../ProfileInterface.cpp" line="637"/>
<source>JPG pictures and GTA Snapmatic</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="619"/>
<location filename="../ProfileInterface.cpp" line="641"/>
<location filename="../ProfileInterface.cpp" line="620"/>
<location filename="../ProfileInterface.cpp" line="642"/>
<source>JPG pictures only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="620"/>
<location filename="../ProfileInterface.cpp" line="645"/>
<location filename="../ProfileInterface.cpp" line="621"/>
<location filename="../ProfileInterface.cpp" line="646"/>
<source>GTA Snapmatic only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="730"/>
<location filename="../ProfileInterface.cpp" line="774"/>
<location filename="../ProfileInterface.cpp" line="731"/>
<location filename="../ProfileInterface.cpp" line="775"/>
<source>No Snapmatic pictures or Savegames files are selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="738"/>
<location filename="../ProfileInterface.cpp" line="768"/>
<location filename="../ProfileInterface.cpp" line="774"/>
<location filename="../ProfileInterface.cpp" line="739"/>
<location filename="../ProfileInterface.cpp" line="769"/>
<location filename="../ProfileInterface.cpp" line="775"/>
<source>Remove selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="738"/>
<location filename="../ProfileInterface.cpp" line="739"/>
<source>You really want remove the selected Snapmatic picutres and Savegame files?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="768"/>
<location filename="../ProfileInterface.cpp" line="769"/>
<source>Failed at remove the complete selected Snapmatic pictures and/or Savegame files</source>
<translation type="unfinished"></translation>
</message>
@ -449,30 +478,30 @@
<translation type="obsolete">Не получилось имортировать копию сохранения, потому что не осталось свободных под них слотов</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="596"/>
<location filename="../ProfileInterface.cpp" line="633"/>
<location filename="../ProfileInterface.cpp" line="710"/>
<location filename="../ProfileInterface.cpp" line="730"/>
<location filename="../ProfileInterface.cpp" line="597"/>
<location filename="../ProfileInterface.cpp" line="634"/>
<location filename="../ProfileInterface.cpp" line="711"/>
<location filename="../ProfileInterface.cpp" line="731"/>
<source>Export selected</source>
<translation type="unfinished"