diff --git a/AppEnv.cpp b/AppEnv.cpp index 901dd5e..7a65aef 100644 --- a/AppEnv.cpp +++ b/AppEnv.cpp @@ -22,13 +22,17 @@ #include "StandardPaths.h" #include #include -#include #include #include #include #include #include #include + +#if QT_VERSION < 0x050000 +#include +#endif + #include using namespace std; @@ -153,7 +157,7 @@ QString AppEnv::getPluginsFolder() QByteArray AppEnv::getUserAgent() { #if QT_VERSION >= 0x050400 -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN QString kernelVersion = QSysInfo::kernelVersion(); const QStringList &kernelVersionList = kernelVersion.split("."); if (kernelVersionList.length() > 2) @@ -210,7 +214,7 @@ QUrl AppEnv::getPlayerFetchingUrl(QString crewID, int pageNumber) GameVersion AppEnv::getGameVersion() { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN QString argumentValue; #ifdef _WIN64 argumentValue = "\\WOW6432Node"; @@ -268,7 +272,7 @@ GameLanguage AppEnv::getGameLanguage(GameVersion gameVersion) { if (gameVersion == GameVersion::SocialClubVersion) { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN QString argumentValue; #ifdef _WIN64 argumentValue = "\\WOW6432Node"; @@ -282,7 +286,7 @@ GameLanguage AppEnv::getGameLanguage(GameVersion gameVersion) } else if (gameVersion == GameVersion::SteamVersion) { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN QString argumentValue; #ifdef _WIN64 argumentValue = "\\WOW6432Node"; @@ -443,7 +447,7 @@ bool AppEnv::setGameLanguage(GameVersion gameVersion, GameLanguage gameLanguage) } if (socialClubVersion) { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN QString argumentValue; #ifdef _WIN64 argumentValue = "\\WOW6432Node"; @@ -468,7 +472,7 @@ bool AppEnv::setGameLanguage(GameVersion gameVersion, GameLanguage gameLanguage) } if (steamVersion) { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN QString argumentValue; #ifdef _WIN64 argumentValue = "\\WOW6432Node"; diff --git a/DatabaseThread.cpp b/DatabaseThread.cpp index 2f87710..538381b 100644 --- a/DatabaseThread.cpp +++ b/DatabaseThread.cpp @@ -48,11 +48,8 @@ void DatabaseThread::run() while (threadRunning) { - if (threadRunning) - { - QTimer::singleShot(300000, &threadLoop, SLOT(quit())); - threadLoop.exec(); - } + QTimer::singleShot(300000, &threadLoop, SLOT(quit())); + threadLoop.exec(); } } @@ -65,7 +62,9 @@ void DatabaseThread::scanCrewReference(const QStringList &crewList, const int &r QNetworkAccessManager *netManager = new QNetworkAccessManager(); QNetworkRequest netRequest(AppEnv::getCrewFetchingUrl(crewID)); #if QT_VERSION >= 0x050600 +#if QT_VERSION < 0x060000 netRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); +#endif #endif netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent()); netRequest.setRawHeader("Accept", "text/html"); @@ -138,7 +137,9 @@ void DatabaseThread::scanCrewMembersList(const QStringList &crewList, const int QNetworkAccessManager *netManager = new QNetworkAccessManager(); QNetworkRequest netRequest(AppEnv::getPlayerFetchingUrl(crewID, currentPage)); #if QT_VERSION >= 0x050600 +#if QT_VERSION < 0x060000 netRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); +#endif #endif netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent()); netRequest.setRawHeader("Accept", "application/json"); diff --git a/GlobalString.cpp b/GlobalString.cpp index ebae98a..8c965c6 100644 --- a/GlobalString.cpp +++ b/GlobalString.cpp @@ -35,9 +35,11 @@ QMap GlobalString::getGlobalMap() { QMap globalMap; QSettings globalFile(getLanguageFile(), QSettings::IniFormat); +#if QT_VERSION < 0x060000 globalFile.setIniCodec("UTF-8"); +#endif globalFile.beginGroup("Global"); - for (QString globalStr : globalFile.childKeys()) + for (const QString &globalStr : globalFile.childKeys()) { globalMap[globalStr] = globalFile.value(globalStr, globalStr).toString(); } @@ -49,7 +51,9 @@ QString GlobalString::getString(QString valueStr, bool *ok) { QString globalString = valueStr; QSettings globalFile(getLanguageFile(), QSettings::IniFormat); +#if QT_VERSION < 0x060000 globalFile.setIniCodec("UTF-8"); +#endif globalFile.beginGroup("Global"); QStringList globalStrList = globalFile.childKeys(); if (globalStrList.contains(valueStr)) diff --git a/MapLocationDialog.cpp b/MapLocationDialog.cpp index 730818b..219080c 100644 --- a/MapLocationDialog.cpp +++ b/MapLocationDialog.cpp @@ -95,6 +95,21 @@ void MapLocationDialog::on_cmdDone_clicked() changeMode = false; } +#if QT_VERSION >= 0x060000 +void MapLocationDialog::updatePosFromEvent(double x, double y) +{ + QSize mapPixelSize = size(); + double xpos_ad = x; + double ypos_ad = mapPixelSize.height() - y; + double xrat = 10000 / (double)mapPixelSize.width(); + double yrat = 12000 / (double)mapPixelSize.height(); + double xpos_rv = xrat * xpos_ad; + double ypos_rv = yrat * ypos_ad; + double xpos_fp = xpos_rv - 4000; + double ypos_fp = ypos_rv - 4000; + drawPointOnMap(xpos_fp, ypos_fp); +} +#else void MapLocationDialog::updatePosFromEvent(int x, int y) { QSize mapPixelSize = size(); @@ -108,6 +123,7 @@ void MapLocationDialog::updatePosFromEvent(int x, int y) double ypos_fp = ypos_rv - 4000; drawPointOnMap(xpos_fp, ypos_fp); } +#endif void MapLocationDialog::paintEvent(QPaintEvent *ev) { @@ -133,7 +149,7 @@ void MapLocationDialog::paintEvent(QPaintEvent *ev) long xpos_pr; long ypos_pr; if (screenRatioPR != 1) { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN xpos_pr = xpos_mp - pointMarkerHalfSize; ypos_pr = ypos_mp + pointMarkerHalfSize; #else @@ -156,7 +172,11 @@ void MapLocationDialog::mouseMoveEvent(QMouseEvent *ev) if (!changeMode) { ev->ignore(); } else if (ev->buttons() & Qt::LeftButton) { +#if QT_VERSION >= 0x060000 + updatePosFromEvent(ev->position().x(), ev->position().y()); +#else updatePosFromEvent(ev->x(), ev->y()); +#endif ev->accept(); } else @@ -170,7 +190,11 @@ void MapLocationDialog::mouseReleaseEvent(QMouseEvent *ev) if (!changeMode) { ev->ignore(); } else if (ev->button() == Qt::LeftButton) { +#if QT_VERSION >= 0x060000 + updatePosFromEvent(ev->position().x(), ev->position().y()); +#else updatePosFromEvent(ev->x(), ev->y()); +#endif ev->accept(); } else diff --git a/MapLocationDialog.h b/MapLocationDialog.h index 46d91fe..1cb45f5 100644 --- a/MapLocationDialog.h +++ b/MapLocationDialog.h @@ -48,7 +48,11 @@ private slots: void on_cmdApply_clicked(); void on_cmdChange_clicked(); void on_cmdRevert_clicked(); +#if QT_VERSION >= 0x060000 + void updatePosFromEvent(double x, double y); +#else void updatePosFromEvent(int x, int y); +#endif void on_cmdClose_clicked(); private: diff --git a/MessageThread.cpp b/MessageThread.cpp new file mode 100644 index 0000000..2781ac6 --- /dev/null +++ b/MessageThread.cpp @@ -0,0 +1,111 @@ +/***************************************************************************** +* gta5view Grand Theft Auto V Profile Viewer +* Copyright (C) 2020 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 . +*****************************************************************************/ + +#include "TranslationClass.h" +#include "MessageThread.h" +#include "AppEnv.h" +#include "config.h" +#include +#include +#include +#include +#include +#include +#include +#include + +MessageThread::MessageThread(uint cacheId, QObject *parent) : QThread(parent), cacheId(cacheId) +{ + threadRunning = true; +} + +void MessageThread::run() +{ + QEventLoop threadLoop; + + QObject::connect(this, SIGNAL(threadTerminated()), &threadLoop, SLOT(quit())); + + while (threadRunning) { + { +#ifdef GTA5SYNC_MOTD_WEBURL + QUrl motdWebUrl = QUrl(GTA5SYNC_MOTD_WEBURL); +#else + QUrl motdWebUrl = QUrl("https://motd.syping.de/gta5view-dev/"); +#endif + QUrlQuery urlQuery(motdWebUrl); + urlQuery.addQueryItem("code", GTA5SYNC_BUILDCODE); + urlQuery.addQueryItem("cacheid", QString::number(cacheId)); + urlQuery.addQueryItem("lang", Translator->getCurrentLanguage()); + urlQuery.addQueryItem("version", GTA5SYNC_APPVER); + motdWebUrl.setQuery(urlQuery); + + QNetworkAccessManager *netManager = new QNetworkAccessManager(); + QNetworkRequest netRequest(motdWebUrl); + netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent()); + QNetworkReply *netReply = netManager->get(netRequest); + + QEventLoop downloadLoop; + QObject::connect(netManager, SIGNAL(finished(QNetworkReply*)), &downloadLoop, SLOT(quit())); + QObject::connect(this, SIGNAL(threadTerminated()), &threadLoop, SLOT(quit())); + QTimer::singleShot(60000, &downloadLoop, SLOT(quit())); + downloadLoop.exec(); + + if (netReply->isFinished()) { + QByteArray jsonContent = netReply->readAll(); + QString headerData = QString::fromUtf8(netReply->rawHeader("gta5view")); + if (!headerData.isEmpty()) { + QMap headerMap; + const QStringList headerVarList = headerData.split(';'); + for (QString headerVar : headerVarList) { + QStringList varValueList = headerVar.split('='); + if (varValueList.length() >= 2) { + const QString variable = varValueList.at(0).trimmed(); + varValueList.removeFirst(); + const QString value = varValueList.join('='); + headerMap.insert(variable, value); + } + } + if (headerMap.value("update", "false") == "true") { + QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonContent); + emit messagesArrived(jsonDocument.object()); + } + if (headerMap.contains("cache")) { + bool uintOk; + uint cacheVal = headerMap.value("cache").toUInt(&uintOk); + if (uintOk) { + cacheId = cacheVal; + emit updateCacheId(cacheId); + } + } + } + } + + delete netReply; + delete netManager; + } + + QTimer::singleShot(300000, &threadLoop, SLOT(quit())); + threadLoop.exec(); + } +} + +void MessageThread::terminateThread() +{ + threadRunning = false; + emit threadTerminated(); +} diff --git a/MessageThread.h b/MessageThread.h new file mode 100644 index 0000000..fa2d25b --- /dev/null +++ b/MessageThread.h @@ -0,0 +1,48 @@ +/***************************************************************************** +* gta5view Grand Theft Auto V Profile Viewer +* Copyright (C) 2020 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 . +*****************************************************************************/ + +#ifndef MESSAGETHREAD_H +#define MESSAGETHREAD_H + +#include +#include +#include + +class MessageThread : public QThread +{ + Q_OBJECT +public: + explicit MessageThread(uint cacheId, QObject *parent = 0); + +public slots: + void terminateThread(); + +private: + bool threadRunning; + uint cacheId; + +protected: + void run(); + +signals: + void messagesArrived(const QJsonObject &messageObject); + void updateCacheId(uint cacheId); + void threadTerminated(); +}; + +#endif // MESSAGETHREAD_H diff --git a/OptionsDialog.cpp b/OptionsDialog.cpp index 951566f..06992cc 100644 --- a/OptionsDialog.cpp +++ b/OptionsDialog.cpp @@ -174,7 +174,7 @@ void OptionsDialog::setupLanguageBox() QString cbSysStr = tr("%1 (Language priority)", "First language a person can talk with a different person/application. \"Native\" or \"Not Native\".").arg(tr("System", "System in context of System default")); -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN QString cbAutoStr; if (AppEnv::getGameLanguage(AppEnv::getGameVersion()) != GameLanguage::Undefined) { @@ -301,7 +301,7 @@ void OptionsDialog::setupInterfaceSettings() settings->beginGroup("Startup"); bool alwaysUseMessageFont = settings->value("AlwaysUseMessageFont", false).toBool(); ui->cbAlwaysUseMessageFont->setChecked(alwaysUseMessageFont); -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN if (QSysInfo::windowsVersion() >= 0x0080) { ui->gbFont->setVisible(false); @@ -367,7 +367,7 @@ void OptionsDialog::applySettings() settings->setValue("Language", ui->cbLanguage->itemData(ui->cbLanguage->currentIndex())); settings->setValue("AreaLanguage", ui->cbAreaLanguage->itemData(ui->cbAreaLanguage->currentIndex())); #endif -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050200 settings->setValue("NavigationBar", ui->cbSnapmaticNavigationBar->isChecked()); #endif @@ -626,7 +626,7 @@ void OptionsDialog::setupWindowsGameSettings() { #ifdef GTA5SYNC_GAME GameVersion gameVersion = AppEnv::getGameVersion(); -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN if (gameVersion != GameVersion::NoVersion) { if (gameVersion == GameVersion::SocialClubVersion) @@ -723,7 +723,7 @@ void OptionsDialog::setupCustomGTAFolder() void OptionsDialog::setupSnapmaticPictureViewer() { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050200 settings->beginGroup("Interface"); ui->cbSnapmaticNavigationBar->setChecked(settings->value("NavigationBar", true).toBool()); diff --git a/PictureDialog.cpp b/PictureDialog.cpp index bddb82c..f602be4 100644 --- a/PictureDialog.cpp +++ b/PictureDialog.cpp @@ -33,7 +33,11 @@ #include "AppEnv.h" #include "config.h" -#ifdef GTA5SYNC_WIN +#if QT_VERSION < 0x060000 +#include +#endif + +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050200 #include #include @@ -41,7 +45,6 @@ #endif #include -#include #include #include #include @@ -80,7 +83,11 @@ #define picPath picture->getPictureFilePath() #define picTitl StringParser::escapeString(picture->getPictureTitle()) #define plyrsList picture->getSnapmaticProperties().playersList +#if QT_VERSION >= 0x060000 +#define created QLocale().toString(picture->getSnapmaticProperties().createdDateTime, QLocale::ShortFormat) +#else #define created picture->getSnapmaticProperties().createdDateTime.toString(Qt::DefaultLocaleShortDate) +#endif PictureDialog::PictureDialog(ProfileDatabase *profileDB, CrewDatabase *crewDB, QWidget *parent) : QDialog(parent), profileDB(profileDB), crewDB(crewDB), @@ -208,7 +215,7 @@ void PictureDialog::setupPictureDialog() PictureDialog::~PictureDialog() { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050200 if (naviEnabled) { @@ -248,7 +255,7 @@ void PictureDialog::closeEvent(QCloseEvent *ev) void PictureDialog::addPreviousNextButtons() { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050200 QToolBar *uiToolbar = new QToolBar("Picture Toolbar", this); uiToolbar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); @@ -276,120 +283,6 @@ void PictureDialog::addPreviousNextButtons() #endif } -#ifdef GTA5SYNC_WIN -#if QT_VERSION >= 0x050200 -#ifdef GTA5SYNC_APV -bool PictureDialog::nativeEvent(const QByteArray &eventType, void *message, long *result) -{ - *result = 0; - MSG *msg = static_cast(message); - LRESULT lRet = 0; - - if (naviEnabled && QtWin::isCompositionEnabled()) - { - if (msg->message == WM_NCCALCSIZE && msg->wParam == TRUE) - { - NCCALCSIZE_PARAMS *pncsp = reinterpret_cast(msg->lParam); - - int sideBorderSize = ((frameSize().width() - size().width()) / 2); -#ifdef GTA5SYNC_APV_SIDE - int buttomBorderSize = sideBorderSize; -#else - int buttomBorderSize = (frameSize().height() - size().height()); -#endif - pncsp->rgrc[0].left += sideBorderSize; - pncsp->rgrc[0].right -= sideBorderSize; - pncsp->rgrc[0].bottom -= buttomBorderSize; - } - else if (msg->message == WM_NCHITTEST) - { - int CLOSE_BUTTON_ID = 20; - lRet = HitTestNCA(msg->hwnd, msg->lParam); - DwmDefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam, &lRet); - *result = lRet; - if (lRet != CLOSE_BUTTON_ID) { return QWidget::nativeEvent(eventType, message, result); } - } - else - { - return QWidget::nativeEvent(eventType, message, result); - } - } - else - { - return QWidget::nativeEvent(eventType, message, result); - } - return true; -} - -LRESULT PictureDialog::HitTestNCA(HWND hWnd, LPARAM lParam) -{ - int LEFTEXTENDWIDTH = 0; - int RIGHTEXTENDWIDTH = 0; - int BOTTOMEXTENDWIDTH = 0; - int TOPEXTENDWIDTH = layout()->menuBar()->height(); - - POINT ptMouse = {(int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)}; - - RECT rcWindow; - GetWindowRect(hWnd, &rcWindow); - - RECT rcFrame = {}; - AdjustWindowRectEx(&rcFrame, WS_OVERLAPPEDWINDOW & ~WS_CAPTION, FALSE, NULL); - - USHORT uRow = 1; - USHORT uCol = 1; - bool fOnResizeBorder = false; - - if (ptMouse.y >= rcWindow.top && ptMouse.y < rcWindow.top + TOPEXTENDWIDTH) - { - fOnResizeBorder = (ptMouse.y < (rcWindow.top - rcFrame.top)); - uRow = 0; - } - else if (ptMouse.y < rcWindow.bottom && ptMouse.y >= rcWindow.bottom - BOTTOMEXTENDWIDTH) - { - uRow = 2; - } - - if (ptMouse.x >= rcWindow.left && ptMouse.x < rcWindow.left + LEFTEXTENDWIDTH) - { - uCol = 0; - } - else if (ptMouse.x < rcWindow.right && ptMouse.x >= rcWindow.right - RIGHTEXTENDWIDTH) - { - uCol = 2; - } - - LRESULT hitTests[3][3] = - { - { HTTOPLEFT, fOnResizeBorder ? HTTOP : HTCAPTION, HTTOPRIGHT }, - { HTLEFT, HTNOWHERE, HTRIGHT }, - { HTBOTTOMLEFT, HTBOTTOM, HTBOTTOMRIGHT }, - }; - - return hitTests[uRow][uCol]; -} - -void PictureDialog::resizeEvent(QResizeEvent *event) -{ - Q_UNUSED(event) - // int newDialogHeight = (ui->labPicture->pixmap()->height() / AppEnv::screenRatioPR()); - // newDialogHeight = newDialogHeight + ui->jsonFrame->height(); - // if (naviEnabled) newDialogHeight = newDialogHeight + layout()->menuBar()->height(); - // int buttomBorderSize = (frameSize().height() - size().height()); - // int sideBorderSize = ((frameSize().width() - size().width()) / 2); - // int brokenDialogHeight = newDialogHeight + (buttomBorderSize - sideBorderSize); - // if (event->size().height() == brokenDialogHeight) - // { - // qDebug() << "BROKEN 1"; - // setGeometry(geometry().x(), geometry().y(), width(), newDialogHeight); - // qDebug() << "BROKEN 2"; - // event->ignore(); - // } -} -#endif -#endif -#endif - void PictureDialog::adaptNewDialogSize(QSize newLabelSize) { Q_UNUSED(newLabelSize) @@ -410,7 +303,7 @@ void PictureDialog::adaptNewDialogSize(QSize newLabelSize) void PictureDialog::styliseDialog() { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050200 if (QtWin::isCompositionEnabled()) { @@ -432,7 +325,7 @@ void PictureDialog::styliseDialog() bool PictureDialog::event(QEvent *event) { -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050200 if (naviEnabled) { @@ -517,7 +410,7 @@ bool PictureDialog::eventFilter(QObject *obj, QEvent *ev) break; } } -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050200 if (obj != ui->labPicture && naviEnabled) { @@ -805,7 +698,7 @@ QString PictureDialog::generatePlayersString() QString plyrsStr; if (playersList.length() >= 1) { - for (const QString player : playersList) + for (const QString &player : playersList) { const QString playerName = profileDB->getPlayerName(player); if (player != playerName) { @@ -852,13 +745,17 @@ void PictureDialog::on_labPicture_mouseDoubleClicked(Qt::MouseButton button) { if (button == Qt::LeftButton) { +#if QT_VERSION >= 0x060000 + QRect desktopRect = QApplication::screenAt(pos())->geometry(); +#else QRect desktopRect = QApplication::desktop()->screenGeometry(this); +#endif PictureWidget *pictureWidget = new PictureWidget(this); // Work! pictureWidget->setObjectName("PictureWidget"); #if QT_VERSION >= 0x050600 - pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::FramelessWindowHint^Qt::WindowStaysOnTopHint^Qt::MaximizeUsingFullscreenGeometryHint); + pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::FramelessWindowHint^Qt::MaximizeUsingFullscreenGeometryHint); #else - pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::FramelessWindowHint^Qt::WindowStaysOnTopHint); + pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::FramelessWindowHint); #endif pictureWidget->setWindowTitle(windowTitle()); pictureWidget->setStyleSheet("QLabel#pictureLabel{background-color: black;}"); @@ -872,7 +769,7 @@ void PictureDialog::on_labPicture_mouseDoubleClicked(Qt::MouseButton button) pictureWidget->move(desktopRect.x(), desktopRect.y()); pictureWidget->resize(desktopRect.width(), desktopRect.height()); -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050200 QtWin::markFullscreenWindow(pictureWidget, true); #endif diff --git a/PictureDialog.h b/PictureDialog.h index 10c7593..c4dc01f 100644 --- a/PictureDialog.h +++ b/PictureDialog.h @@ -29,14 +29,6 @@ #include #include -#ifdef GTA5SYNC_WIN -#if QT_VERSION >= 0x050200 -#ifdef GTA5SYNC_APV -#include -#endif -#endif -#endif - namespace Ui { class PictureDialog; } @@ -98,15 +90,6 @@ protected: bool eventFilter(QObject *obj, QEvent *ev); void mousePressEvent(QMouseEvent *ev); bool event(QEvent *event); -#ifdef GTA5SYNC_WIN -#if QT_VERSION >= 0x050200 -#ifdef GTA5SYNC_APV - bool nativeEvent(const QByteArray &eventType, void *message, long *result); - LRESULT HitTestNCA(HWND hWnd, LPARAM lParam); - void resizeEvent(QResizeEvent *event); -#endif -#endif -#endif private: QString generateCrewString(); @@ -136,7 +119,7 @@ private: int avatarLocY; int avatarSize; QMenu *manageMenu; -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050200 QPoint dragPosition; bool dragStart; diff --git a/PictureExport.cpp b/PictureExport.cpp index 7c91ff4..0433015 100644 --- a/PictureExport.cpp +++ b/PictureExport.cpp @@ -23,19 +23,19 @@ #include "StandardPaths.h" #include "SidebarGenerator.h" #include -#include #include #include #include #include -#include #include +#if QT_VERSION < 0x050000 +#include +#endif + #if QT_VERSION >= 0x050000 #include #include -#else -#include #endif PictureExport::PictureExport() diff --git a/PictureWidget.cpp b/PictureWidget.cpp index cbfc374..a60f84a 100644 --- a/PictureWidget.cpp +++ b/PictureWidget.cpp @@ -19,7 +19,6 @@ #include "PictureDialog.h" #include "PictureWidget.h" #include "UiModLabel.h" -#include #include #include #include @@ -27,6 +26,10 @@ #include #include +#if QT_VERSION < 0x060000 +#include +#endif + PictureWidget::PictureWidget(QWidget *parent) : QDialog(parent) { installEventFilter(this); @@ -98,12 +101,21 @@ void PictureWidget::setImage(QImage image_) void PictureWidget::updateWindowSize(int screenID) { +#if QT_VERSION >= 0x060000 + Q_UNUSED(screenID) + QRect desktopRect = QApplication::screenAt(pos())->geometry(); + move(desktopRect.x(), desktopRect.y()); + resize(desktopRect.width(), desktopRect.height()); + showFullScreen(); + pictureLabel->setPixmap(QPixmap::fromImage(image.scaled(desktopRect.width(), desktopRect.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation))); +#else if (screenID == QApplication::desktop()->screenNumber(this)) { QRect desktopRect = QApplication::desktop()->screenGeometry(this); - this->move(desktopRect.x(), desktopRect.y()); - this->resize(desktopRect.width(), desktopRect.height()); - this->showFullScreen(); + move(desktopRect.x(), desktopRect.y()); + resize(desktopRect.width(), desktopRect.height()); + showFullScreen(); pictureLabel->setPixmap(QPixmap::fromImage(image.scaled(desktopRect.width(), desktopRect.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation))); } +#endif } diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index 0049c8b..841b3d7 100644 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -264,18 +263,14 @@ void ProfileInterface::insertSnapmaticIPI(QWidget *widget) QStringList widgetsKeyList = widgets.values(); QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive); #if QT_VERSION >= 0x050600 -#if QT_VERSION >= 0x050F00 std::sort(pictureKeyList.rbegin(), pictureKeyList.rend()); -#else - qSort(pictureKeyList.rbegin(), pictureKeyList.rend()); -#endif #else qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater()); #endif - int picIndex = pictureKeyList.indexOf(QRegExp(widgetKey)); + int picIndex = pictureKeyList.indexOf(widgetKey); ui->vlSnapmatic->insertWidget(picIndex, proWidget); - qApp->processEvents(); + QApplication::processEvents(); ui->saProfile->ensureWidgetVisible(proWidget, 0, 0); } } @@ -288,15 +283,15 @@ void ProfileInterface::insertSavegameIPI(QWidget *widget) QString widgetKey = widgets[proWidget]; QStringList widgetsKeyList = widgets.values(); QStringList savegameKeyList = widgetsKeyList.filter("SGD", Qt::CaseSensitive); -#if QT_VERSION >= 0x050F00 +#if QT_VERSION >= 0x050600 std::sort(savegameKeyList.begin(), savegameKeyList.end()); #else qSort(savegameKeyList.begin(), savegameKeyList.end()); #endif - int sgdIndex = savegameKeyList.indexOf(QRegExp(widgetKey)); + int sgdIndex = savegameKeyList.indexOf(widgetKey); ui->vlSavegame->insertWidget(sgdIndex, proWidget); - qApp->processEvents(); + QApplication::processEvents(); ui->saProfile->ensureWidgetVisible(proWidget, 0, 0); } } @@ -311,11 +306,7 @@ void ProfileInterface::dialogNextPictureRequested(QWidget *dialog) QStringList widgetsKeyList = widgets.values(); QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive); #if QT_VERSION >= 0x050600 -#if QT_VERSION >= 0x050F00 std::sort(pictureKeyList.rbegin(), pictureKeyList.rend()); -#else - qSort(pictureKeyList.rbegin(), pictureKeyList.rend()); -#endif #else qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater()); #endif @@ -326,7 +317,7 @@ void ProfileInterface::dialogNextPictureRequested(QWidget *dialog) } else { - picIndex = pictureKeyList.indexOf(QRegExp(widgetKey)); + picIndex = pictureKeyList.indexOf(widgetKey); } picIndex++; if (pictureKeyList.length() > picIndex) @@ -350,11 +341,7 @@ void ProfileInterface::dialogPreviousPictureRequested(QWidget *dialog) QStringList widgetsKeyList = widgets.values(); QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive); #if QT_VERSION >= 0x050600 -#if QT_VERSION >= 0x050F00 std::sort(pictureKeyList.rbegin(), pictureKeyList.rend()); -#else - qSort(pictureKeyList.rbegin(), pictureKeyList.rend()); -#endif #else qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater()); #endif @@ -365,7 +352,7 @@ void ProfileInterface::dialogPreviousPictureRequested(QWidget *dialog) } else { - picIndex = pictureKeyList.indexOf(QRegExp(widgetKey)); + picIndex = pictureKeyList.indexOf(widgetKey); } if (picIndex > 0) { @@ -386,7 +373,7 @@ void ProfileInterface::sortingProfileInterface() QStringList widgetsKeyList = widgets.values(); -#if QT_VERSION >= 0x050F00 +#if QT_VERSION >= 0x050600 std::sort(widgetsKeyList.begin(), widgetsKeyList.end()); #else qSort(widgetsKeyList.begin(), widgetsKeyList.end()); @@ -408,7 +395,7 @@ void ProfileInterface::sortingProfileInterface() ui->vlSavegame->setEnabled(true); ui->vlSnapmatic->setEnabled(true); - qApp->processEvents(); + QApplication::processEvents(); } void ProfileInterface::profileLoaded_p() @@ -772,7 +759,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime cEnough++; } spJson.createdDateTime = importDateTime; +#if QT_VERSION >= 0x060000 + spJson.createdTimestamp = QString::number(spJson.createdDateTime.toSecsSinceEpoch()).toUInt(); +#else spJson.createdTimestamp = spJson.createdDateTime.toTime_t(); +#endif picture->setSnapmaticProperties(spJson); picture->setPicFileName(QString("PRDR3%1").arg(QString::number(spJson.uid))); picture->setPictureTitle(customImageTitle); @@ -826,7 +817,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime cEnough++; } spJson.createdDateTime = importDateTime; +#if QT_VERSION >= 0x060000 + spJson.createdTimestamp = QString::number(spJson.createdDateTime.toSecsSinceEpoch()).toUInt(); +#else spJson.createdTimestamp = spJson.createdDateTime.toTime_t(); +#endif picture->setSnapmaticProperties(spJson); picture->setPicFileName(QString("PRDR3%1").arg(QString::number(spJson.uid))); picture->setPictureTitle(importDialog->getImageTitle()); @@ -1071,7 +1066,11 @@ bool ProfileInterface::importImage(QImage *snapmaticImage, QDateTime importDateT cEnough++; } spJson.createdDateTime = importDateTime; +#if QT_VERSION >= 0x060000 + spJson.createdTimestamp = QString::number(spJson.createdDateTime.toSecsSinceEpoch()).toUInt(); +#else spJson.createdTimestamp = spJson.createdDateTime.toTime_t(); +#endif picture->setSnapmaticProperties(spJson); picture->setPicFileName(QString("PRDR3%1").arg(QString::number(spJson.uid))); picture->setPictureTitle(importDialog->getImageTitle()); @@ -1115,7 +1114,11 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa // Update Snapmatic uid snapmaticProperties.uid = getRandomUid(); snapmaticProperties.createdDateTime = QDateTime::currentDateTime(); +#if QT_VERSION >= 0x060000 + snapmaticProperties.createdTimestamp = QString::number(snapmaticProperties.createdDateTime.toSecsSinceEpoch()).toUInt(); +#else snapmaticProperties.createdTimestamp = snapmaticProperties.createdDateTime.toTime_t(); +#endif bool fExists = QFile::exists(profileFolder % "/PRDR3" % QString::number(snapmaticProperties.uid)); bool fExistsBackup = QFile::exists(profileFolder % "/PRDR3" % QString::number(snapmaticProperties.uid) % ".bak"); bool fExistsHidden = QFile::exists(profileFolder % "/PRDR3" % QString::number(snapmaticProperties.uid) % ".hidden"); @@ -1152,7 +1155,11 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa // Update Snapmatic uid snapmaticProperties.uid = getRandomUid(); snapmaticProperties.createdDateTime = QDateTime::currentDateTime(); +#if QT_VERSION >= 0x060000 + snapmaticProperties.createdTimestamp = QString::number(snapmaticProperties.createdDateTime.toSecsSinceEpoch()).toUInt(); +#else snapmaticProperties.createdTimestamp = snapmaticProperties.createdDateTime.toTime_t(); +#endif bool fExists = QFile::exists(profileFolder % "/PRDR3" % QString::number(snapmaticProperties.uid)); bool fExistsBackup = QFile::exists(profileFolder % "/PRDR3" % QString::number(snapmaticProperties.uid) % ".bak"); bool fExistsHidden = QFile::exists(profileFolder % "/PRDR3" % QString::number(snapmaticProperties.uid) % ".hidden"); @@ -1325,7 +1332,7 @@ void ProfileInterface::exportSelected() QString ExportPreSpan; QString ExportPostSpan; -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN ExportPreSpan = ""; ExportPostSpan = ""; #else @@ -2047,7 +2054,7 @@ void ProfileInterface::massTool(MassTool tool) else { picture->emitUpdate(); - qApp->processEvents(); + QApplication::processEvents(); } } pbDialog.close(); @@ -2146,7 +2153,7 @@ void ProfileInterface::massTool(MassTool tool) else { picture->emitUpdate(); - qApp->processEvents(); + QApplication::processEvents(); } } pbDialog.close(); @@ -2199,7 +2206,7 @@ preSelectionCrewID: } if (crewList.contains(QString::number(crewID))) { - indexNum = crewList.indexOf(QRegExp(QString::number(crewID))); + indexNum = crewList.indexOf(QString::number(crewID)); } QString newCrew = QInputDialog::getItem(this, QApplication::translate("SnapmaticEditor", "Snapmatic Crew"), QApplication::translate("SnapmaticEditor", "New Snapmatic crew:"), itemList, indexNum, true, &ok, windowFlags()^Qt::Dialog^Qt::WindowMinMaxButtonsHint); if (ok && !newCrew.isEmpty()) @@ -2277,7 +2284,7 @@ preSelectionCrewID: else { picture->emitUpdate(); - qApp->processEvents(); + QApplication::processEvents(); } } pbDialog.close(); @@ -2380,7 +2387,7 @@ preSelectionTitle: else { picture->emitUpdate(); - qApp->processEvents(); + QApplication::processEvents(); } } pbDialog.close(); diff --git a/SavegameData.cpp b/SavegameData.cpp index 0e922b4..1457a23 100644 --- a/SavegameData.cpp +++ b/SavegameData.cpp @@ -20,7 +20,6 @@ #include "StringParser.h" #include "SavegameData.h" #include -#include #include #include #include diff --git a/SnapmaticEditor.cpp b/SnapmaticEditor.cpp index b4ef036..efe4c8d 100644 --- a/SnapmaticEditor.cpp +++ b/SnapmaticEditor.cpp @@ -23,7 +23,6 @@ #include "StringParser.h" #include "AppEnv.h" #include "config.h" -#include #include #include #include @@ -438,7 +437,7 @@ void SnapmaticEditor::on_labCrew_linkActivated(const QString &link) } if (crewList.contains(QString::number(crewID))) { - indexNum = crewList.indexOf(QRegExp(QString::number(crewID))); + indexNum = crewList.indexOf(QString::number(crewID)); } QString newCrew = QInputDialog::getItem(this, tr("Snapmatic Crew"), tr("New Snapmatic crew:"), itemList, indexNum, true, &ok, windowFlags()); if (ok && !newCrew.isEmpty()) diff --git a/SnapmaticPicture.cpp b/SnapmaticPicture.cpp index c10b9c3..099efb8 100644 --- a/SnapmaticPicture.cpp +++ b/SnapmaticPicture.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -33,6 +32,10 @@ #include #include +#if QT_VERSION < 0x060000 +#include +#endif + #if QT_VERSION >= 0x050000 #include #else @@ -106,7 +109,7 @@ void SnapmaticPicture::reset() jsonStr = QString(); // SNAPMATIC DEFAULTS -#ifdef GTA5SYNC_NOASSIST +#ifdef SNAPMATIC_NODEFAULT careSnapDefault = false; #else careSnapDefault = true; @@ -993,7 +996,11 @@ void SnapmaticPicture::parseJsonContent() bool timestampOk; QDateTime createdTimestamp; localProperties.createdTimestamp = jsonMap["creat"].toUInt(×tampOk); +#if QT_VERSION >= 0x060000 + createdTimestamp.setSecsSinceEpoch(QString::number(localProperties.createdTimestamp).toLongLong()); +#else createdTimestamp.setTime_t(localProperties.createdTimestamp); +#endif localProperties.createdDateTime = createdTimestamp; if (!timestampOk) { jsonError = true; } } @@ -1418,7 +1425,13 @@ bool SnapmaticPicture::verifyTitleChar(const QChar &titleChar) QString SnapmaticPicture::parseTitleString(const QByteArray &commitBytes, int maxLength) { Q_UNUSED(maxLength) +#if QT_VERSION >= 0x060000 + QStringDecoder strDecoder = QStringDecoder(QStringDecoder::Utf16LE); + QString retStr = strDecoder(commitBytes); + retStr = retStr.trimmed(); +#else QString retStr = QTextCodec::codecForName("UTF-16LE")->toUnicode(commitBytes).trimmed(); +#endif retStr.remove(QChar('\x00')); return retStr; } diff --git a/StringParser.cpp b/StringParser.cpp index 93d5825..31d25f0 100644 --- a/StringParser.cpp +++ b/StringParser.cpp @@ -19,7 +19,6 @@ #include "StringParser.h" #include #include -#include #include #include #include @@ -49,12 +48,16 @@ QString StringParser::escapeString(const QString &toEscape) QString StringParser::convertBuildedString(const QString &buildedStr) { QString outputStr = buildedStr; - QByteArray sharePath = GTA5SYNC_SHARE; - outputStr.replace("APPNAME:", GTA5SYNC_APPSTR); - outputStr.replace("SHAREDDIR:", QString::fromUtf8(sharePath)); - outputStr.replace("RUNDIR:", QFileInfo(qApp->applicationFilePath()).absoluteDir().absolutePath()); + outputStr.replace("APPNAME:", QString::fromUtf8(GTA5SYNC_APPSTR)); + outputStr.replace("SHAREDDIR:", QString::fromUtf8(GTA5SYNC_SHARE)); + outputStr.replace("RUNDIR:", QFileInfo(QApplication::applicationFilePath()).canonicalPath()); +#if QT_VERSION >= 0x060000 + outputStr.replace("QCONFLANG:", QLibraryInfo::path(QLibraryInfo::TranslationsPath)); + outputStr.replace("QCONFPLUG:", QLibraryInfo::path(QLibraryInfo::PluginsPath)); +#else outputStr.replace("QCONFLANG:", QLibraryInfo::location(QLibraryInfo::TranslationsPath)); outputStr.replace("QCONFPLUG:", QLibraryInfo::location(QLibraryInfo::PluginsPath)); +#endif outputStr.replace("SEPARATOR:", QDir::separator()); return outputStr; } diff --git a/TelemetryClass.cpp b/TelemetryClass.cpp index 5286d0e..cb10697 100644 --- a/TelemetryClass.cpp +++ b/TelemetryClass.cpp @@ -41,7 +41,7 @@ #define GTA5SYNC_TELEMETRY_WEBURL "" #endif -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #include "windows.h" #include "intrin.h" #include "d3d9.h" @@ -228,7 +228,7 @@ QJsonDocument TelemetryClass::getSystemHardware() { QJsonDocument jsonDocument; QJsonObject jsonObject; -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN { int CPUInfo[4] = {-1}; unsigned nExIds, ic = 0; diff --git a/TranslationClass.cpp b/TranslationClass.cpp index f1332f2..041cb04 100644 --- a/TranslationClass.cpp +++ b/TranslationClass.cpp @@ -63,7 +63,11 @@ void TranslationClass::loadTranslation(QApplication *app) { app->installTranslator(&inQtTranslator); } +#if QT_VERSION <= 0x060000 + QLocale::setDefault(QLocale(currentLanguage)); +#else QLocale::setDefault(currentLanguage); +#endif isLangLoaded = true; return; } @@ -147,7 +151,11 @@ void TranslationClass::loadTranslation(QApplication *app) { app->installTranslator(&inQtTranslator); } +#if QT_VERSION <= 0x060000 + QLocale::setDefault(QLocale(currentLanguage)); +#else QLocale::setDefault(currentLanguage); +#endif isLangLoaded = true; } } @@ -176,7 +184,11 @@ void TranslationClass::loadTranslation(QApplication *app) { app->installTranslator(&inQtTranslator); } +#if QT_VERSION <= 0x060000 + QLocale::setDefault(QLocale(currentLanguage)); +#else QLocale::setDefault(currentLanguage); +#endif isLangLoaded = true; } else @@ -195,7 +207,11 @@ void TranslationClass::loadTranslation(QApplication *app) { app->installTranslator(&inQtTranslator); } +#if QT_VERSION <= 0x060000 + QLocale::setDefault(QLocale(currentLanguage)); +#else QLocale::setDefault(currentLanguage); +#endif isLangLoaded = true; } } @@ -219,7 +235,11 @@ void TranslationClass::loadTranslation(QApplication *app) { app->installTranslator(&inQtTranslator); } +#if QT_VERSION <= 0x060000 + QLocale::setDefault(QLocale(currentLanguage)); +#else QLocale::setDefault(currentLanguage); +#endif isLangLoaded = true; } else if (!trLoadSuccess) @@ -236,7 +256,11 @@ void TranslationClass::loadTranslation(QApplication *app) { app->installTranslator(&inQtTranslator); } +#if QT_VERSION <= 0x060000 + QLocale::setDefault(QLocale(currentLanguage)); +#else QLocale::setDefault(currentLanguage); +#endif isLangLoaded = true; } } diff --git a/UserInterface.cpp b/UserInterface.cpp index 82a9df3..78adb73 100644 --- a/UserInterface.cpp +++ b/UserInterface.cpp @@ -40,14 +40,21 @@ #include #include #include +#include #include #include #include #include +#ifdef GTA5SYNC_MOTD +UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, MessageThread *threadMessage, QWidget *parent) : + QMainWindow(parent), profileDB(profileDB), crewDB(crewDB), threadDB(threadDB), threadMessage(threadMessage), + ui(new Ui::UserInterface) +#else UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent) : QMainWindow(parent), profileDB(profileDB), crewDB(crewDB), threadDB(threadDB), ui(new Ui::UserInterface) +#endif { ui->setupUi(this); contentMode = 0; @@ -328,7 +335,11 @@ void UserInterface::closeProfile_p() void UserInterface::closeEvent(QCloseEvent *ev) { Q_UNUSED(ev) +#ifdef GTA5SYNC_MOTD + threadMessage->terminateThread(); +#else threadDB->terminateThread(); +#endif } UserInterface::~UserInterface() @@ -603,6 +614,119 @@ void UserInterface::settingsApplied(int _contentMode, bool languageChanged) } } +#ifdef GTA5SYNC_MOTD +void UserInterface::messagesArrived(const QJsonObject &object) +{ + QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); + settings.beginGroup("Messages"); + QJsonObject::const_iterator it = object.constBegin(); + QJsonObject::const_iterator end = object.constEnd(); + QStringList messages; + while (it != end) { + const QString key = it.key(); + const QJsonValue value = it.value(); + bool uintOk; + uint messageId = key.toUInt(&uintOk); + if (uintOk && value.isString()) { + const QString valueStr = value.toString(); + settings.setValue(QString::number(messageId), valueStr); + messages << valueStr; + } + it++; + } + settings.endGroup(); + if (!messages.isEmpty()) + showMessages(messages); +} + +void UserInterface::showMessages(const QStringList messages) +{ + QDialog *messageDialog = new QDialog(this); + messageDialog->setWindowTitle(tr("%1 - Messages").arg(GTA5SYNC_APPSTR)); + messageDialog->setWindowFlags(messageDialog->windowFlags()^Qt::WindowContextHelpButtonHint); + QVBoxLayout *messageLayout = new QVBoxLayout; + messageDialog->setLayout(messageLayout); + QStackedWidget *stackWidget = new QStackedWidget(messageDialog); + for (const QString message : messages) { + QLabel *messageLabel = new QLabel(messageDialog); + messageLabel->setText(message); + messageLabel->setWordWrap(true); + stackWidget->addWidget(messageLabel); + } + messageLayout->addWidget(stackWidget); + QHBoxLayout *buttonLayout = new QHBoxLayout; + QPushButton *backButton = new QPushButton(messageDialog); + QPushButton *nextButton = new QPushButton(messageDialog); + if (QIcon::hasThemeIcon("go-previous") && QIcon::hasThemeIcon("go-next") && QIcon::hasThemeIcon("list-add")) { + backButton->setIcon(QIcon::fromTheme("go-previous")); + nextButton->setIcon(QIcon::fromTheme("go-next")); + } + else { + backButton->setIcon(QIcon(":/img/back.svgz")); + nextButton->setIcon(QIcon(":/img/next.svgz")); + } + backButton->setEnabled(false); + if (stackWidget->count() <= 1) { + nextButton->setEnabled(false); + } + buttonLayout->addWidget(backButton); + buttonLayout->addWidget(nextButton); + buttonLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum)); + QPushButton *closeButton = new QPushButton(messageDialog); + closeButton->setText(tr("&Close")); + if (QIcon::hasThemeIcon("dialog-close")) { + closeButton->setIcon(QIcon::fromTheme("dialog-close")); + } + else if (QIcon::hasThemeIcon("gtk-close")) { + closeButton->setIcon(QIcon::fromTheme("gtk-close")); + } + buttonLayout->addWidget(closeButton); + messageLayout->addLayout(buttonLayout); + QObject::connect(backButton, &QPushButton::clicked, [stackWidget,backButton,nextButton,closeButton]() { + int index = stackWidget->currentIndex(); + if (index > 0) { + index--; + stackWidget->setCurrentIndex(index); + nextButton->setEnabled(true); + if (index > 0) { + backButton->setEnabled(true); + } + else { + backButton->setEnabled(false); + closeButton->setFocus(); + } + } + }); + QObject::connect(nextButton, &QPushButton::clicked, [stackWidget,backButton,nextButton,closeButton]() { + int index = stackWidget->currentIndex(); + if (index < stackWidget->count()-1) { + index++; + stackWidget->setCurrentIndex(index); + backButton->setEnabled(true); + if (index < stackWidget->count()-1) { + nextButton->setEnabled(true); + } + else { + nextButton->setEnabled(false); + closeButton->setFocus(); + } + } + }); + QObject::connect(closeButton, &QPushButton::clicked, messageDialog, &QDialog::accept); + QObject::connect(messageDialog, &QDialog::finished, messageDialog, &QDialog::deleteLater); + QTimer::singleShot(0, closeButton, SLOT(setFocus())); + messageDialog->show(); +} + +void UserInterface::updateCacheId(uint cacheId) +{ + QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); + settings.beginGroup("Messages"); + settings.setValue("CacheId", cacheId); + settings.endGroup(); +} +#endif + void UserInterface::on_actionSelect_GTA_Folder_triggered() { QString GTAV_Folder_Temp = QFileDialog::getExistingDirectory(this, tr("Select RDR 2 Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly); diff --git a/UserInterface.h b/UserInterface.h index d88b281..826961e 100644 --- a/UserInterface.h +++ b/UserInterface.h @@ -31,6 +31,10 @@ #include #include +#ifdef GTA5SYNC_MOTD +#include "MessageThread.h" +#endif + namespace Ui { class UserInterface; } @@ -39,7 +43,11 @@ class UserInterface : public QMainWindow { Q_OBJECT public: +#ifdef GTA5SYNC_MOTD + explicit UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, MessageThread *messageThread, QWidget *parent = 0); +#else explicit UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent = 0); +#endif void setupDirEnv(); ~UserInterface(); @@ -67,6 +75,11 @@ private slots: void on_actionSet_Crew_triggered(); void on_actionSet_Title_triggered(); void settingsApplied(int contentMode, bool languageChanged); +#ifdef GTA5SYNC_MOTD + void messagesArrived(const QJsonObject &object); + void showMessages(const QStringList messages); + void updateCacheId(uint cacheId); +#endif protected: void closeEvent(QCloseEvent *ev); @@ -75,6 +88,9 @@ private: ProfileDatabase *profileDB; CrewDatabase *crewDB; DatabaseThread *threadDB; +#ifdef GTA5SYNC_MOTD + MessageThread *threadMessage; +#endif Ui::UserInterface *ui; ProfileInterface *profileUI; QList profileBtns; diff --git a/config.h b/config.h index 71ba2ca..eaea9dc 100644 --- a/config.h +++ b/config.h @@ -44,7 +44,7 @@ #endif #ifndef GTA5SYNC_APPVER -#define GTA5SYNC_APPVER "0.3.0" +#define GTA5SYNC_APPVER "0.4.0" #endif #if __cplusplus @@ -107,22 +107,16 @@ #define GTA5SYNC_INLANG ":/tr" #endif #endif -#endif - +#else #ifndef GTA5SYNC_SHARE #define GTA5SYNC_SHARE "RUNDIR:" #endif - #ifndef GTA5SYNC_LANG #define GTA5SYNC_LANG "SHAREDDIR:SEPARATOR:lang" #endif - #ifndef GTA5SYNC_PLUG #define GTA5SYNC_PLUG "RUNDIR:SEPARATOR:plugins" #endif - -#ifdef GTA5SYNC_WINRT -#undef GTA5SYNC_WIN #endif #ifndef GTA5SYNC_COMPILER diff --git a/main.cpp b/main.cpp index a806646..d63b223 100644 --- a/main.cpp +++ b/main.cpp @@ -31,7 +31,6 @@ #include "IconLoader.h" #include "AppEnv.h" #include "config.h" -#include #include #include #include @@ -54,11 +53,19 @@ #include #include -#ifdef GTA5SYNC_WIN +#if QT_VERSION < 0x060000 +#include +#endif + +#ifdef Q_OS_WIN #include "windows.h" #include #endif +#ifdef GTA5SYNC_MOTD +#include "MessageThread.h" +#endif + #ifdef GTA5SYNC_TELEMETRY #include "TelemetryClass.h" #endif @@ -66,16 +73,16 @@ int main(int argc, char *argv[]) { #if QT_VERSION >= 0x050600 +#if QT_VERSION < 0x060000 QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif #endif QApplication a(argc, argv); a.setApplicationName(GTA5SYNC_APPSTR); a.setApplicationVersion(GTA5SYNC_APPVER); a.setQuitOnLastWindowClosed(false); - QResource::registerResource(":/global/global.rcc"); - QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); settings.beginGroup("Startup"); @@ -99,25 +106,12 @@ int main(int argc, char *argv[]) } } -#ifdef GTA5SYNC_WIN +#ifdef Q_OS_WIN #if QT_VERSION >= 0x050400 bool alwaysUseMessageFont = settings.value("AlwaysUseMessageFont", false).toBool(); if (QSysInfo::windowsVersion() >= 0x0080 || alwaysUseMessageFont) { - // Get Windows Font - NONCLIENTMETRICS ncm; - ncm.cbSize = sizeof(ncm); - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); - LOGFONTW uiFont = ncm.lfMessageFont; - QString uiFontStr(QString::fromStdWString(std::wstring(uiFont.lfFaceName))); - -#ifdef GTA5SYNC_DEBUG - qDebug() << QApplication::tr("Font") << QApplication::tr("Selected Font: %1").arg(uiFontStr); -#endif - - // Set Application Font - QFont appFont(uiFontStr, 9); - a.setFont(appFont); + a.setFont(QApplication::font("QMenu")); } #endif #endif @@ -260,9 +254,7 @@ int main(int argc, char *argv[]) bool readOk = picture.readingPictureFromFile(arg1); picDialog.setWindowIcon(IconLoader::loadingAppIcon()); picDialog.setSnapmaticPicture(&picture, readOk); -#ifndef Q_OS_LINUX picDialog.setWindowFlags(picDialog.windowFlags()^Qt::Dialog^Qt::Window); -#endif int crewID = picture.getSnapmaticProperties().crewID; if (crewID != 0) { crewDB.addCrew(crewID); } @@ -307,7 +299,26 @@ int main(int argc, char *argv[]) QObject::connect(&threadDB, SIGNAL(finished()), &a, SLOT(quit())); threadDB.start(); +#ifdef GTA5SYNC_MOTD + uint cacheId; + { + QSettings messageSettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); + messageSettings.beginGroup("Messages"); + cacheId = messageSettings.value("CacheId", 0).toUInt(); + messageSettings.endGroup(); + } + MessageThread threadMessage(cacheId); + QObject::connect(&threadMessage, SIGNAL(finished()), &threadDB, SLOT(terminateThread())); + threadMessage.start(); +#endif + +#ifdef GTA5SYNC_MOTD + UserInterface uiWindow(&profileDB, &crewDB, &threadDB, &threadMessage); + QObject::connect(&threadMessage, SIGNAL(messagesArrived(QJsonObject)), &uiWindow, SLOT(messagesArrived(QJsonObject))); + QObject::connect(&threadMessage, SIGNAL(updateCacheId(uint)), &uiWindow, SLOT(updateCacheId(uint))); +#else UserInterface uiWindow(&profileDB, &crewDB, &threadDB); +#endif uiWindow.setWindowIcon(IconLoader::loadingAppIcon()); uiWindow.setupDirEnv(); #ifdef Q_OS_ANDROID diff --git a/rdr2view.pro b/rdr2view.pro index acb3f70..ea6db07 100644 --- a/rdr2view.pro +++ b/rdr2view.pro @@ -16,7 +16,7 @@ #* along with this program. If not, see . #*****************************************************************************/ -QT += core gui network svg +QT += core gui network svg greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): greaterThan(QT_MINOR_VERSION, 1): win32: QT += winextras @@ -40,6 +40,7 @@ SOURCES += main.cpp \ ImportDialog.cpp \ JsonEditorDialog.cpp \ MapLocationDialog.cpp \ + MessageThread.cpp \ OptionsDialog.cpp \ PictureDialog.cpp \ PictureExport.cpp \ @@ -69,7 +70,7 @@ SOURCES += main.cpp \ uimod/UiModLabel.cpp \ uimod/UiModWidget.cpp -HEADERS += \ +HEADERS += \ AboutDialog.h \ AppEnv.h \ CrewDatabase.h \ @@ -81,6 +82,7 @@ HEADERS += \ ImportDialog.h \ JsonEditorDialog.h \ MapLocationDialog.h \ + MessageThread.h \ OptionsDialog.h \ PictureDialog.h \ PictureExport.h \ @@ -112,7 +114,7 @@ HEADERS += \ uimod/UiModLabel.h \ uimod/UiModWidget.h -FORMS += \ +FORMS += \ AboutDialog.ui \ ExportDialog.ui \ ImportDialog.ui \ @@ -160,8 +162,9 @@ INCLUDEPATH += ./anpro ./pcg ./tmext ./uimod # GTA5SYNC/GTA5VIEW/RDR2VIEW ONLY -DEFINES += GTA5SYNC_PROJECT # Enable exclusive gta5sync/gta5view/rdr2view functions -DEFINES += GTA5SYNC_NOASSIST # Not assisting at proper usage of SnapmaticPicture class +DEFINES += GTA5SYNC_QMAKE # We using qmake do we? +DEFINES += GTA5SYNC_PROJECT # Enable exclusive gta5sync/gta5view functions +DEFINES += SNAPMATIC_NODEFAULT # Not assisting at proper usage of SnapmaticPicture class # WINDOWS ONLY @@ -229,9 +232,21 @@ contains(DEFINES, GTA5SYNC_QCONF){ # TELEMETRY BASED STUFF -!contains(DEFINES, GTA5SYNC_TELEMETRY){ +!contains(DEFINES, GTA5SYNC_TELEMETRY) { SOURCES -= TelemetryClass.cpp \ tmext/TelemetryClassAuthenticator.cpp HEADERS -= TelemetryClass.h \ tmext/TelemetryClassAuthenticator.h } + +!contains(DEFINES, GTA5SYNC_MOTD) { + SOURCES -= MessageThread.cpp + HEADERS -= MessageThread.h +} else { + lessThan(QT_MAJOR_VERSION, 5) { + SOURCES -= MessageThread.cpp + HEADERS -= MessageThread.h + DEFINES -= GTA5SYNC_MOTD + message("Messages require Qt5 or newer!") + } +} diff --git a/res/app.rc b/res/app.rc index 09dcbb4..43d9d59 100644 --- a/res/app.rc +++ b/res/app.rc @@ -7,8 +7,8 @@ CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "rdr2view.exe.manifest" #include VS_VERSION_INFO VERSIONINFO -FILEVERSION 0, 3, 0, 0 -PRODUCTVERSION 0, 3, 0, 0 +FILEVERSION 0, 4, 0, 0 +PRODUCTVERSION 0, 4, 0, 0 FILEFLAGSMASK 0x3fL FILEFLAGS 0 FILEOS VOS_NT_WINDOWS32 @@ -25,12 +25,12 @@ BEGIN BEGIN VALUE "CompanyName", "Syping" VALUE "FileDescription", "rdr2view" - VALUE "FileVersion", "0.3.0" + VALUE "FileVersion", "0.4.0" VALUE "InternalName", "rdr2view" VALUE "LegalCopyright", "Copyright 2016-2020 Syping" VALUE "OriginalFilename", "rdr2view.exe" VALUE "ProductName", "rdr2view" - VALUE "ProductVersion", "0.3.0" + VALUE "ProductVersion", "0.4.0" END END END diff --git a/res/gta5sync.ts b/res/gta5sync.ts index 7c0108e..bf83118 100644 --- a/res/gta5sync.ts +++ b/res/gta5sync.ts @@ -191,21 +191,21 @@ Pictures and Savegames - - + + Snapmatic Image Editor - + Patching of Snapmatic Image failed because of I/O Error - + Patching of Snapmatic Image failed because of Image Error @@ -343,14 +343,14 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! - + Custom Picture Custom Picture Description in SC, don't use Special Character! @@ -991,80 +991,80 @@ Y: %2 - - + + Export as &Picture... - - + + Export as &Snapmatic... - - + + &Edit Properties... - - + + &Overwrite Image... - - + + Open &Map Viewer... - - + + Open &JSON Editor... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate - - + + Snapmatic Picture Viewer - - + + Failed at %1 - - - + + + No Players - - + + No Crew - + Unknown Location - + Avatar Preview Mode Press 1 for Default View @@ -1274,23 +1274,23 @@ Press 1 for Default View - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + Import... @@ -1307,226 +1307,226 @@ Press 1 for Default View - + All image files (%1) - - + + All files (**) - + Can't import %1 because file can't be open - + Can't import %1 because file can't be parsed properly - + Enabled pictures: %1 of %2 - + Loading... - + Snapmatic Loader - + <h4>Following Snapmatic Pictures got repaired</h4>%1 - + Importable files (%1) - - - + + + No valid file is selected - - + + Import file %1 of %2 files - + Import failed with... %1 - - + + Failed to read Snapmatic picture - - + + Failed to read Savegame file - + Can't import %1 because file format can't be detected - + Prepare Content for Import... - - + + RDR 2 Export (*.r5e) - - + + Savegames files (SRDR*) - - + + Snapmatic pictures (PRDR*) - + Failed to import the Snapmatic picture, file not begin with PRDR or end with .r5e - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? - + Failed to import the Snapmatic picture, can't copy the file into profile - + Failed to import the Savegame, can't copy the file into profile - + Failed to import the Savegame, no Savegame slot is left - - - - - + + + + + Export selected... - - + + JPG pictures and GTA Snapmatic - - + + JPG pictures only - - + + GTA Snapmatic only - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: - + Initialising export... - + Export failed with... %1 - - + + No Snapmatic pictures or Savegames files are selected - - - + + + Remove selected - + You really want remove the selected Snapmatic picutres and Savegame files? - + Failed to remove all selected Snapmatic pictures and/or Savegame files - - - - - - + + + + + + No Snapmatic pictures are selected - - - - - - + + + + + + %1 failed with... %2 @@ -1534,87 +1534,87 @@ Press 1 for Default View - - + + Qualify as Avatar - - - - + + + + Patch selected... - - - - - - - - + + + + + + + + Patch file %1 of %2 files - + Qualify %1 failed with... - - + + Change Players... - + Change Players %1 failed with... - - - + + + Change Crew... - + Failed to enter a valid Snapmatic Crew ID - + Change Crew %1 failed with... - - - + + + Change Title... - + Failed to enter a valid Snapmatic title - + Change Title %1 failed with... - + All profile files (*.r5e SRDR* PRDR*) @@ -1622,17 +1622,7 @@ Press 1 for Default View QApplication - - Font - - - - - Selected Font: %1 - - - - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? @@ -1710,37 +1700,37 @@ Press 1 for Default View - + &View - + &Export - + &Remove - + &Select - + &Deselect - + Select &All - + &Deselect All @@ -1838,8 +1828,8 @@ Press 1 for Default View - - + + Snapmatic Properties @@ -1931,8 +1921,8 @@ Press 1 for Default View - - + + Patching of Snapmatic Properties failed because of I/O Error @@ -1943,73 +1933,73 @@ Press 1 for Default View - - + + Snapmatic Crew - - + + New Snapmatic crew: - - + + Snapmatic Title - - + + New Snapmatic title: - - - + + + Edit - + Players: %1 (%2) Multiple Player are inserted here - + Player: %1 (%2) One Player is inserted here - + Title: %1 (%2) - - + + Appropriate: %1 - + Yes Yes, should work fine - + No No, could lead to issues - + Crew: %1 (%2) @@ -2018,64 +2008,64 @@ Press 1 for Default View SnapmaticPicture - + JSON is incomplete and malformed - + JSON is incomplete - + JSON is malformed - + PHOTO - %1 - + open file %1 - + header not exists - + header is malformed - + picture not exists (%1) - + JSON not exists (%1) - + title not exists (%1) - + description not exists (%1) - + reading file %1 because of %2 Example for %2: JSON is malformed error @@ -2136,52 +2126,52 @@ Press 1 for Default View - + Edi&t - + Show &In-game - + Hide &In-game - + &Export - + &View - + &Remove - + &Select - + &Deselect - + Select &All - + &Deselect All @@ -2209,22 +2199,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? - + %1 User Statistics - + Yes, I want include personal usage data. - + &OK @@ -2233,7 +2223,7 @@ Press 1 for Default View UserInterface - + %2 - %1 @@ -2265,6 +2255,7 @@ Press 1 for Default View + &Close @@ -2300,8 +2291,8 @@ Press 1 for Default View - - + + &About %1 @@ -2357,15 +2348,15 @@ Press 1 for Default View - + Select &RDR 2 Folder... - - + + Select RDR 2 Folder... @@ -2400,43 +2391,48 @@ Press 1 for Default View - - + + Show In-game - - + + Hide In-game - - - + + + Select Profile - + Open File... - - - - + + + + Open File - + Can't open %1 because of not valid file format + + + %1 - Messages + + diff --git a/res/gta5sync_de.qm b/res/gta5sync_de.qm index c56c1c8..c27de78 100644 Binary files a/res/gta5sync_de.qm and b/res/gta5sync_de.qm differ diff --git a/res/gta5sync_de.ts b/res/gta5sync_de.ts index c45f6fc..d59e876 100644 --- a/res/gta5sync_de.ts +++ b/res/gta5sync_de.ts @@ -176,8 +176,8 @@ Snapmatic Bilder und Spielständen ImageEditorDialog - - + + Snapmatic Image Editor @@ -209,13 +209,13 @@ Snapmatic Bilder und Spielständen S&chließen - + Patching of Snapmatic Image failed because of I/O Error Patchen von Snapmatic Bild fehlgeschlagen wegen I/O Fehler - + Patching of Snapmatic Image failed because of Image Error Patchen von Snapmatic Bild fehlgeschlagen wegen Bild Fehler @@ -359,14 +359,14 @@ Snapmatic Bilder und Spielständen - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! Eigener Avatar - + Custom Picture Custom Picture Description in SC, don't use Special Character! Eigenes Bild @@ -1012,37 +1012,37 @@ Y: %2 Exportieren - - + + Export as &Picture... Als &Bild exportieren... - - + + Export as &Snapmatic... Als &Snapmatic exportieren... - - + + &Edit Properties... Eigenschaften bearb&eiten... - - + + &Overwrite Image... Bild &überschreiben... - - + + Open &Map Viewer... &Kartenansicht öffnen... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1051,39 +1051,39 @@ Taste 2 - Overlay umschalten Pfeiltasten - Navigieren - - + + Snapmatic Picture Viewer Snapmatic Bildansicht - - + + Failed at %1 Fehlgeschlagen beim %1 - - + + No Crew Keine Crew - - - + + + No Players Keine Spieler - + Avatar Preview Mode Press 1 for Default View Avatar Vorschaumodus Drücke 1 für Standardmodus - + Unknown Location Unbekannter Standort @@ -1185,8 +1185,8 @@ Drücke 1 für Standardmodus Keine gültige Datei wurde ausgewählt - - + + Open &JSON Editor... &JSON Editor öffnen... @@ -1284,40 +1284,40 @@ Drücke 1 für Standardmodus S&chließen - + Loading... Lade... - + Snapmatic Loader Snapmatic Lader - + <h4>Following Snapmatic Pictures got repaired</h4>%1 <h4>Folgende Snapmatic Bilder wurden repariert</h4>%1 - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + Import... Importieren... @@ -1332,45 +1332,45 @@ Drücke 1 für Standardmodus Importieren - - + + Savegames files (SRDR*) Spielstanddateien (SRDR*) - - + + Snapmatic pictures (PRDR*) Snapmatic Bilder (PRDR*) - + Importable files (%1) Importfähige Dateien (%1) - + All image files (%1) Alle Bilddateien (%1) - - + + All files (**) Alle Dateien (**) - - + + Import file %1 of %2 files Importiere Datei %1 von %2 Dateien - + Import failed with... %1 @@ -1379,149 +1379,149 @@ Drücke 1 für Standardmodus %1 - - + + Failed to read Snapmatic picture Fehler beim Lesen vom Snapmatic Bild - - + + Failed to read Savegame file Fehler beim Lesen von Spielstanddatei - + Can't import %1 because file can't be open Kann %1 nicht importieren weil die Datei nicht geöffnet werden kann - + Can't import %1 because file can't be parsed properly Kann %1 nicht importieren weil die Datei nicht richtig gelesen werden kann - + Can't import %1 because file format can't be detected Kann %1 nicht importieren weil das Dateiformat nicht erkannt werden kann - + Initialising export... Initialisiere Export... - + Failed to import the Snapmatic picture, file not begin with PRDR or end with .r5e Fehlgeschlagen beim Importieren vom Snapmatic Bild, Datei beginnt nicht mit PRDR oder endet mit .r5e - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1Exportiere Snapmatic Bilder%2<br><br>JPG Bilder machen es möglich sie mit ein Bildansicht Programm zu öffnen<br>Das GTA Snapmatic Format macht es möglich sie wieder ins Game zu importieren<br><br>Exportieren als: - - - + + + No valid file is selected Keine gültige Datei wurde ausgewählt - + Enabled pictures: %1 of %2 Aktivierte Bilder: %1 von %2 - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? Ein Snapmatic Bild mit der Uid %1 existiert bereits, möchtest du dein Import eine neue Uid und Zeitstempel zuweisen? - + Failed to import the Snapmatic picture, can't copy the file into profile Fehlgeschlagen beim Importieren vom Snapmatic Bild, kann Snapmatic Bild nicht ins Profil kopieren - + Failed to import the Savegame, can't copy the file into profile Fehlgeschlagen beim Importieren vom Spielstand, kann Spielstanddatei nicht ins Profil kopieren - + Failed to import the Savegame, no Savegame slot is left Fehlgeschlagen beim Importieren vom Spielstand, kein Spielstandslot mehr frei - - + + JPG pictures and GTA Snapmatic JPG Bilder und GTA Snapmatic - - + + JPG pictures only Nur JPG Bilder - - + + GTA Snapmatic only Nur GTA Snapmatic - - - - + + + + Patch selected... Auswahl patchen... - - - - - - - - + + + + + + + + Patch file %1 of %2 files Patche Datei %1 von %2 Dateien - - + + Qualify as Avatar Als Avatar qualifizieren - - - - - - + + + + + + No Snapmatic pictures are selected Keine Snapmatic Bilder sind ausgewählt - + Failed to remove all selected Snapmatic pictures and/or Savegame files Fehlgeschlagen beim Entfernen von allen augewählten Snapmatic Bildern und/oder Spielstanddateien - - - - - - + + + + + + %1 failed with... %2 @@ -1531,93 +1531,93 @@ Drücke 1 für Standardmodus %2 - + Prepare Content for Import... Bereite Inhalt für Import vor... - + Qualify %1 failed with... Qualifizieren - - + + Change Players... Spieler ändern... - + Change Players %1 failed with... Spieler ändern - - - + + + Change Crew... Crew ändern... - + Failed to enter a valid Snapmatic Crew ID Fehlgeschlagen beim Eingeben von einer gültigen Crew ID - + Change Crew %1 failed with... Crew ändern - - - + + + Change Title... Titel ändern... - + Failed to enter a valid Snapmatic title Fehlgeschlagen beim Eingeben eines gültigen Snapmatic Titel - + Change Title %1 failed with... Titel ändern - - + + No Snapmatic pictures or Savegames files are selected Keine Snapmatic Bilder oder Spielstände sind ausgewählt - - - + + + Remove selected Auswahl löschen - + You really want remove the selected Snapmatic picutres and Savegame files? Möchtest du wirklich die ausgewählten Snapmatic Bilder und Spielstanddateien löschen? - - - - - + + + + + Export selected... Auswahl exportieren... - + Export failed with... %1 @@ -1631,13 +1631,13 @@ Drücke 1 für Standardmodus Exportiere Datei %1 von %2 Dateien - + All profile files (*.r5e SRDR* PRDR*) Alle Profildateien (*.r5e SRDR* PRDR*) - - + + RDR 2 Export (*.r5e) RDR 2 Export (*.r5e) @@ -1645,17 +1645,15 @@ Drücke 1 für Standardmodus QApplication - Font - Schrift + Schrift - Selected Font: %1 - Ausgewähle Schrift: %1 + Ausgewähle Schrift: %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>Willkommen zu %1!</h4>Möchtest du %1 einstellen bevor du es nutzt? @@ -1771,32 +1769,32 @@ Drücke 1 für Standardmodus Fehlgeschlagen beim Löschen %1 von deinen Spielständen - + &View A&nsehen - + &Remove Entfe&rnen - + &Select Au&swählen - + &Deselect A&bwählen - + Select &All &Alles auswählen - + &Deselect All Alles a&bwählen @@ -1811,7 +1809,7 @@ Drücke 1 für Standardmodus Spielstand kopieren - + &Export &Exportieren @@ -1863,8 +1861,8 @@ Drücke 1 für Standardmodus - - + + Snapmatic Properties Snapmatic Eigenschaften @@ -1905,8 +1903,8 @@ Drücke 1 für Standardmodus Meme - - + + Snapmatic Title Snapmatic Titel @@ -1916,30 +1914,30 @@ Drücke 1 für Standardmodus Snapmatic Werte - + Crew: %1 (%2) Crew: %1 (%2) - + Title: %1 (%2) Titel: %1 (%2) - + Players: %1 (%2) Multiple Player are inserted here Spieler: %1 (%2) - + Player: %1 (%2) One Player is inserted here Spieler: %1 (%2) - - + + Appropriate: %1 Angemessen: %1 @@ -1979,20 +1977,20 @@ Drücke 1 für Standardmodus Abbre&chen - - - + + + Edit Bearbeiten - + Yes Yes, should work fine Ja - + No No, could lead to issues Nein @@ -2014,27 +2012,27 @@ Drücke 1 für Standardmodus - - + + Patching of Snapmatic Properties failed because of I/O Error Patchen von Snapmatic Eigenschaften fehlgeschlagen wegen I/O Fehler - - + + New Snapmatic title: Neuer Snapmatic Titel: - - + + Snapmatic Crew Snapmatic Crew - - + + New Snapmatic crew: Neue Snapmatic Crew: @@ -2042,66 +2040,66 @@ Drücke 1 für Standardmodus SnapmaticPicture - + PHOTO - %1 FOTO - %1 - + open file %1 Datei öffnen %1 - + header not exists Header nicht existiert - + header is malformed Header fehlerhaft ist - + picture not exists (%1) Bild nicht existiert (%1) - + JSON not exists (%1) JSON nicht existiert (%1) - + title not exists (%1) Titel nicht existiert (%1) - + description not exists (%1) Beschreibung nicht existiert (%1) - + reading file %1 because of %2 Example for %2: JSON is malformed error Datei lesen von %1 weil %2 - + JSON is incomplete and malformed JSON ist unvollständig und Fehlerhaft - + JSON is incomplete JSON ist unvollständig - + JSON is malformed JSON ist Fehlerhaft @@ -2161,52 +2159,52 @@ Drücke 1 für Standardmodus Fehlgeschlagen beim Anzeigen von %1 im Spiel von deinen Snapmatic Bildern - + Edi&t Bearbei&ten - + &Export &Exportieren - + Show &In-game &Im Spiel anzeigen - + Hide &In-game &Im Spiel ausblenden - + &View A&nsehen - + &Remove Entfe&rnen - + &Select Au&swählen - + &Deselect A&bwählen - + Select &All Alles &auswählen - + &Deselect All Alles a&bwählen @@ -2234,22 +2232,22 @@ Drücke 1 für Standardmodus TelemetryDialog - + %1 User Statistics %1 Benutzerstatistik - + You want help %1 to improve in the future by including personal usage data in your submission? Sollen bei Einreichungen Persönliche Nutzungsdaten einbezogen werden um %1 in der Zukunft zu unterstützen? - + Yes, I want include personal usage data. Ja, ich möchte Persönliche Nutzungsdaten einbeziehen. - + &OK &OK @@ -2349,7 +2347,7 @@ Drücke 1 für Standardmodus - + Select &RDR 2 Folder... Wähle &RDR 2 Ordner... @@ -2365,6 +2363,7 @@ Drücke 1 für Standardmodus + &Close S&chließen @@ -2399,66 +2398,71 @@ Drücke 1 für Standardmodus Dateien &importieren... - - - + + + Select Profile Profil auswählen - - + + Select RDR 2 Folder... Wähle RDR 2 Ordner... - + Open File... Datei öffnen... - + %2 - %1 %2 - %1 - - + + &About %1 &Über %1 - - - - + + + + Open File Datei öffnen - + Can't open %1 because of not valid file format Kann nicht %1 öffnen weil Dateiformat nicht gültig ist + + + %1 - Messages + + &Reload &Neuladen - - + + Show In-game Im Spiel anzeigen - - + + Hide In-game Im Spiel ausblenden diff --git a/res/gta5sync_en_US.qm b/res/gta5sync_en_US.qm index da80daf..502289e 100644 Binary files a/res/gta5sync_en_US.qm and b/res/gta5sync_en_US.qm differ diff --git a/res/gta5sync_en_US.ts b/res/gta5sync_en_US.ts index 08eb6e7..8caf75a 100644 --- a/res/gta5sync_en_US.ts +++ b/res/gta5sync_en_US.ts @@ -166,8 +166,8 @@ Pictures and Savegames ImageEditorDialog - - + + Snapmatic Image Editor @@ -199,13 +199,13 @@ Pictures and Savegames - + Patching of Snapmatic Image failed because of I/O Error - + Patching of Snapmatic Image failed because of Image Error @@ -349,14 +349,14 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! - + Custom Picture Custom Picture Description in SC, don't use Special Character! @@ -991,74 +991,74 @@ Y: %2 - - + + Export as &Picture... - - + + Export as &Snapmatic... - - + + &Overwrite Image... - - + + &Edit Properties... - - + + Open &Map Viewer... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate - - + + Snapmatic Picture Viewer - - + + Failed at %1 - - - + + + No Players - - + + No Crew - + Unknown Location - + Avatar Preview Mode Press 1 for Default View @@ -1167,8 +1167,8 @@ Press 1 for Default View - - + + Open &JSON Editor... @@ -1272,45 +1272,45 @@ Press 1 for Default View - + Enabled pictures: %1 of %2 - + Loading... - + Snapmatic Loader - + <h4>Following Snapmatic Pictures got repaired</h4>%1 - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + Import... @@ -1325,219 +1325,219 @@ Press 1 for Default View - + Importable files (%1) - - + + RDR 2 Export (*.r5e) - - + + Savegames files (SRDR*) - - + + Snapmatic pictures (PRDR*) - + All image files (%1) - - + + All files (**) - - - + + + No valid file is selected - - + + Import file %1 of %2 files - + Import failed with... %1 - - + + Failed to read Snapmatic picture - - + + Failed to read Savegame file - + Can't import %1 because file can't be open - + Can't import %1 because file can't be parsed properly - + Can't import %1 because file format can't be detected - + Failed to import the Snapmatic picture, file not begin with PRDR or end with .r5e - + Failed to import the Snapmatic picture, can't copy the file into profile - + Failed to import the Savegame, can't copy the file into profile - + Failed to import the Savegame, no Savegame slot is left - - + + JPG pictures and GTA Snapmatic - - + + JPG pictures only - - + + GTA Snapmatic only - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: - - - - - + + + + + Export selected... - + Initialising export... Initializing export... - + Export failed with... %1 - - + + No Snapmatic pictures or Savegames files are selected - - - + + + Remove selected - + You really want remove the selected Snapmatic picutres and Savegame files? - - + + Qualify as Avatar - - - - - - + + + + + + No Snapmatic pictures are selected - - - - + + + + Patch selected... - - - - - - - - + + + + + + + + Patch file %1 of %2 files - - - - - - + + + + + + %1 failed with... %2 @@ -1545,76 +1545,76 @@ Press 1 for Default View - + Failed to remove all selected Snapmatic pictures and/or Savegame files - + Prepare Content for Import... - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? - + Qualify %1 failed with... - - + + Change Players... - + Change Players %1 failed with... - - - + + + Change Crew... - + Failed to enter a valid Snapmatic Crew ID - + Change Crew %1 failed with... - - - + + + Change Title... - + Failed to enter a valid Snapmatic title - + Change Title %1 failed with... - + All profile files (*.r5e SRDR* PRDR*) @@ -1622,17 +1622,7 @@ Press 1 for Default View QApplication - - Font - - - - - Selected Font: %1 - - - - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? @@ -1710,37 +1700,37 @@ Press 1 for Default View - + &View - + &Export - + &Remove - + &Select - + &Deselect - + Select &All - + &Deselect All @@ -1838,8 +1828,8 @@ Press 1 for Default View - - + + Snapmatic Properties @@ -1885,30 +1875,30 @@ Press 1 for Default View - + Crew: %1 (%2) - + Title: %1 (%2) - + Players: %1 (%2) Multiple Player are inserted here - + Player: %1 (%2) One Player is inserted here - - + + Appropriate: %1 @@ -1948,20 +1938,20 @@ Press 1 for Default View - - - + + + Edit - + Yes Yes, should work fine - + No No, could lead to issues @@ -1983,33 +1973,33 @@ Press 1 for Default View - - + + Patching of Snapmatic Properties failed because of I/O Error - - + + Snapmatic Title - - + + New Snapmatic title: - - + + Snapmatic Crew - - + + New Snapmatic crew: @@ -2017,66 +2007,66 @@ Press 1 for Default View SnapmaticPicture - + PHOTO - %1 - + open file %1 - + header not exists - + header is malformed - + picture not exists (%1) - + JSON not exists (%1) - + title not exists (%1) - + description not exists (%1) - + reading file %1 because of %2 Example for %2: JSON is malformed error - + JSON is incomplete and malformed - + JSON is incomplete - + JSON is malformed @@ -2136,52 +2126,52 @@ Press 1 for Default View - + Edi&t - + Show &In-game - + Hide &In-game - + &Export - + &View - + &Remove - + &Select - + &Deselect - + Select &All - + &Deselect All @@ -2209,22 +2199,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? - + %1 User Statistics - + Yes, I want include personal usage data. - + &OK @@ -2233,7 +2223,7 @@ Press 1 for Default View UserInterface - + %2 - %1 @@ -2265,6 +2255,7 @@ Press 1 for Default View + &Close @@ -2295,8 +2286,8 @@ Press 1 for Default View - - + + &About %1 @@ -2352,15 +2343,15 @@ Press 1 for Default View - + Select &RDR 2 Folder... - - + + Select RDR 2 Folder... @@ -2400,40 +2391,45 @@ Press 1 for Default View - - - + + + Select Profile - + Open File... - - - - + + + + Open File - + Can't open %1 because of not valid file format - - + + %1 - Messages + + + + + Show In-game - - + + Hide In-game diff --git a/res/gta5sync_fr.qm b/res/gta5sync_fr.qm index aed1709..cd446a9 100644 Binary files a/res/gta5sync_fr.qm and b/res/gta5sync_fr.qm differ diff --git a/res/gta5sync_fr.ts b/res/gta5sync_fr.ts index b4e5f74..498246e 100644 --- a/res/gta5sync_fr.ts +++ b/res/gta5sync_fr.ts @@ -176,8 +176,8 @@ et les fichiers de sauvegarde de Red Dead Redemption 2 ImageEditorDialog - - + + Snapmatic Image Editor @@ -209,13 +209,13 @@ et les fichiers de sauvegarde de Red Dead Redemption 2 &Fermer - + Patching of Snapmatic Image failed because of I/O Error Échec du patch Snapmatic : I/O Error - + Patching of Snapmatic Image failed because of Image Error Échec du patch Snapmatic : Image Error @@ -359,14 +359,14 @@ et les fichiers de sauvegarde de Red Dead Redemption 2 - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! Avatar personnalisé - + Custom Picture Custom Picture Description in SC, don't use Special Character! Image personnalisé @@ -1092,37 +1092,37 @@ Y : %2 Fichier invalide - - + + Export as &Picture... Exporter comme &image... - - + + Export as &Snapmatic... Exporter comme &Snapmatic... - - + + &Overwrite Image... &Remplacer l'image... - - + + &Edit Properties... Modifier les &propriétés... - - + + Open &Map Viewer... Ouvrir la &Visionneuse de Carte... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1131,39 +1131,39 @@ Touche 2 - Activer/désactiver l'overlay Touches fléchées - Naviguer - - + + Snapmatic Picture Viewer Visionneuse de photo Snapmatic - - + + Failed at %1 Echec de %1 - - + + No Crew Aucun crew - - - + + + No Players Aucun joueurs - + Avatar Preview Mode Press 1 for Default View Mode Aperçu Avatar Appuyer sur 1 pour le mode par défaut - + Unknown Location Emplacement inconnu @@ -1185,8 +1185,8 @@ Appuyer sur 1 pour le mode par défaut Échec de l'export de la photo Snapmatic - - + + Open &JSON Editor... Ouvrir l'éditeur &JSON... @@ -1290,45 +1290,45 @@ Appuyer sur 1 pour le mode par défaut Copie du fichier %1 sur %2 - + Enabled pictures: %1 of %2 Photos activées : %1 sur %2 - + Loading... Chargement... - + Snapmatic Loader Snapmatic Loader - + <h4>Following Snapmatic Pictures got repaired</h4>%1 <h4>Les Snapmatic suivants ont été répaés</h4>%1 - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + Import... Importer... @@ -1343,34 +1343,34 @@ Appuyer sur 1 pour le mode par défaut Importer - - + + Savegames files (SRDR*) Fichiers de sauvegarde GTA (SRDR*) - + All image files (%1) Toutes les images (%1) - - + + All files (**) Tous les fichiers (**) - - + + Import file %1 of %2 files Importation du fichier %1 sur %2 - + Import failed with... %1 @@ -1379,148 +1379,148 @@ Appuyer sur 1 pour le mode par défaut %1 - - - + + + No valid file is selected Fichier invalide - + Importable files (%1) Fichiers importables (%1) - - + + Failed to read Snapmatic picture Impossible d'ouvrir la photo Snapmatic - - + + Failed to read Savegame file Impossible de lire le fichier de sauvegarde - + Can't import %1 because file can't be open Impossible d'importer %1, le fichier ne peut pas être ouvert - + Can't import %1 because file can't be parsed properly Impossible d'importer %1, le fichier ne peut pas être parsé correctement - + Can't import %1 because file format can't be detected Impossible d'importer %1, le format du fichier n'est pas détecté - + Failed to import the Snapmatic picture, file not begin with PRDR or end with .r5e Impossible d'importer la photo Snapmatic,nom de fichier incorrect (PRDR*, *.r5e) - + Failed to import the Snapmatic picture, can't copy the file into profile Impossible d'importer la photo Snapmatic, impossible de copier le fichier dans le profil - + Failed to import the Savegame, can't copy the file into profile Impossible d'importer la sauvegarde, impossible de copier le fichier dans le profil - + Failed to import the Savegame, no Savegame slot is left Impossible d'importer la sauvegarde, aucun emplacement libre - - + + JPG pictures and GTA Snapmatic Images JPG et GTA Snapmatic - - + + JPG pictures only Images JPG seulement - - + + GTA Snapmatic only GTA Snapmatic seulement - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1Exporter les photos Snapmatic%2<br><br>Les fichiers JPG permettent d'ouvrir les photos avec une visionneuse d'images<br>Les GTA Snapmatic permettent d'importer les photos dans le jeu<br><br>Exporter comme : - - - - - + + + + + Export selected... Exporter la sélection... - + Initialising export... Initialisation de l'export... - - + + Qualify as Avatar Qualifier comme Avatar - - - - - - + + + + + + No Snapmatic pictures are selected Aucun Snapmatic sélectionné - - - - + + + + Patch selected... Patcher la sélection... - - - - - - - - + + + + + + + + Patch file %1 of %2 files Patch du fichier %1 sur %2 - - - - - - + + + + + + %1 failed with... %2 @@ -1530,82 +1530,82 @@ Appuyer sur 1 pour le mode par défaut %2 - + Failed to remove all selected Snapmatic pictures and/or Savegame files Échec de la supression des Snapmatic et/ou des fichiers de sauvegarde sélectionnés - + Prepare Content for Import... Préparation du contenu pour l'import... - - + + Snapmatic pictures (PRDR*) Fichiers GTA Snapmatic (PRDR*) - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? Un Snapmatic existe déjà avec le uid %1, voulez-vous assigner à votre import un nouvel uid et timestamp ? - + Qualify %1 failed with... Qualifier - - + + Change Players... Modifier les joueurs... - + Change Players %1 failed with... Modifier les joueurs - - - + + + Change Crew... Modifier le Crew... - + Failed to enter a valid Snapmatic Crew ID Snapmatic Crew ID invalide - + Change Crew %1 failed with... Changer le Crew - - - + + + Change Title... Changer le titre... - + Failed to enter a valid Snapmatic title Titre Snapmatic invalide - + Change Title %1 failed with... Changer le titre - + Export failed with... %1 @@ -1614,31 +1614,31 @@ Appuyer sur 1 pour le mode par défaut %1 - - + + No Snapmatic pictures or Savegames files are selected Aucun fichier de sauvegarde ou photo Snapmatic sélectionné - - - + + + Remove selected Supprimer la sélection - + You really want remove the selected Snapmatic picutres and Savegame files? Supprimer la sélection ? - + All profile files (*.r5e SRDR* PRDR*) Tous les fichiers de profil (*.r5e SRDR* PRDR*) - - + + RDR 2 Export (*.r5e) RDR 2 Export (*.r5e) @@ -1646,17 +1646,15 @@ Appuyer sur 1 pour le mode par défaut QApplication - Font - Police + Police - Selected Font: %1 - Police sélectionnée : %1 + Police sélectionnée : %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>Bienvenue sur %1!</h4>Voulez-vous configurer %1 avant de l'utiliser t? @@ -1734,7 +1732,7 @@ Appuyer sur 1 pour le mode par défaut Supprimer - + &Export &Exporter @@ -1825,32 +1823,32 @@ Appuyer sur 1 pour le mode par défaut Impossible de supprimer %1 - + &View &Voir - + &Remove &Supprimer - + &Select &Sélectionner - + &Deselect &Déselectionner - + Select &All Sélectionner to&ut - + &Deselect All &Déselectionner tout @@ -1864,8 +1862,8 @@ Appuyer sur 1 pour le mode par défaut - - + + Snapmatic Properties Propriétés Snapmatic @@ -1906,8 +1904,8 @@ Appuyer sur 1 pour le mode par défaut Meme - - + + Snapmatic Title Titre Snapmatic @@ -1917,30 +1915,30 @@ Appuyer sur 1 pour le mode par défaut Valeurs Snapmatic - + Crew: %1 (%2) Crew : %1 (%2) - + Title: %1 (%2) Titre : %1 (%2) - + Players: %1 (%2) Multiple Player are inserted here Joueurs : %1 (%2) - + Player: %1 (%2) One Player is inserted here Joueur : %1 (%2) - - + + Appropriate: %1 Valide : %1 @@ -1980,21 +1978,21 @@ Appuyer sur 1 pour le mode par défaut A&nnuler - - - + + + Edit Éditer - + Yes Yes, should work fine Oui, devrait fonctionner Oui - + No No, could lead to issues Non, pourrait causer des erreurs @@ -2017,27 +2015,27 @@ Appuyer sur 1 pour le mode par défaut - - + + Patching of Snapmatic Properties failed because of I/O Error La modification des propriétés Snapmatic a échoué : erreur d'entrée/sortie - - + + New Snapmatic title: Nouveau titre Snapmatic : - - + + Snapmatic Crew Crew Snapmatic - - + + New Snapmatic crew: Nouveau crew Snapmatic : @@ -2045,66 +2043,66 @@ Appuyer sur 1 pour le mode par défaut SnapmaticPicture - + PHOTO - %1 PHOTO - %1 - + open file %1 ouverture du fichier %1 - + header not exists les headers n'existent pas - + header is malformed les headers sont incorrects - + picture not exists (%1) l'image n'existe pas (%1) - + JSON not exists (%1) le JSON n'existe pas (%1) - + title not exists (%1) le titre n'existe pas (%1) - + description not exists (%1) la description n'existe pas (%1) - + reading file %1 because of %2 Example for %2: JSON is malformed error lecture du fichier %1 : %2 - + JSON is incomplete and malformed JSON incomplet ou incorrect - + JSON is incomplete JSON incomplet - + JSON is malformed JSON incorrect @@ -2184,52 +2182,52 @@ Appuyer sur 1 pour le mode par défaut %1 n'a pas pu être rendu visible en jeu - + Edi&t Édi&ter - + Show &In-game &Visible en jeu - + Hide &In-game &Invisible en jeu - + &Export &Exporter - + &View &Voir - + &Remove S&upprimer - + &Select &Sélectionner - + &Deselect &Déselectionner - + Select &All Sélectionner &tout - + &Deselect All &Déselectionner tout @@ -2237,22 +2235,22 @@ Appuyer sur 1 pour le mode par défaut TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? Voulez-vous aider au développement de %1 en transmettant vos données d'utilisation ? - + %1 User Statistics Statistiques utilisateurs %1 - + Yes, I want include personal usage data. Oui, je veux partager mes données d'utilisation. - + &OK &OK @@ -2287,6 +2285,7 @@ Appuyer sur 1 pour le mode par défaut + &Close Fer&mer @@ -2362,15 +2361,15 @@ Appuyer sur 1 pour le mode par défaut - + Select &RDR 2 Folder... Modifier l'emplacement de &RDR 2... - - + + Select RDR 2 Folder... Modifier l'emplacement de RDR 2... @@ -2416,52 +2415,57 @@ Appuyer sur 1 pour le mode par défaut - + %2 - %1 %2 - %1 - - + + &About %1 &À propos de %1 - - - + + + Select Profile Sélectionner un profil - + Open File... Ouvrir... - - - - + + + + Open File Ouvrir - + Can't open %1 because of not valid file format Impossible d'ouvrir %1, format invalide - - + + %1 - Messages + + + + + Show In-game Visible en jeu - - + + Hide In-game Invisible en jeu diff --git a/res/gta5sync_ko.qm b/res/gta5sync_ko.qm index 436005f..0e676bd 100644 Binary files a/res/gta5sync_ko.qm and b/res/gta5sync_ko.qm differ diff --git a/res/gta5sync_ko.ts b/res/gta5sync_ko.ts index 88a1353..b9fe7a8 100644 --- a/res/gta5sync_ko.ts +++ b/res/gta5sync_ko.ts @@ -201,21 +201,21 @@ Pictures and Savegames 닫기(&C) - - + + Snapmatic Image Editor 스냅매틱 이미지 편집기 - + Patching of Snapmatic Image failed because of I/O Error I/O 오류로 인해 스냅매틱 이미지를 패치하지 못했습니다 - + Patching of Snapmatic Image failed because of Image Error 이미지 오류로 인해 스냅매틱 이미지를 패치하지 못했습니다 @@ -353,7 +353,7 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! 소셜클럽의 사용자 지정 아바타 설명입니다. 특수 문자를 사용하지 마십시오! @@ -361,7 +361,7 @@ Pictures and Savegames - + Custom Picture Custom Picture Description in SC, don't use Special Character! 소셜클럽의 사용자 지정 그림 설명입니다. 특수 문자를 사용하지 마십시오! @@ -1020,43 +1020,43 @@ Y: %2 닫기(&C) - - + + Export as &Picture... 사진으로 내보내기(&P)... - - + + Export as &Snapmatic... 스낵매틱으로 내보내기(&S)... - - + + &Edit Properties... 속성 편집(&E)... - - + + &Overwrite Image... 이미지 덮어쓰기(&O)... - - + + Open &Map Viewer... 지도 뷰어 열기(&M)... - - + + Open &JSON Editor... JSON 편집기 열기(&J)... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1065,37 +1065,37 @@ Arrow Keys - Navigate 화살표키 - 이동 - - + + Snapmatic Picture Viewer 스낵매틱 사진 뷰어 - - + + Failed at %1 %1에서 실패했습니다 - - - + + + No Players 플레이어 없음 - - + + No Crew 조직 없음 - + Unknown Location 알 수 없는 위치 - + Avatar Preview Mode Press 1 for Default View 아바타 미리 보기 모드입니다 @@ -1306,23 +1306,23 @@ Press 1 for Default View - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + Import... 가져오기... @@ -1339,90 +1339,90 @@ Press 1 for Default View - + All image files (%1) 모든 이미지 파일 (%1) - - + + All files (**) 모든 파일 (**) - + Can't import %1 because file can't be open 파일을 열 수 없으므로 %1을 가져올 수 없습니다 - + Can't import %1 because file can't be parsed properly 파일을 구문 분석할 수 없으므로 %1을 가져올 수 없습니다 - + Enabled pictures: %1 of %2 활성화된 사진: %2의 %1 - + Loading... 불러오는 중... - + Snapmatic Loader 스냅매틱 로더 - + <h4>Following Snapmatic Pictures got repaired</h4>%1 <h4>다음 스냅매틱 사진을 복구했습니다 </h4>%1 - + Importable files (%1) 가져올 수 있는 파일 (%1) - - + + RDR 2 Export (*.r5e) RDR 2로 내보내기 (*.r5e) - - + + Savegames files (SRDR*) 세이브 파일 (SRDR*) - - + + Snapmatic pictures (PRDR*) 스냅매틱 사진 (PRDR*) - - - + + + No valid file is selected 올바른 파일이 선택되지 않았습니다 - - + + Import file %1 of %2 files %2 파일 중 %1 파일을 가져옵니다 - + Import failed with... %1 @@ -1431,91 +1431,91 @@ Press 1 for Default View %1 - - + + Failed to read Snapmatic picture 스냅매틱 사진을 읽지 못했습니다 - - + + Failed to read Savegame file 세이브 파일을 읽지 못했습니다 - + Can't import %1 because file format can't be detected 파일 형식을 검색할 수 없으므로 %1을 가져올 수 없습니다 - + Prepare Content for Import... 가져올 컨텐츠를 준비합니다... - + Failed to import the Snapmatic picture, file not begin with PRDR or end with .r5e 스냅매틱 사진을 가져오지 못했습니다. 파일이 PRDR로 시작되거나 .r5e로 끝나지 않습니다 - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? uid %1이(가) 있는 스냅매틱 사진이 이미 있습니다. 가져오기를 새 uid 및 타임스탬프를 할당하시겠습니까? - + Failed to import the Snapmatic picture, can't copy the file into profile 스냅매틱 사진을 가져오지 못했습니다. 파일을 프로파일에 복사할 수 없습니다 - + Failed to import the Savegame, can't copy the file into profile 게임 저장 파일을 가져오지 못했습니다. 파일을 프로필에 복사할 수 없습니다 - + Failed to import the Savegame, no Savegame slot is left 게임 저장 파일을 가져오지 못했습니다. 게임 저장 슬롯이 남아 있지 않습니다 - - - - - + + + + + Export selected... 내보내기를 선택했습니다... - - + + JPG pictures and GTA Snapmatic JPG 사진 및 GTA 스냅매틱 - - + + JPG pictures only JPG 사진만 - - + + GTA Snapmatic only GTA 스냅매틱만 - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1 스냅 사진 내보내기를 수행합니다%2 <br><br>JPG 사진을 사용하면 이미지 뷰어 로 사진을 열 수 있습니다<br>GTA 스냅매틱을 사용하면 다음과 같이 사진을 게임으로 가져올 수 있습니다 - + Initialising export... 내보내기를 초기화하는 중... - + Export failed with... %1 @@ -1524,45 +1524,45 @@ Press 1 for Default View %1 - - + + No Snapmatic pictures or Savegames files are selected 스냅매틱 사진 또는 세이브 파일이 선택되지 않았습니다 - - - + + + Remove selected 선택한 항목 삭제 - + You really want remove the selected Snapmatic picutres and Savegame files? 선택한 스냅매틱 사진 및 세이브 파일을 삭제하시겠습니까? - + Failed to remove all selected Snapmatic pictures and/or Savegame files 선택한 모든 스냅매틱 사진 및 세이브 파일을 삭제하지 못했습니다 - - - - - - + + + + + + No Snapmatic pictures are selected 스냅매틱 사진이 선택되지 않았습니다 - - - - - - + + + + + + %1 failed with... %2 @@ -1573,91 +1573,91 @@ Press 1 for Default View %2 - - + + Qualify as Avatar 아바타 자격 부여 - - - - + + + + Patch selected... 패치가 선택됨... - - - - - - - - + + + + + + + + Patch file %1 of %2 files %2 파일의 %1 패치 파일입니다 - + Qualify %1 failed with... %1이(가) 실패한 경우... 자격 부여 - - + + Change Players... 플레이어 변경... - + Change Players %1 failed with... %1이(가) 실패한 경우... 플레이어 변경 - - - + + + Change Crew... 조직 변경... - + Failed to enter a valid Snapmatic Crew ID 올바른 스냅매틱 조직 아이디를 입력하지 못했습니다 - + Change Crew %1 failed with... %1이(가) 실패한 경우... 조직 변경 - - - + + + Change Title... 제목 변경... - + Failed to enter a valid Snapmatic title 올바른 스냅매틱 제목을 입력하지 못했습니다 - + Change Title %1 failed with... %1이(가) 실패한 경우... 제목 변경 - + All profile files (*.r5e SRDR* PRDR*) 모든 프로필 파일 (*.r5e SRDR* PRDR*) @@ -1665,17 +1665,15 @@ Press 1 for Default View QApplication - Font - 폰트 + 폰트 - Selected Font: %1 - 선택된 폰트: %1 + 선택된 폰트: %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>%1에 오신 것을 환영합니다!</h4>%1을 사용하기 전에 구성하시겠습니까? @@ -1753,37 +1751,37 @@ Press 1 for Default View 삭제 - + &View 보기(&V) - + &Export 내보내기(&E) - + &Remove 삭제(&R) - + &Select 선택(&S) - + &Deselect 선택 해제(&D) - + Select &All 모두 선택(&A) - + &Deselect All 모두 선택 해제(&D) @@ -1883,8 +1881,8 @@ Press 1 for Default View - - + + Snapmatic Properties 스냅매틱 속성 @@ -1976,8 +1974,8 @@ Press 1 for Default View - - + + Patching of Snapmatic Properties failed because of I/O Error I/O 오류로 인해 스냅매틱 속성을 패치하지 못했습니다 @@ -1988,77 +1986,77 @@ Press 1 for Default View JSON 오류로 인해 스냅매틱 속성을 패치하지 못했습니다 - - + + Snapmatic Crew 조직 스냅매틱 - - + + New Snapmatic crew: 새로운 조직 스냅매틱: - - + + Snapmatic Title 스냅매틱 제목 - - + + New Snapmatic title: 새로운 스냅매틱 제목: - - - + + + Edit 편집 - + Players: %1 (%2) Multiple Player are inserted here 여기에 여러 플레이어가 추가됩니다. 플레이어: %1 (%2) - + Player: %1 (%2) One Player is inserted here 여기에 플레이어 하나가 추가됩니다. 플레이어: %1 (%2) - + Title: %1 (%2) 제목: %1 (%2) - - + + Appropriate: %1 변경: %1 - + Yes Yes, should work fine 네, 잘 될 거예요. - + No No, could lead to issues 아니요, 문제가 발생할 수 있습니다. 아니요 - + Crew: %1 (%2) 조직: %1 (%2) @@ -2067,64 +2065,64 @@ Press 1 for Default View SnapmaticPicture - + JSON is incomplete and malformed JSON이 불안정하고 형식이 잘못되었습니다 - + JSON is incomplete JSON이 불안정합니다 - + JSON is malformed 잘못된 JSON 형식 - + PHOTO - %1 사진 - %1 - + open file %1 파일 열기 %1 - + header not exists 헤더가 존재하지 않습니다 - + header is malformed 헤더의 형식이 잘못되었습니다 - + picture not exists (%1) 사진이 존재하지 않습니다. (%1) - + JSON not exists (%1) JSON이 존재하지 않습니다. (%1) - + title not exists (%1) 제목이 존재하지 않습니다. (%1) - + description not exists (%1) 설명이 존재하지 않습니다. (%1) - + reading file %1 because of %2 Example for %2: JSON is malformed error %2의 예: JSON이 잘못된 형식입니다 @@ -2186,52 +2184,52 @@ Press 1 for Default View 삭제 - + Edi&t 편집(&T) - + Show &In-game 인게임에서 보이기(&I) - + Hide &In-game 인게임에서 숨기기(&I) - + &Export 내보내기(&E) - + &View 보기(&V) - + &Remove 삭제(&R) - + &Select 선택(&S) - + &Deselect 선택 해제(&D) - + Select &All 모두 선택(&A) - + &Deselect All 모두 선택 해제(&D) @@ -2259,22 +2257,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? 개인 사용 데이터를 제출에 포함시켜 %1이(가) 개선되기를 원합니까? - + %1 User Statistics %1 사용자 통계 - + Yes, I want include personal usage data. 예, 개인 사용 데이터를 포함시키고 싶습니다. - + &OK 확인(&O) @@ -2283,7 +2281,7 @@ Press 1 for Default View UserInterface - + %2 - %1 %2 - %1 @@ -2316,6 +2314,7 @@ Press 1 for Default View + &Close 닫기(&C) @@ -2351,8 +2350,8 @@ Press 1 for Default View - - + + &About %1 %1 정보(&A) @@ -2408,15 +2407,15 @@ Press 1 for Default View - + Select &RDR 2 Folder... RDR 2 폴더 선택(&G)... - - + + Select RDR 2 Folder... RDR 2 폴더 선택 @@ -2451,43 +2450,48 @@ Press 1 for Default View 플레이어 변경(&P)... - - + + Show In-game 인게임 보이기 - - + + Hide In-game 인게임 숨기기 - - - + + + Select Profile 프로필 선택 - + Open File... 파일 열기... - - - - + + + + Open File 파일 열기 - + Can't open %1 because of not valid file format 올바른 파일 형식이 아니므로 %1을 열 수 없습니다 + + + %1 - Messages + + diff --git a/res/gta5sync_ru.qm b/res/gta5sync_ru.qm index ba594fc..3c5aae6 100644 Binary files a/res/gta5sync_ru.qm and b/res/gta5sync_ru.qm differ diff --git a/res/gta5sync_ru.ts b/res/gta5sync_ru.ts index a84cf99..70c07a5 100644 --- a/res/gta5sync_ru.ts +++ b/res/gta5sync_ru.ts @@ -180,8 +180,8 @@ Pictures and Savegames ImageEditorDialog - - + + Snapmatic Image Editor @@ -213,13 +213,13 @@ Pictures and Savegames &Закрыть - + Patching of Snapmatic Image failed because of I/O Error Не удалось изменить картинку Snapmatic из-за ошибки ввода-вывода - + Patching of Snapmatic Image failed because of Image Error Не удалось изменить картинку Snapmatic из-за ошибки Image Error @@ -367,14 +367,14 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! Свой Аватар - + Custom Picture Custom Picture Description in SC, don't use Special Character! Своя Картинка @@ -1023,37 +1023,37 @@ Y: %2 Экспортировать - - + + Export as &Picture... Экспортировать как &картинку... - - + + Export as &Snapmatic... Экспортировать как &Snapmatic... - - + + &Overwrite Image... &Перезаписать картинку... - - + + &Edit Properties... &Изменить свойства... - - + + Open &Map Viewer... Открыть &карту... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1062,39 +1062,39 @@ Arrow Keys - Navigate Стрелки - Навигация - - + + Snapmatic Picture Viewer Просмотрщик фотографий Snapmatic - - + + Failed at %1 Ошибка при %1 - - + + No Crew Вне банды - - - + + + No Players Игроков нет - + Avatar Preview Mode Press 1 for Default View Режим просмотра аватарок Нажмите 1 для стандартного просмотра - + Unknown Location Неизвестное место @@ -1196,8 +1196,8 @@ Press 1 for Default View Картинки Snapmatic (PRDR*) - - + + Open &JSON Editor... Открыть &редактор JSON... @@ -1294,17 +1294,17 @@ Press 1 for Default View &Закрыть - + Loading... Загрузка... - + Snapmatic Loader Загрузчик Snapmatic - + <h4>Following Snapmatic Pictures got repaired</h4>%1 Change wording if the %1 is not a multiline beginning at new line @@ -1313,23 +1313,23 @@ Press 1 for Default View - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + Import... Импортировать... @@ -1344,33 +1344,33 @@ Press 1 for Default View Импортировать - - + + Savegames files (SRDR*) Файлы сохранения (SRDR*) - - + + Snapmatic pictures (PRDR*) Картинка Snapmatic (PRDR*) - - + + All files (**) Все файлы (**) - - + + Import file %1 of %2 files Импортируются файлы %1 из %2 - + Import failed with... %1 @@ -1379,169 +1379,169 @@ Press 1 for Default View %1 - - + + Failed to read Snapmatic picture Не удалось загрузить картинку Snapmatic - - + + Failed to read Savegame file Не удалось загрузить файл сохранения - - - + + + No valid file is selected Выбранный файл неверен - + Enabled pictures: %1 of %2 Включенные картинки: %1 из %2 - + Importable files (%1) Файлы для импорта (%1) - + All image files (%1) Все файлы изображений (%1) - + Can't import %1 because file can't be open Не удалось открыть %1, файл не может быть открыт - + Can't import %1 because file can't be parsed properly Не получилось импортировать %1, файл не может быть правильно обработан - + Can't import %1 because file format can't be detected Не получилось импортировать %1, не удалось определить формат файла - + Failed to import the Snapmatic picture, file not begin with PRDR or end with .r5e Не удалось импортировать картинку Snapmatic, название не начинается с PRDR или не заканчивается с .r5e - + Failed to import the Snapmatic picture, can't copy the file into profile Не удалось импортировать картинку Snapmatic, не получилось скопировать файл в профиль - + Failed to import the Savegame, can't copy the file into profile Не удалось импортировать сохранение, не получилось скопировать файл в профиль - + Failed to import the Savegame, no Savegame slot is left Не удалось импортировать сохранение, нет пустых ячеек под сохранения - - + + JPG pictures and GTA Snapmatic Картинки JPG и GTA Snapmatic - - + + JPG pictures only Только картинки JPG - - + + GTA Snapmatic only Только GTA Snapmatic - + Initialising export... Подготовка к экспорту... - - + + No Snapmatic pictures or Savegames files are selected Не выделены ни один Snapmatic или сохранение - - - + + + Remove selected Снять выделение - + You really want remove the selected Snapmatic picutres and Savegame files? Точно ли хочешь удалить выбранные картинки Snapmatic и файлы сохранений? - + Prepare Content for Import... Подготовка данных к импорту... - - + + Qualify as Avatar Пометить как Аватар - - - - - - + + + + + + No Snapmatic pictures are selected Не выделена ни одна картинка Snapmatic - - - - + + + + Patch selected... Пропатчить выделенные... - - - - - - - - + + + + + + + + Patch file %1 of %2 files Изменяется файл %1 из %2 - - - - - - + + + + + + %1 failed with... %2 @@ -1551,86 +1551,86 @@ Press 1 for Default View %2 - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? Можно использовать слово "приписать" - + Failed to remove all selected Snapmatic pictures and/or Savegame files Не удалось удалить все выделенные картинки Snapmatic и/или сохранения - + Qualify %1 failed with... Помечание - - + + Change Players... Изменить игроков... - + Change Players %1 failed with... Измение игроков - - - + + + Change Crew... Изменить банду... - + Failed to enter a valid Snapmatic Crew ID Введённый идентификатор банды не верен - + Change Crew %1 failed with... Изменение банды - - - + + + Change Title... Изменить заголовок... - + Failed to enter a valid Snapmatic title Введённый заголовок не верен - + Change Title %1 failed with... Изменение заголовка - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1Эскпортировать картинки Snapmatic%2<br><br>Картинки JPG можно открыть любым просмотрщиком<br>Картинки формата GTA Snapmatic можно снова импортировать в игру<br><br>Экспортировать как: - - - - - + + + + + Export selected... Экпортировать выделенное... - + Export failed with... %1 @@ -1646,13 +1646,13 @@ Press 1 for Default View Экспортируется файл %1 из %2 - + All profile files (*.r5e SRDR* PRDR*) Все файлы профиля (*.r5e SRDR* PRDR*) - - + + RDR 2 Export (*.r5e) RDR 2 Export (*.r5e) @@ -1660,17 +1660,15 @@ Press 1 for Default View QApplication - Font - Шрифт + Шрифт - Selected Font: %1 - Выбранный шрифт: %1 + Выбранный шрифт: %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>Добро пожаловать в %1!</h4>Хочешь изменить настройки %1 перед использованием? @@ -1791,32 +1789,32 @@ Press 1 for Default View Не удалось удалить сохранение %1 - + &View &Просмотр - + &Remove &Удалить - + &Select &Выбрать - + &Deselect Сн&ять выбор - + Select &All В&ыбрать все - + &Deselect All Снять выбо&р со всех @@ -1826,7 +1824,7 @@ Press 1 for Default View Копировать сохранение - + &Export &Экспортировать @@ -1878,8 +1876,8 @@ Press 1 for Default View - - + + Snapmatic Properties Свойства Snapmatic @@ -1920,7 +1918,7 @@ Press 1 for Default View Значения в Snapmatic - + Crew: %1 (%2) Банда: %1 (%2) @@ -1930,31 +1928,31 @@ Press 1 for Default View Meme - - + + Snapmatic Title Заголовок Snapmatic - + Title: %1 (%2) Заголовок: %1 (%2) - + Players: %1 (%2) Multiple Player are inserted here Игроки: %1 (%2) - + Player: %1 (%2) One Player is inserted here Игрок: %1 (%2) - - + + Appropriate: %1 Подходит: %1 @@ -1994,20 +1992,20 @@ Press 1 for Default View &Отмена - - - + + + Edit Правка - + Yes Yes, should work fine Да - + No No, could lead to issues Нет @@ -2029,27 +2027,27 @@ Press 1 for Default View - - + + Patching of Snapmatic Properties failed because of I/O Error Не удалось измененить свойства Snapmatic из-за проблемы ввода/вывода - - + + New Snapmatic title: Новый заголовок Snapmatic: - - + + Snapmatic Crew Банда на Snapmatic - - + + New Snapmatic crew: Новая банда на Snapmatic: @@ -2057,66 +2055,66 @@ Press 1 for Default View SnapmaticPicture - + PHOTO - %1 ФОТО - %1 - + open file %1 Открыть файл %1 - + header not exists Отсутствует шапка (header) - + header is malformed Шапка (header) повреждена - + picture not exists (%1) Картинки не существует (%1) - + JSON not exists (%1) JSON не существует (%1) - + title not exists (%1) Заголовок отсутствует (%1) - + description not exists (%1) Описание отсутствует (%1) - + reading file %1 because of %2 Example for %2: JSON is malformed error Чтение из файла %1 из-за %2 - + JSON is incomplete and malformed JSON не полный и повреждён - + JSON is incomplete JSON частично отсутствует - + JSON is malformed JSON повреждён @@ -2186,52 +2184,52 @@ Press 1 for Default View Не удалось показать %1 в списке картинок Snapmatic в игре - + Edi&t &Правка - + Show &In-game Показывать в &игре - + Hide &In-game Ск&рыть в игре - + &Export &Экспорт - + &View По&казать - + &Remove У&далить - + &Select &Выделить - + &Deselect Сн&ять выделение - + Select &All В&ыбрать все - + &Deselect All Снять выбо&р со всех @@ -2249,22 +2247,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? Разрешишь нам собирать статистику о пользовании тобой %1? Это поможет нам в разработке. - + %1 User Statistics %1 Пользовательская статистика - + Yes, I want include personal usage data. Да, передавать данные о пользовании программой. - + &OK &ОК @@ -2339,7 +2337,7 @@ Press 1 for Default View - + Select &RDR 2 Folder... Выбрать &папку RDR 2... @@ -2375,6 +2373,7 @@ Press 1 for Default View + &Close &Закрыть @@ -2414,66 +2413,71 @@ Press 1 for Default View &Открыть файл... - - - + + + Select Profile Выбор профиля - - + + Select RDR 2 Folder... Выбрать папку RDR 2... - + %2 - %1 %2 - %1 - - + + &About %1 &О программе %1 - + Open File... Открыть файл... - - - - + + + + Open File Открыть файл - + Can't open %1 because of not valid file format Не удалось открыть %1 из-за неверного формата файла + + + %1 - Messages + + &Reload Пере&загрузить - - + + Show In-game Показывать в игре - - + + Hide In-game Скрыть в игре diff --git a/res/gta5sync_uk.qm b/res/gta5sync_uk.qm index 26bff7c..c09c294 100644 Binary files a/res/gta5sync_uk.qm and b/res/gta5sync_uk.qm differ diff --git a/res/gta5sync_uk.ts b/res/gta5sync_uk.ts index d427a44..ef47d76 100644 --- a/res/gta5sync_uk.ts +++ b/res/gta5sync_uk.ts @@ -204,21 +204,21 @@ Pictures and Savegames &Закрити - - + + Snapmatic Image Editor Редактор Snapmatic зображень - + Patching of Snapmatic Image failed because of I/O Error Виправлення Snapmatic зображення не вдалося через I/O Error - + Patching of Snapmatic Image failed because of Image Error Виправлення Snapmatic зображення не вдалося через помилку картинки @@ -356,14 +356,14 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! Користувацький Аватар - + Custom Picture Custom Picture Description in SC, don't use Special Character! Користувацьке Зображення @@ -1010,43 +1010,43 @@ Y: %2 &Закрити - - + + Export as &Picture... Експортувати як &зображення... - - + + Export as &Snapmatic... Експортувати як &Snapmatic... - - + + &Edit Properties... &Змінити властивості... - - + + &Overwrite Image... &Перезаписати зображення... - - + + Open &Map Viewer... Відкрити &карту... - - + + Open &JSON Editor... Відкрити редактор &JSON... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1055,37 +1055,37 @@ Arrow Keys - Navigate Стрілки - Навігація - - + + Snapmatic Picture Viewer Переглядач фотографій Snapmatic - - + + Failed at %1 Помилка на%1 - - - + + + No Players Гравців немає - - + + No Crew Банди немає - + Unknown Location Невідома локація - + Avatar Preview Mode Press 1 for Default View Режим для аватарок @@ -1296,23 +1296,23 @@ Press 1 for Default View - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + Import... Імпортування... @@ -1329,90 +1329,90 @@ Press 1 for Default View - + All image files (%1) Файли зображень (%1) - - + + All files (**) Усі файли (**) - + Can't import %1 because file can't be open Неможливо імпортувати %1, оскільки файл не може бути відкритий - + Can't import %1 because file can't be parsed properly Неможливо імпортувати %1, оскільки файл неможливо розібрати правильно - + Enabled pictures: %1 of %2 Увімкнено фотографії:%1 з%2 - + Loading... Завантаження... - + Snapmatic Loader Snapmatic Loader - + <h4>Following Snapmatic Pictures got repaired</h4>%1 <h4>Наступні Snapmatic зображення були відновлені</h4>%1 - + Importable files (%1) Імпортуються файли (%1) - - + + RDR 2 Export (*.r5e) RDR 2 Export (*.r5e) - - + + Savegames files (SRDR*) Файли збереження гри (SRDR*) - - + + Snapmatic pictures (PRDR*) Snapmatic зображення (PRDR*) - - - + + + No valid file is selected Вибрані недійсні файли - - + + Import file %1 of %2 files Імпортується файл %1 з %2 файлів - + Import failed with... %1 @@ -1421,81 +1421,81 @@ Press 1 for Default View %1 - - + + Failed to read Snapmatic picture Не вдалося прочитати Snapmatic картинку - - + + Failed to read Savegame file Не вдалося прочитати файл збереження гри - + Can't import %1 because file format can't be detected Неможливо імпортувати%1, оскільки формат файлу не може бути виявлений - + Failed to import the Snapmatic picture, file not begin with PRDR or end with .r5e Не вдалося імпортувати зображення Snapmatic, файл не починається з PRDR або закінчується .r5e - + Failed to import the Snapmatic picture, can't copy the file into profile Не вдалося імпортувати зображення Snapmatic, не можна скопіювати файл у профіль - + Failed to import the Savegame, can't copy the file into profile Не вдалося імпортувати Сейв, не можна скопіювати файл у профіль - + Failed to import the Savegame, no Savegame slot is left Не вдалося імпортувати Сейв, немає вільного слота - - - - - + + + + + Export selected... Експорт обраних... - - + + JPG pictures and GTA Snapmatic JPG картинки і GTA Snapmatic - - + + JPG pictures only Тільки JPG картинки - - + + GTA Snapmatic only Тільки GTA Snapmatic - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1 Експортувати Snapmatic фотографії %2 <br><br> Фотографії JPG дозволяють відкривати зображення за допомогою засобу перегляду зображень<br>GTA Snapmatic дає змогу імпортувати зображення в гру<br><br>Експортувати як: - + Initialising export... Ініціалізація експорту... - + Export failed with... %1 @@ -1504,45 +1504,45 @@ Press 1 for Default View %1 - - + + No Snapmatic pictures or Savegames files are selected Не вибрано жодного Snapmatic зображення або файлу збереження - - - + + + Remove selected Видалити вибрані - + You really want remove the selected Snapmatic picutres and Savegame files? Ви дійсно хочете видалити вибрані Snapmatic фотографії та файли збереження гри? - + Failed to remove all selected Snapmatic pictures and/or Savegame files Не вдалося видалити всі обрані Snapmatic фотографії та/або Сейви - - - - - - + + + + + + No Snapmatic pictures are selected Не вибрано жодного Snapmatic зображення - - - - - - + + + + + + %1 failed with... %2 @@ -1552,97 +1552,97 @@ Press 1 for Default View %2 - + Prepare Content for Import... Підготувати контент для імпорту ... - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? Snapmatic зображення з uid %1 вже існує, ви хочете призначити для імпорту новий uid та мітку часу? - - + + Qualify as Avatar Позначити як Аватар - - - - + + + + Patch selected... Вибір патчу... - - - - - - - - + + + + + + + + Patch file %1 of %2 files Патч файлу %1 з %2 файлів - + Qualify %1 failed with... Якість - - + + Change Players... Зміна гравців... - + Change Players %1 failed with... Змінити гравців - - - + + + Change Crew... Зміна банди... - + Failed to enter a valid Snapmatic Crew ID Не вдалося ввести дійсний ID Банди Snapmatic - + Change Crew %1 failed with... Змінити банду - - - + + + Change Title... Зміна назви... - + Failed to enter a valid Snapmatic title Не вдалося ввести дійсний заголовок Snapmatic - + Change Title %1 failed with... Змінити назву - + All profile files (*.r5e SRDR* PRDR*) Усі файли зображень (*.r5e SRDR* PRDR*) @@ -1650,17 +1650,15 @@ Press 1 for Default View QApplication - Font - Шрифт + Шрифт - Selected Font: %1 - Вибраний шрифт:%1 + Вибраний шрифт:%1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>Ласкаво просимо до %1!</h4>Ви хочете налаштувати %1 перед використанням? @@ -1738,37 +1736,37 @@ Press 1 for Default View Видалити - + &View &Перегляд - + &Export &Експорт - + &Remove &Видалення - + &Select &Виділення - + &Deselect &Зняти виділення - + Select &All Вибрати &усі - + &Deselect All &Зняти виділення усіх @@ -1868,8 +1866,8 @@ Press 1 for Default View - - + + Snapmatic Properties Властивості Snapmatic @@ -1961,8 +1959,8 @@ Press 1 for Default View - - + + Patching of Snapmatic Properties failed because of I/O Error Змінити властивості Snapmatic не вдалося через I/O Помилку @@ -1973,73 +1971,73 @@ Press 1 for Default View Змінити властивості Snapmatic не вдалося через JSON Помилку - - + + Snapmatic Crew Snapmatic банда - - + + New Snapmatic crew: Нова Snapmatic банда: - - + + Snapmatic Title Snapmatic назва - - + + New Snapmatic title: Новий Snapmatic заголовок: - - - + + + Edit Правка - + Players: %1 (%2) Multiple Player are inserted here Гравці: %1 (%2) - + Player: %1 (%2) One Player is inserted here Гравець: %1 (%2) - + Title: %1 (%2) Назва: %1 (%2) - - + + Appropriate: %1 Підходить: %1 - + Yes Yes, should work fine Так - + No No, could lead to issues Ні - + Crew: %1 (%2) Банда: %1 (%2) @@ -2048,64 +2046,64 @@ Press 1 for Default View SnapmaticPicture - + JSON is incomplete and malformed JSON неповний та неправильний - + JSON is incomplete JSON неповний - + JSON is malformed JSON неправильний - + PHOTO - %1 ФОТО - %1 - + open file %1 відкрити файл%1 - + header not exists заголовок не існує - + header is malformed заголовок неправильний - + picture not exists (%1) зображення не існує (%1) - + JSON not exists (%1) JSON не існує (%1) - + title not exists (%1) заголовок не існує (%1) - + description not exists (%1) опис не існує (%1) - + reading file %1 because of %2 Example for %2: JSON is malformed error читання файлу %1 тому що %2 @@ -2166,52 +2164,52 @@ Press 1 for Default View Видалити - + Edi&t Редагува&ти - + Show &In-game Показати &у грі - + Hide &In-game Сховати &у грі - + &Export &Експортувати - + &View &Переглянути - + &Remove &Видалити - + &Select &Виділення - + &Deselect &Зняти виділення - + Select &All Вибрати &усі - + &Deselect All &Зняти виділення усіх @@ -2239,22 +2237,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? Ви хочете допомогти %1 покращитись у майбутньому, включивши дані особистого користування? - + %1 User Statistics %1 Статистика користувачів - + Yes, I want include personal usage data. Так, я хочу включити дані особистого користування. - + &OK &OK &OK @@ -2264,7 +2262,7 @@ Press 1 for Default View UserInterface - + %2 - %1 %2 - %1 @@ -2296,6 +2294,7 @@ Press 1 for Default View + &Close &Закрити @@ -2331,8 +2330,8 @@ Press 1 for Default View - - + + &About %1 &Про %1 @@ -2388,15 +2387,15 @@ Press 1 for Default View - + Select &RDR 2 Folder... Вибрати &RDR 2 теку... - - + + Select RDR 2 Folder... Вибрати RDR 2 теку... @@ -2431,43 +2430,48 @@ Press 1 for Default View Змінити &гравців... - - + + Show In-game Показати у грі - - + + Hide In-game Сховати у грі - - - + + + Select Profile Вибрати профіль - + Open File... Відкрити файл... - - - - + + + + Open File Відкрити файл - + Can't open %1 because of not valid file format Неможливо відкрити %1 через невідомий формат файлу + + + %1 - Messages + + diff --git a/res/gta5sync_zh_TW.qm b/res/gta5sync_zh_TW.qm index 122d14b..4615312 100644 Binary files a/res/gta5sync_zh_TW.qm and b/res/gta5sync_zh_TW.qm differ diff --git a/res/gta5sync_zh_TW.ts b/res/gta5sync_zh_TW.ts index 86f32c7..2174d26 100644 --- a/res/gta5sync_zh_TW.ts +++ b/res/gta5sync_zh_TW.ts @@ -200,21 +200,21 @@ Pictures and Savegames 關閉(&C) - - + + Snapmatic Image Editor Snapmatic 圖片編輯器 - + Patching of Snapmatic Image failed because of I/O Error I/O 錯誤,Snapmatic 圖片更新失敗 - + Patching of Snapmatic Image failed because of Image Error 圖片錯誤,Snapmatic 圖片更新失敗 @@ -352,14 +352,14 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! 自訂大頭貼 - + Custom Picture Custom Picture Description in SC, don't use Special Character! 自訂圖片 @@ -1004,43 +1004,43 @@ Y: %2 關閉(&C) - - + + Export as &Picture... 匯出成圖片(&P)... - - + + Export as &Snapmatic... 匯出成 Snapmatic(&S)... - - + + &Edit Properties... 編輯屬性(&E) ... - - + + &Overwrite Image... 修改圖片(&O)... - - + + Open &Map Viewer... 開啟地圖檢視器(&M)... - - + + Open &JSON Editor... 開啟 JSON 編輯器(&J)... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1049,37 +1049,37 @@ Arrow Keys - Navigate 方向鍵 - 導覽 - - + + Snapmatic Picture Viewer Snapmatic 圖片檢視器 - - + + Failed at %1 失敗: %1 - - - + + + No Players - - + + No Crew - + Unknown Location 未知地點 - + Avatar Preview Mode Press 1 for Default View 大頭貼預覽模式 @@ -1290,23 +1290,23 @@ Press 1 for Default View - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + Import... 匯入... @@ -1323,216 +1323,216 @@ Press 1 for Default View - + All image files (%1) 所有圖片 (%1) - - + + All files (**) 所有檔案 (**) - + Can't import %1 because file can't be open 無法匯入 %1,因為檔案無法開啟 - + Can't import %1 because file can't be parsed properly 無法匯入 %1,因為檔案無法正確解析 - + Enabled pictures: %1 of %2 開啟圖片 %1 共 %2 - + Loading... 載入中... - + Snapmatic Loader Snapmatic 載入器 - + <h4>Following Snapmatic Pictures got repaired</h4>%1 <h4>下列的 Snapmatic 圖片已被更新</h4>%1 - + Importable files (%1) 可匯入的檔案 (%1) - - + + RDR 2 Export (*.r5e) RDR 2 Export (*.r5e) - - + + Savegames files (SRDR*) 遊戲存檔 (SRDR*) - - + + Snapmatic pictures (PRDR*) Snapmatic 圖片 (PRDR*) - - - + + + No valid file is selected 沒有選擇有效的檔案 - - + + Import file %1 of %2 files 匯入檔案 %1 共 %2 個 - + Import failed with... %1 %1 匯入失敗 - - + + Failed to read Snapmatic picture 無法讀取 Snapmatic 圖片 - - + + Failed to read Savegame file 無法讀取遊戲存檔 - + Can't import %1 because file format can't be detected 無法匯入 %1,因為無法檢測該檔案格式 - + Failed to import the Snapmatic picture, file not begin with PRDR or end with .r5e 匯入 Snapmatic 圖片失敗,檔案不是 PRDR 開頭或附檔名不是 .r5e - + Failed to import the Snapmatic picture, can't copy the file into profile 匯入 Snapmatic 圖片失敗,無法將該檔案複製到設定檔中 - + Failed to import the Savegame, can't copy the file into profile 匯入遊戲存檔失敗,無法將該檔案複製到設定檔中 - + Failed to import the Savegame, no Savegame slot is left 匯入遊戲存檔失敗,沒有遊戲存檔欄位 - - - - - + + + + + Export selected... 匯出所選... - - + + JPG pictures and GTA Snapmatic JPG 圖片和 GTA Snapmatic - - + + JPG pictures only 只有 JPG 圖片 - - + + GTA Snapmatic only 只有 GTA Snapmatic - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1 匯出 Snapmatic 圖片 %2<br><br>JPG 圖片可使用圖片檢視器開啟<br>GTA Snapmatic 可以匯入到遊戲中<br><br>匯出成: - + Initialising export... 初始化... - + Export failed with... %1 %1 匯出失敗 - - + + No Snapmatic pictures or Savegames files are selected 未選擇 Snapmatic 圖片或遊戲存檔 - - - + + + Remove selected 移除所選 - + You really want remove the selected Snapmatic picutres and Savegame files? 你想移除所選的 Snapmatic 圖片/存檔嗎? - + Failed to remove all selected Snapmatic pictures and/or Savegame files 無法移除所選擇的 Snapmatic 圖片/遊戲存檔 - - - - - - + + + + + + No Snapmatic pictures are selected 未選擇 Snapmatic 圖片 - - - - - - + + + + + + %1 failed with... %2 @@ -1542,97 +1542,97 @@ Press 1 for Default View %2 - + Prepare Content for Import... 準備匯入內容... - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? 已有與 uid %1 相同的 Snapmatic 圖片,你想要匯入新的 uid 和時間戳嗎? - - + + Qualify as Avatar 合格大頭貼 - - - - + + + + Patch selected... 修改所選... - - - - - - - - + + + + + + + + Patch file %1 of %2 files 修改檔案 %1 共 %2 個檔案 - + Qualify %1 failed with... 合格 - - + + Change Players... 更改玩家... - + Change Players %1 failed with... 更改玩家 - - - + + + Change Crew... 更改幫會... - + Failed to enter a valid Snapmatic Crew ID 輸入了無效的幫會 ID - + Change Crew %1 failed with... 更改幫會 - - - + + + Change Title... 更改標題... - + Failed to enter a valid Snapmatic title 輸入了無效的標題 - + Change Title %1 failed with... 更改標題 - + All profile files (*.r5e SRDR* PRDR*) 所有設定檔檔案 (*.r5e SRDR* PRDR*) @@ -1640,17 +1640,15 @@ Press 1 for Default View QApplication - Font - 字體 + 字體 - Selected Font: %1 - 選擇的字體: %1 + 選擇的字體: %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>歡迎使用 %1!</h4> 你想在開始前先設定 %1 嗎? @@ -1728,37 +1726,37 @@ Press 1 for Default View 刪除 - + &View 檢視(&V) - + &Export 匯出(&E) - + &Remove 移除(&R) - + &Select 選擇(&S) - + &Deselect 取消選擇(&D) - + Select &All 選擇全部(&A) - + &Deselect All 取消選擇全部(&D) @@ -1858,8 +1856,8 @@ Press 1 for Default View - - + + Snapmatic Properties Snapmatic 屬性 @@ -1951,8 +1949,8 @@ Press 1 for Default View - - + + Patching of Snapmatic Properties failed because of I/O Error 讀寫錯誤,未能更新 Snapmatic 屬性 @@ -1963,73 +1961,73 @@ Press 1 for Default View JSON 錯誤,未能更新 Snapmatic 屬性 - - + + Snapmatic Crew 幫會 - - + + New Snapmatic crew: 輸入新的幫會: - - + + Snapmatic Title 標題 - - + + New Snapmatic title: 輸入新的標題: - - - + + + Edit 編輯 - + Players: %1 (%2) Multiple Player are inserted here 玩家: %1 (%2) - + Player: %1 (%2) One Player is inserted here 玩家: %1 (%2) - + Title: %1 (%2) 標題: %1 (%2) - - + + Appropriate: %1 可使用: %1 - + Yes Yes, should work fine - + No No, could lead to issues - + Crew: %1 (%2) 幫會: %1 (%2) @@ -2038,64 +2036,64 @@ Press 1 for Default View SnapmaticPicture - + JSON is incomplete and malformed JSON 不完整和異常 - + JSON is incomplete JSON 不完整 - + JSON is malformed JSON 異常 - + PHOTO - %1 照片 - %1 - + open file %1 開啟檔案 - %1 - + header not exists 標頭不存在 - + header is malformed 標頭異常 - + picture not exists (%1) 圖片不存在 (%1) - + JSON not exists (%1) JSON 不存在 (%1) - + title not exists (%1) 標題不存在 (%1) - + description not exists (%1) 描述不存在 (%1) - + reading file %1 because of %2 Example for %2: JSON is malformed error 讀取檔案 %1 失敗,因為 %2 @@ -2156,52 +2154,52 @@ Press 1 for Default View 刪除 - + Edi&t 編輯(&E) - + Show &In-game 在遊戲中顯示(&I) - + Hide &In-game 在遊戲中隱藏(&I) - + &Export 匯出(&E) - + &View 檢視(&V) - + &Remove 移除(&R) - + &Select 選擇(&S) - + &Deselect 取消選擇(&D) - + Select &All 選擇全部(&A) - + &Deselect All 取消選擇全部(&D) @@ -2229,22 +2227,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? 你希望通過收集資料來幫助改善 %1 嗎? - + %1 User Statistics %1 使用者統計 - + Yes, I want include personal usage data. 是的,我想幫忙. - + &OK 確定(&O) @@ -2253,7 +2251,7 @@ Press 1 for Default View UserInterface - + %2 - %1 %2 - %1 @@ -2285,6 +2283,7 @@ Press 1 for Default View + &Close 關閉(&C) @@ -2320,8 +2319,8 @@ Press 1 for Default View - - + + &About %1 關於 %1(&A) @@ -2377,15 +2376,15 @@ Press 1 for Default View - + Select &RDR 2 Folder... 選擇 RDR 2 資料夾(&G)... - - + + Select RDR 2 Folder... 選擇 RDR 2 資料夾... @@ -2420,43 +2419,48 @@ Press 1 for Default View 更改玩家(&P)... - - + + Show In-game 在遊戲中顯示 - - + + Hide In-game 在遊戲中隱藏 - - - + + + Select Profile 選擇設定檔 - + Open File... 開啟檔案... - - - - + + + + Open File 開啟檔案 - + Can't open %1 because of not valid file format 格式無效,無法開啟 %1 + + + %1 - Messages + + diff --git a/uimod/JSHighlighter.cpp b/uimod/JSHighlighter.cpp index 7b3aec0..42a988c 100644 --- a/uimod/JSHighlighter.cpp +++ b/uimod/JSHighlighter.cpp @@ -1,6 +1,6 @@ /***************************************************************************** * gta5view Grand Theft Auto V Profile Viewer -* Copyright (C) 2017 Syping +* Copyright (C) 2017-2020 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 @@ -17,7 +17,6 @@ *****************************************************************************/ #include "JSHighlighter.h" -#include JSHighlighter::JSHighlighter(QTextDocument *parent) : QSyntaxHighlighter(parent) @@ -31,34 +30,61 @@ JSHighlighter::JSHighlighter(QTextDocument *parent) : keywordPatterns << "\\btrue\\b" << "\\bfalse\\b"; for (QString pattern : keywordPatterns) { +#if QT_VERSION >= 0x050000 + rule.pattern = QRegularExpression(pattern); +#else rule.pattern = QRegExp(pattern); +#endif rule.format = keywordFormat; highlightingRules.append(rule); } QBrush doubleBrush(QColor::fromRgb(66, 137, 244)); doubleFormat.setForeground(doubleBrush); +#if QT_VERSION >= 0x050000 + rule.pattern = QRegularExpression("[+-]?\\d*\\.?\\d+"); +#else rule.pattern = QRegExp("[+-]?\\d*\\.?\\d+"); +#endif rule.format = doubleFormat; highlightingRules.append(rule); QBrush quotationBrush(QColor::fromRgb(66, 244, 104)); quotationFormat.setForeground(quotationBrush); +#if QT_VERSION >= 0x050000 + rule.pattern = QRegularExpression("\"[^\"]*\""); +#else rule.pattern = QRegExp("\"[^\"]*\""); +#endif rule.format = quotationFormat; highlightingRules.append(rule); QBrush objectBrush(QColor::fromRgb(255, 80, 80)); objectFormat.setForeground(objectBrush); +#if QT_VERSION >= 0x050000 + rule.pattern = QRegularExpression("\"[^\"]*\"(?=:)"); +#else rule.pattern = QRegExp("\"[^\"]*\"(?=:)"); +#endif rule.format = objectFormat; highlightingRules.append(rule); } void JSHighlighter::highlightBlock(const QString &text) { - for (HighlightingRule rule : highlightingRules) +#if QT_VERSION >= 0x050000 + for (const HighlightingRule &rule : qAsConst(highlightingRules)) +#else + for (const HighlightingRule &rule : highlightingRules) +#endif { +#if QT_VERSION >= 0x050000 + QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text); + while (matchIterator.hasNext()) { + QRegularExpressionMatch match = matchIterator.next(); + setFormat(match.capturedStart(), match.capturedLength(), rule.format); + } +#else QRegExp expression(rule.pattern); int index = expression.indexIn(text); while (index >= 0) @@ -67,6 +93,7 @@ void JSHighlighter::highlightBlock(const QString &text) setFormat(index, length, rule.format); index = expression.indexIn(text, index + length); } +#endif } setCurrentBlockState(0); } diff --git a/uimod/JSHighlighter.h b/uimod/JSHighlighter.h index cad6453..d93bfa9 100644 --- a/uimod/JSHighlighter.h +++ b/uimod/JSHighlighter.h @@ -1,6 +1,6 @@ /***************************************************************************** * gta5view Grand Theft Auto V Profile Viewer -* Copyright (C) 2017 Syping +* Copyright (C) 2017-2020 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 @@ -24,10 +24,15 @@ #include #include #include -#include #include #include +#if QT_VERSION >= 0x050000 +#include +#else +#include +#endif + class QTextDocument; class JSHighlighter : public QSyntaxHighlighter @@ -37,7 +42,11 @@ class JSHighlighter : public QSyntaxHighlighter public: struct HighlightingRule { +#if QT_VERSION >= 0x050000 + QRegularExpression pattern; +#else QRegExp pattern; +#endif QTextCharFormat format; }; QVector highlightingRules; diff --git a/uimod/UiModWidget.cpp b/uimod/UiModWidget.cpp index ff8946c..ff852fc 100644 --- a/uimod/UiModWidget.cpp +++ b/uimod/UiModWidget.cpp @@ -80,7 +80,11 @@ void UiModWidget::paintEvent(QPaintEvent *paintEvent) { Q_UNUSED(paintEvent) QStyleOption opt; +#if QT_VERSION <= 0x060000 + opt.initFrom(this); +#else opt.init(this); +#endif QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); }