diff --git a/.travis.yml b/.travis.yml index c1e15cf..7969f5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,14 +32,14 @@ before_script: script: - cd qt5 - - qmake -qt=5 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=c++11 DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"$PACKAGE_VERSION-dev3\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro + - qmake -qt=5 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=c++11 DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"$PACKAGE_VERSION-dev4\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro - make -j 4 - - sudo checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt5 --pkgversion=$PACKAGE_VERSION --pkgrelease=dev3 --pkggroup=utility --maintainer="Syping on Travis \" --requires=libqt5core5a,libqt5gui5,libqt5network5,libqt5widgets5,qttranslations5-l10n --conflicts=gta5view,gta5view-qt4 --replaces=gta5view,gta5view-qt4 --pakdir=../../package + - sudo checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt5 --pkgversion=$PACKAGE_VERSION --pkgrelease=dev4 --pkggroup=utility --maintainer="Syping on Travis \" --requires=libqt5core5a,libqt5gui5,libqt5network5,libqt5widgets5,qttranslations5-l10n --conflicts=gta5view,gta5view-qt4 --replaces=gta5view,gta5view-qt4 --pakdir=../../package - cd .. - cd qt4 - - qmake -qt=4 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=c++11 DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"$PACKAGE_VERSION-dev3\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro + - qmake -qt=4 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=c++11 DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"$PACKAGE_VERSION-dev4\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro - make -j 4 - - sudo checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt4 --pkgversion=$PACKAGE_VERSION --pkgrelease=dev3 --pkggroup=utility --maintainer="Syping on Travis \" --requires=libqtcore4,libqtgui4,libqt4-network,qtcore4-l10n --conflicts=gta5view,gta5view-qt5 --replaces=gta5view,gta5view-qt5 --pakdir=../../package + - sudo checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt4 --pkgversion=$PACKAGE_VERSION --pkgrelease=dev4 --pkggroup=utility --maintainer="Syping on Travis \" --requires=libqtcore4,libqtgui4,libqt4-network,qtcore4-l10n --conflicts=gta5view,gta5view-qt5 --replaces=gta5view,gta5view-qt5 --pakdir=../../package - cd .. deploy: diff --git a/CrewDatabase.cpp b/CrewDatabase.cpp index 69e4b06..73d9bed 100755 --- a/CrewDatabase.cpp +++ b/CrewDatabase.cpp @@ -92,6 +92,17 @@ QStringList CrewDatabase::getCompatibleCrews_p() return crewDB->childKeys(); } +QString CrewDatabase::getCrewName(QString crewID) +{ + QMutexLocker locker(&mutex); +#ifdef GTA5SYNC_DEBUG + qDebug() << "getCrewName" << crewID; +#endif + QString crewStr = crewDB->value(crewID, crewID).toString(); + if (crewID == "0") crewStr = tr("No Crew", ""); + return crewStr; +} + QString CrewDatabase::getCrewName(int crewID) { QMutexLocker locker(&mutex); diff --git a/CrewDatabase.h b/CrewDatabase.h index b5c7ee0..0bb9933 100755 --- a/CrewDatabase.h +++ b/CrewDatabase.h @@ -29,6 +29,7 @@ class CrewDatabase : public QObject Q_OBJECT public: explicit CrewDatabase(QObject *parent = 0); + QString getCrewName(QString crewID); QString getCrewName(int crewID); QStringList getCompatibleCrews(); QStringList getCrews(); diff --git a/JsonEditorDialog.cpp b/JsonEditorDialog.cpp new file mode 100644 index 0000000..ddf72bd --- /dev/null +++ b/JsonEditorDialog.cpp @@ -0,0 +1,164 @@ +/***************************************************************************** +* gta5sync GRAND THEFT AUTO V SYNC +* Copyright (C) 2017 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 "JsonEditorDialog.h" +#include "ui_JsonEditorDialog.h" +#include "SnapmaticEditor.h" +#include "AppEnv.h" +#include +#include +#include + +#if QT_VERSION >= 0x050200 +#include +#include +#endif + +JsonEditorDialog::JsonEditorDialog(SnapmaticPicture *picture, QWidget *parent) : + QDialog(parent), smpic(picture), + ui(new Ui::JsonEditorDialog) +{ + // Set Window Flags + setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint^Qt::WindowMinMaxButtonsHint); + + ui->setupUi(this); + if (QIcon::hasThemeIcon("dialog-close")) + { + ui->cmdClose->setIcon(QIcon::fromTheme("dialog-close")); + } + jsonCode = picture->getJsonStr(); + +#if QT_VERSION >= 0x050200 + ui->txtJSON->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)); +#endif + QFontMetrics fm(ui->txtJSON->font()); + ui->txtJSON->setTabStopWidth(fm.width(" ")); + + QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonCode.toUtf8()); + ui->txtJSON->setStyleSheet("QPlainTextEdit{background-color: rgb(46, 47, 48); color: rgb(238, 231, 172);}"); + ui->txtJSON->setPlainText(QString::fromUtf8(jsonDocument.toJson(QJsonDocument::Indented)).trimmed()); + jsonHl = new JSHighlighter(ui->txtJSON->document()); + + // DPI calculation + qreal screenRatio = AppEnv::screenRatio(); + ui->hlButtons->setContentsMargins(9 * screenRatio, 0, 9 * screenRatio, 0); + if (screenRatio > 1) + { + ui->lineJSON->setMinimumHeight(qRound(1 * screenRatio)); + ui->lineJSON->setMaximumHeight(qRound(1 * screenRatio)); + } + resize(450 * screenRatio, 550 * screenRatio); +} + +JsonEditorDialog::~JsonEditorDialog() +{ + delete jsonHl; + delete ui; +} + +void JsonEditorDialog::closeEvent(QCloseEvent *ev) +{ + QString jsonPatched = QString(ui->txtJSON->toPlainText()).replace("\t", " "); + QJsonDocument jsonNew = QJsonDocument::fromJson(jsonPatched.toUtf8()); + QJsonDocument jsonOriginal = QJsonDocument::fromJson(jsonCode.toUtf8()); + QString originalCode = QString::fromUtf8(jsonOriginal.toJson(QJsonDocument::Compact)); + QString newCode = QString::fromUtf8(jsonNew.toJson(QJsonDocument::Compact)); + if (newCode != originalCode) + { + QMessageBox::StandardButton button = QMessageBox::warning(this, SnapmaticEditor::tr("Snapmatic Properties"), SnapmaticEditor::tr("

Unsaved changes detected

You want to save the JSON content before you quit?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::Cancel); + if (button == QMessageBox::Yes) + { + if (saveJsonContent()) + { + ev->accept(); + } + else + { + ev->ignore(); + } + return; + } + else if (button == QMessageBox::No) + { + ev->accept(); + return; + } + else + { + ev->ignore(); + return; + } + } +} + +bool JsonEditorDialog::saveJsonContent() +{ + QString jsonPatched = QString(ui->txtJSON->toPlainText()).replace("\t", " "); + QJsonDocument jsonNew = QJsonDocument::fromJson(jsonPatched.toUtf8()); + if (!jsonNew.isEmpty()) + { + QJsonDocument jsonOriginal = QJsonDocument::fromJson(jsonCode.toUtf8()); + QString originalCode = QString::fromUtf8(jsonOriginal.toJson(QJsonDocument::Compact)); + QString newCode = QString::fromUtf8(jsonNew.toJson(QJsonDocument::Compact)); + if (newCode != originalCode) + { + QString currentFilePath = smpic->getPictureFilePath(); + QString originalFilePath = smpic->getOriginalPictureFilePath(); + QString backupFileName = originalFilePath % ".bak"; + if (!QFile::exists(backupFileName)) + { + QFile::copy(currentFilePath, backupFileName); + } + smpic->setJsonStr(newCode, true); + if (!smpic->isJsonOk()) + { + QMessageBox::warning(this, SnapmaticEditor::tr("Snapmatic Properties"), SnapmaticEditor::tr("Patching of Snapmatic Properties failed because of JSON Error")); + smpic->setJsonStr(originalCode, true); + return false; + } + if (!smpic->exportPicture(currentFilePath)) + { + QMessageBox::warning(this, SnapmaticEditor::tr("Snapmatic Properties"), SnapmaticEditor::tr("Patching of Snapmatic Properties failed because of I/O Error")); + smpic->setJsonStr(originalCode, true); + return false; + } + jsonCode = newCode; + smpic->emitUpdate(); + return true; + } + return true; + } + else + { + QMessageBox::warning(this, SnapmaticEditor::tr("Snapmatic Properties"), SnapmaticEditor::tr("Patching of Snapmatic Properties failed because of JSON Error")); + return false; + } +} + +void JsonEditorDialog::on_cmdClose_clicked() +{ + this->close(); +} + +void JsonEditorDialog::on_cmdSave_clicked() +{ + if (saveJsonContent()) + { + this->close(); + } +} diff --git a/JsonEditorDialog.h b/JsonEditorDialog.h new file mode 100644 index 0000000..b881088 --- /dev/null +++ b/JsonEditorDialog.h @@ -0,0 +1,56 @@ +/***************************************************************************** +* gta5sync GRAND THEFT AUTO V SYNC +* Copyright (C) 2017 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 JSONEDITORDIALOG_H +#define JSONEDITORDIALOG_H + +#include "SnapmaticPicture.h" +#include "JSHighlighter.h" +#include + +namespace Ui { +class JsonEditorDialog; +} + +class JsonEditorDialog : public QDialog +{ + Q_OBJECT + +public: + explicit JsonEditorDialog(SnapmaticPicture *picture, QWidget *parent = 0); + bool saveJsonContent(); + ~JsonEditorDialog(); + +protected: + void closeEvent(QCloseEvent *ev); + +private slots: + void on_cmdClose_clicked(); + void on_cmdSave_clicked(); + +signals: + void codeUpdated(QString jsonCode); + +private: + QString jsonCode; + JSHighlighter *jsonHl; + SnapmaticPicture *smpic; + Ui::JsonEditorDialog *ui; +}; + +#endif // JSONEDITORDIALOG_H diff --git a/JsonEditorDialog.ui b/JsonEditorDialog.ui new file mode 100644 index 0000000..3221c12 --- /dev/null +++ b/JsonEditorDialog.ui @@ -0,0 +1,124 @@ + + + JsonEditorDialog + + + + 0 + 0 + 550 + 450 + + + + Snapmatic JSON Editor + + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + QFrame[frameShape="4"] +{ + color: black; +} + + + QFrame::Plain + + + 1 + + + Qt::Horizontal + + + + + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + + + &Save + + + + + + + &Close + + + + + + + + + + diff --git a/MapLocationDialog.cpp b/MapLocationDialog.cpp index 03c2a45..64f7271 100644 --- a/MapLocationDialog.cpp +++ b/MapLocationDialog.cpp @@ -34,6 +34,7 @@ MapLocationDialog::MapLocationDialog(double x, double y, QWidget *parent) : ui->cmdApply->setVisible(false); ui->cmdRevert->setVisible(false); ui->cmdDone->setCursor(Qt::ArrowCursor); + ui->cmdClose->setCursor(Qt::ArrowCursor); // DPI calculation qreal screenRatio = AppEnv::screenRatio(); diff --git a/MapLocationDialog.h b/MapLocationDialog.h index 5d0793a..1abfa93 100644 --- a/MapLocationDialog.h +++ b/MapLocationDialog.h @@ -51,13 +51,13 @@ private slots: void on_cmdClose_clicked(); private: - Ui::MapLocationDialog *ui; double xpos_old; double ypos_old; double xpos_new; double ypos_new; bool propUpdate; bool changeMode; + Ui::MapLocationDialog *ui; }; #endif // MAPLOCATIONDIALOG_H diff --git a/OptionsDialog.cpp b/OptionsDialog.cpp index a9d8fea..a7b9ce7 100755 --- a/OptionsDialog.cpp +++ b/OptionsDialog.cpp @@ -25,6 +25,7 @@ #include "config.h" #include #include +#include #include #include #include @@ -72,18 +73,19 @@ OptionsDialog::OptionsDialog(ProfileDatabase *profileDB, QWidget *parent) : ui->cmdCancel->setIcon(QIcon::fromTheme("dialog-cancel")); } - // DPI calculation - qreal screenRatio = AppEnv::screenRatio(); - resize(435 * screenRatio, 405 * screenRatio); - setupTreeWidget(); setupLanguageBox(); setupRadioButtons(); setupDefaultProfile(); setupPictureSettings(); setupCustomGTAFolder(); + setupInterfaceSettings(); setupSnapmaticPictureViewer(); + // DPI calculation + qreal screenRatio = AppEnv::screenRatio(); + resize(435 * screenRatio, 405 * screenRatio); + #ifdef GTA5SYNC_DISABLED ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabSync)); #endif @@ -239,6 +241,61 @@ void OptionsDialog::setupRadioButtons() } } +void OptionsDialog::setupInterfaceSettings() +{ + settings->beginGroup("Startup"); + bool alwaysUseMessageFont = settings->value("AlwaysUseMessageFont", false).toBool(); + ui->cbAlwaysUseMessageFont->setChecked(alwaysUseMessageFont); +#ifdef GTA5SYNC_WIN + if (QSysInfo::windowsVersion() >= 0x0080) + { + ui->gbFont->setVisible(false); + ui->cbAlwaysUseMessageFont->setVisible(false); + } +#else + ui->gbFont->setVisible(false); + ui->cbAlwaysUseMessageFont->setVisible(false); +#endif + QString currentStyle = qApp->style()->objectName(); + QString appStyle = settings->value("AppStyle", currentStyle).toString(); + bool customStyle = settings->value("CustomStyle", false).toBool(); + const QStringList availableStyles = QStyleFactory::keys(); + ui->cbStyleList->addItems(availableStyles); + if (availableStyles.contains(appStyle, Qt::CaseInsensitive)) + { + // use 'for' for select to be sure it's case insensitive + int currentIndex = 0; + for (QString currentStyleFF : availableStyles) + { + if (currentStyleFF.toLower() == appStyle.toLower()) + { + ui->cbStyleList->setCurrentIndex(currentIndex); + } + currentIndex++; + } + } + else + { + if (availableStyles.contains(currentStyle, Qt::CaseInsensitive)) + { + int currentIndex = 0; + for (QString currentStyleFF : availableStyles) + { + if (currentStyleFF.toLower() == currentStyle.toLower()) + { + ui->cbStyleList->setCurrentIndex(currentIndex); + } + currentIndex++; + } + } + } + if (customStyle) + { + ui->cbDefaultStyle->setChecked(false); + } + settings->endGroup(); +} + void OptionsDialog::on_cmdOK_clicked() { applySettings(); @@ -310,6 +367,22 @@ void OptionsDialog::applySettings() settings->setValue("force", forceCustomFolder); settings->endGroup(); + bool defaultStyle = ui->cbDefaultStyle->isChecked(); + settings->beginGroup("Startup"); + if (!defaultStyle) + { + QString newStyle = ui->cbStyleList->currentText(); + settings->setValue("CustomStyle", true); + settings->setValue("AppStyle", newStyle); + qApp->setStyle(QStyleFactory::create(newStyle)); + } + else + { + settings->setValue("CustomStyle", false); + } + settings->setValue("AlwaysUseMessageFont", ui->cbAlwaysUseMessageFont->isChecked()); + settings->endGroup(); + #if QT_VERSION >= 0x050000 bool languageChanged = ui->cbLanguage->currentData().toString() != currentLanguage; bool languageAreaChanged = ui->cbAreaLanguage->currentData().toString() != currentAreaLanguage; @@ -494,3 +567,8 @@ void OptionsDialog::on_cmdExploreFolder_clicked() ui->txtFolder->setText(GTAV_Folder); } } + +void OptionsDialog::on_cbDefaultStyle_toggled(bool checked) +{ + ui->cbStyleList->setDisabled(checked); +} diff --git a/OptionsDialog.h b/OptionsDialog.h index 18715b6..03d2e81 100755 --- a/OptionsDialog.h +++ b/OptionsDialog.h @@ -46,6 +46,7 @@ private slots: void on_hsPicQuality_valueChanged(int value); void on_cbIgnoreAspectRatio_toggled(bool checked); void on_cmdExploreFolder_clicked(); + void on_cbDefaultStyle_toggled(bool checked); signals: void settingsApplied(int contentMode, bool languageChanged); @@ -61,6 +62,7 @@ private: QString defaultProfile; QString percentString; QSettings *settings; + bool withoutPlayers; bool currentFFolder; int contentMode; int customQuality; @@ -73,6 +75,7 @@ private: void setupDefaultProfile(); void setupPictureSettings(); void setupCustomGTAFolder(); + void setupInterfaceSettings(); void setupSnapmaticPictureViewer(); void applySettings(); }; diff --git a/OptionsDialog.ui b/OptionsDialog.ui index c23d9ba..1a70c0f 100755 --- a/OptionsDialog.ui +++ b/OptionsDialog.ui @@ -314,7 +314,7 @@ - + Qt::Vertical @@ -382,15 +382,15 @@ - + - Language + Interface - + - Interface + Language for Interface @@ -409,9 +409,9 @@ - Areas + Language for Areas - + @@ -425,6 +425,65 @@ + + + + Style + + + + + + Use Default Style (Restart) + + + true + + + + + + + + + Style: + + + + + + + false + + + + 0 + 0 + + + + + + + + + + + + + Font + + + + + + Always use Message Font (Windows 2003 and earlier) + + + + + + diff --git a/PictureDialog.cpp b/PictureDialog.cpp index d8c1646..1e8837c 100755 --- a/PictureDialog.cpp +++ b/PictureDialog.cpp @@ -22,6 +22,7 @@ #include "ui_PictureDialog.h" #include "SidebarGenerator.h" #include "MapLocationDialog.h" +#include "JsonEditorDialog.h" #include "SnapmaticEditor.h" #include "StandardPaths.h" #include "PictureExport.h" @@ -62,6 +63,17 @@ #include #include +// Macros for better Overview + RAM +#define locX QString::number(picture->getSnapmaticProperties().location.x) +#define locY QString::number(picture->getSnapmaticProperties().location.y) +#define locZ QString::number(picture->getSnapmaticProperties().location.z) +#define crewID QString::number(picture->getSnapmaticProperties().crewID) +#define picArea picture->getSnapmaticProperties().location.area +#define picPath picture->getPictureFilePath() +#define picTitl StringParser::escapeString(picture->getPictureTitle()) +#define plyrsList picture->getSnapmaticProperties().playersList +#define created picture->getSnapmaticProperties().createdDateTime.toString(Qt::DefaultLocaleShortDate) + PictureDialog::PictureDialog(ProfileDatabase *profileDB, CrewDatabase *crewDB, QWidget *parent) : QDialog(parent), profileDB(profileDB), crewDB(crewDB), ui(new Ui::PictureDialog) @@ -102,22 +114,13 @@ void PictureDialog::setupPictureDialog(bool withDatabase_) windowTitleStr = this->windowTitle(); jsonDrawString = ui->labJSON->text(); ui->cmdManage->setEnabled(false); - plyrsList = QStringList(); fullscreenWidget = nullptr; rqFullscreen = false; previewMode = false; naviEnabled = false; indexed = false; - picArea = ""; - picTitl = ""; - picPath = ""; - created = ""; - crewStr = ""; - crewID = ""; - locX = ""; - locY = ""; - locZ = ""; smpic = nullptr; + crewStr = ""; // With datebase withDatabase = withDatabase_; @@ -145,9 +148,11 @@ void PictureDialog::setupPictureDialog(bool withDatabase_) jpegExportAction = manageMenu->addAction(tr("Export as &Picture..."), this, SLOT(exportSnapmaticPicture())); pgtaExportAction = manageMenu->addAction(tr("Export as &Snapmatic..."), this, SLOT(copySnapmaticPicture())); manageMenuSep1 = manageMenu->addSeparator(); - openViewerAction = manageMenu->addAction(tr("Open &Map View..."), this, SLOT(openPreviewMap())); - openViewerAction->setShortcut(Qt::Key_M); propEditorAction = manageMenu->addAction(tr("&Edit Properties..."), this, SLOT(editSnapmaticProperties())); + manageMenuSep2 = manageMenu->addSeparator(); + openViewerAction = manageMenu->addAction(tr("Open &Map Viewer..."), this, SLOT(openPreviewMap())); + openViewerAction->setShortcut(Qt::Key_M); + jsonEditorAction = manageMenu->addAction(tr("Open &JSON Editor..."), this, SLOT(editSnapmaticRawJson())); ui->cmdManage->setMenu(manageMenu); // Global map @@ -176,9 +181,11 @@ PictureDialog::~PictureDialog() { delete propEditorAction; delete openViewerAction; + delete jsonEditorAction; delete jpegExportAction; delete pgtaExportAction; delete manageMenuSep1; + delete manageMenuSep2; delete manageMenu; delete ui; } @@ -426,7 +433,6 @@ void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, bool readOk, snapmaticPicture = QImage(); indexed = _indexed; index = _index; - picPath = picture->getPictureFilePath(); smpic = picture; if (!readOk) { @@ -441,23 +447,14 @@ void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, bool readOk, } if (picture->isJsonOk()) { - locX = QString::number(picture->getSnapmaticProperties().location.x); - locY = QString::number(picture->getSnapmaticProperties().location.y); - locZ = QString::number(picture->getSnapmaticProperties().location.z); if (withDatabase) { - crewID = QString::number(picture->getSnapmaticProperties().crewID); - crewStr = crewDB->getCrewName(picture->getSnapmaticProperties().crewID); + crewStr = crewDB->getCrewName(crewID); } else { - crewID = QString::number(picture->getSnapmaticProperties().crewID); - crewStr = QString::number(picture->getSnapmaticProperties().crewID); + crewStr = crewID; } - created = picture->getSnapmaticProperties().createdDateTime.toString(Qt::DefaultLocaleShortDate); - plyrsList = picture->getSnapmaticProperties().playersList; - picTitl = StringParser::escapeString(picture->getPictureTitle()); - picArea = picture->getSnapmaticProperties().location.area; if (globalMap.contains(picArea)) { picAreaStr = globalMap[picArea]; @@ -565,15 +562,18 @@ void PictureDialog::renderPicture() void PictureDialog::crewNameUpdated() { - if (withDatabase && crewID == crewStr) + SnapmaticPicture *picture = smpic; // used by macro + QString crewIDStr = crewID; + if (withDatabase && crewIDStr == crewStr) { - crewStr = crewDB->getCrewName(crewID.toInt()); + crewStr = crewDB->getCrewName(crewIDStr); ui->labJSON->setText(jsonDrawString.arg(locX, locY, locZ, generatePlayersString(), generateCrewString(), picTitl, picAreaStr, created)); } } void PictureDialog::playerNameUpdated() { + SnapmaticPicture *picture = smpic; // used by macro if (plyrsList.count() >= 1) { ui->labJSON->setText(jsonDrawString.arg(locX, locY, locZ, generatePlayersString(), generateCrewString(), picTitl, picAreaStr, created)); @@ -582,19 +582,23 @@ void PictureDialog::playerNameUpdated() QString PictureDialog::generateCrewString() { - if (crewID != "0" && !crewID.isEmpty()) + SnapmaticPicture *picture = smpic; // used by macro + QString crewIDStr = crewID; // save operation time + if (crewIDStr != "0" && !crewIDStr.isEmpty()) { - return QString("" % crewStr % ""); + return QString("" % crewStr % ""); } return tr("No Crew"); } QString PictureDialog::generatePlayersString() { + SnapmaticPicture *picture = smpic; // used by macro + const QStringList playersList = plyrsList; // save operation time QString plyrsStr; - if (plyrsList.length() >= 1) + if (playersList.length() >= 1) { - for (QString player : plyrsList) + for (QString player : playersList) { QString playerName; if (withDatabase) @@ -691,14 +695,15 @@ int PictureDialog::getIndex() void PictureDialog::openPreviewMap() { + SnapmaticPicture *picture = smpic; MapLocationDialog *mapLocDialog; if (rqFullscreen && fullscreenWidget != nullptr) { - mapLocDialog = new MapLocationDialog(smpic->getSnapmaticProperties().location.x, smpic->getSnapmaticProperties().location.y, fullscreenWidget); + mapLocDialog = new MapLocationDialog(picture->getSnapmaticProperties().location.x, picture->getSnapmaticProperties().location.y, fullscreenWidget); } else { - mapLocDialog = new MapLocationDialog(smpic->getSnapmaticProperties().location.x, smpic->getSnapmaticProperties().location.y, this); + mapLocDialog = new MapLocationDialog(picture->getSnapmaticProperties().location.x, picture->getSnapmaticProperties().location.y, this); } mapLocDialog->setWindowIcon(windowIcon()); mapLocDialog->setModal(true); @@ -707,25 +712,25 @@ void PictureDialog::openPreviewMap() if (mapLocDialog->propUpdated()) { // Update Snapmatic Properties - SnapmaticProperties localSpJson = smpic->getSnapmaticProperties(); + SnapmaticProperties localSpJson = picture->getSnapmaticProperties(); localSpJson.location.x = mapLocDialog->getXpos(); localSpJson.location.y = mapLocDialog->getYpos(); localSpJson.location.z = 0; // Update Snapmatic Picture - QString currentFilePath = smpic->getPictureFilePath(); - QString originalFilePath = smpic->getOriginalPictureFilePath(); + QString currentFilePath = picture->getPictureFilePath(); + QString originalFilePath = picture->getOriginalPictureFilePath(); QString backupFileName = originalFilePath % ".bak"; if (!QFile::exists(backupFileName)) { QFile::copy(currentFilePath, backupFileName); } - SnapmaticProperties fallbackProperties = smpic->getSnapmaticProperties(); - smpic->setSnapmaticProperties(localSpJson); - if (!smpic->exportPicture(currentFilePath)) + SnapmaticProperties fallbackProperties = picture->getSnapmaticProperties(); + picture->setSnapmaticProperties(localSpJson); + if (!picture->exportPicture(currentFilePath)) { QMessageBox::warning(this, SnapmaticEditor::tr("Snapmatic Properties"), SnapmaticEditor::tr("Patching of Snapmatic Properties failed because of I/O Error")); - smpic->setSnapmaticProperties(fallbackProperties); + picture->setSnapmaticProperties(fallbackProperties); } else { @@ -737,6 +742,7 @@ void PictureDialog::openPreviewMap() void PictureDialog::editSnapmaticProperties() { + SnapmaticPicture *picture = smpic; SnapmaticEditor *snapmaticEditor; if (rqFullscreen && fullscreenWidget != nullptr) { @@ -746,29 +752,42 @@ void PictureDialog::editSnapmaticProperties() { snapmaticEditor = new SnapmaticEditor(crewDB, this); } - snapmaticEditor->setWindowFlags(snapmaticEditor->windowFlags()^Qt::WindowContextHelpButtonHint); snapmaticEditor->setWindowIcon(windowIcon()); - snapmaticEditor->setSnapmaticPicture(smpic); + snapmaticEditor->setSnapmaticPicture(picture); snapmaticEditor->setModal(true); + snapmaticEditor->show(); snapmaticEditor->exec(); delete snapmaticEditor; } +void PictureDialog::editSnapmaticRawJson() +{ + SnapmaticPicture *picture = smpic; + JsonEditorDialog *jsonEditor = new JsonEditorDialog(picture, this); + jsonEditor->setModal(true); + jsonEditor->show(); + jsonEditor->exec(); + delete jsonEditor; +} + void PictureDialog::updated() { + SnapmaticPicture *picture = smpic; // used by macro if (withDatabase) { - crewID = QString::number(smpic->getSnapmaticProperties().crewID); - crewStr = crewDB->getCrewName(smpic->getSnapmaticProperties().crewID); + crewStr = crewDB->getCrewName(crewID); + } + else + { + crewStr = crewID; + } + if (globalMap.contains(picArea)) + { + picAreaStr = globalMap[picArea]; } else { - crewID = QString::number(smpic->getSnapmaticProperties().crewID); - crewStr = QString::number(smpic->getSnapmaticProperties().crewID); + picAreaStr = picArea; } - locX = QString::number(smpic->getSnapmaticProperties().location.x); - locY = QString::number(smpic->getSnapmaticProperties().location.y); - locZ = QString::number(smpic->getSnapmaticProperties().location.z); - picTitl = StringParser::escapeString(smpic->getPictureTitle()); ui->labJSON->setText(jsonDrawString.arg(locX, locY, locZ, generatePlayersString(), generateCrewString(), picTitl, picAreaStr, created)); } diff --git a/PictureDialog.h b/PictureDialog.h index 6a02338..89d154e 100755 --- a/PictureDialog.h +++ b/PictureDialog.h @@ -69,6 +69,7 @@ private slots: void nextPictureRequestedSlot(); void previousPictureRequestedSlot(); void editSnapmaticProperties(); + void editSnapmaticRawJson(); void renderOverlayPicture(); void renderPicture(); void openPreviewMap(); @@ -100,23 +101,16 @@ private: QAction *pgtaExportAction; QAction *propEditorAction; QAction *openViewerAction; + QAction *jsonEditorAction; QAction *manageMenuSep1; + QAction *manageMenuSep2; QImage avatarAreaPicture; QImage snapmaticPicture; QImage overlayTempImage; QString jsonDrawString; QString windowTitleStr; - QStringList plyrsList; QString picAreaStr; - QString picArea; - QString picTitl; - QString picPath; - QString created; QString crewStr; - QString crewID; - QString locX; - QString locY; - QString locZ; bool overlayEnabled; bool withDatabase; bool rqFullscreen; diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index 88dbcdd..50ea5c5 100755 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -54,6 +54,9 @@ #include #include +#define importTimeFormat "HHmmss" +#define findRetryLimit 500 + ProfileInterface::ProfileInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent) : QWidget(parent), profileDB(profileDB), crewDB(crewDB), threadDB(threadDB), ui(new Ui::ProfileInterface) @@ -446,7 +449,9 @@ fileDialogPreOpen: //Work? if (selectedFiles.length() == 1) { QString selectedFile = selectedFiles.at(0); - if (!importFile(selectedFile, true)) goto fileDialogPreOpen; //Work? + QDateTime importDateTime = QDateTime::currentDateTime(); + int currentTime = importDateTime.toString(importTimeFormat).toInt(); + if (!importFile(selectedFile, importDateTime, ¤tTime, true)) goto fileDialogPreOpen; //Work? } else if (selectedFiles.length() > 1) { @@ -486,13 +491,14 @@ void ProfileInterface::importFilesProgress(QStringList selectedFiles) pbBar.at(0)->setTextVisible(false); pbDialog.show(); - QTime t; - t.start(); + QDateTime importDateTime = QDateTime::currentDateTime(); + int currentTime = importDateTime.time().toString(importTimeFormat).toInt(); for (QString selectedFile : selectedFiles) { pbDialog.setValue(overallId); pbDialog.setLabelText(tr("Import file %1 of %2 files").arg(QString::number(overallId), QString::number(maximumId))); - if (!importFile(selectedFile, false)) + importDateTime = QDateTime::currentDateTime(); + if (!importFile(selectedFile, importDateTime, ¤tTime, false)) { failedFiles << QFileInfo(selectedFile).fileName(); } @@ -510,7 +516,7 @@ void ProfileInterface::importFilesProgress(QStringList selectedFiles) } } -bool ProfileInterface::importFile(QString selectedFile, bool notMultiple) +bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime, int *currentTime, bool notMultiple) { QString selectedFileName = QFileInfo(selectedFile).fileName(); if (QFile::exists(selectedFile)) @@ -590,7 +596,7 @@ bool ProfileInterface::importFile(QString selectedFile, bool notMultiple) diffWidth = diffWidth / 2; } snapmaticPainter.drawImage(145 + diffWidth, 66 + diffHeight, snapmaticImage); - customImageTitle = "Custom Avatar"; + customImageTitle = ImportDialog::tr("Custom Avatar", "Custom Avatar Description in SC, don't use Special Character!"); } else { @@ -609,7 +615,7 @@ bool ProfileInterface::importFile(QString selectedFile, bool notMultiple) diffHeight = diffHeight / 2; } snapmaticPainter.drawImage(0 + diffWidth, 0 + diffHeight, snapmaticImage); - customImageTitle = "Custom Picture"; + customImageTitle = ImportDialog::tr("Custom Picture", "Custom Picture Description in SC, don't use Special Character!"); } snapmaticPainter.end(); if (!picture->setImage(snapmaticPixmap.toImage())) @@ -617,23 +623,22 @@ bool ProfileInterface::importFile(QString selectedFile, bool notMultiple) delete picture; return false; } - QString currentTime = QTime::currentTime().toString("HHmmss"); SnapmaticProperties spJson = picture->getSnapmaticProperties(); - spJson.uid = QString(currentTime % - QString::number(QDate::currentDate().dayOfYear())).toInt(); + spJson.uid = QString(QString::number(*currentTime) % + QString::number(importDateTime.date().dayOfYear())).toInt(); bool fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid)); bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".hidden"); int cEnough = 0; - while ((fExists || fExistsHidden) && cEnough < 5000) + while ((fExists || fExistsHidden) && cEnough < findRetryLimit) { - currentTime = QString::number(currentTime.toInt() - 1); - spJson.uid = QString(currentTime % - QString::number(QDate::currentDate().dayOfYear())).toInt(); + *currentTime = *currentTime - 1; + spJson.uid = QString(QString::number(*currentTime) % + QString::number(importDateTime.date().dayOfYear())).toInt(); fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid)); fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".hidden"); cEnough++; } - spJson.createdDateTime = QDateTime::currentDateTime(); + spJson.createdDateTime = importDateTime; spJson.createdTimestamp = spJson.createdDateTime.toTime_t(); picture->setSnapmaticProperties(spJson); picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid))); @@ -672,23 +677,22 @@ bool ProfileInterface::importFile(QString selectedFile, bool notMultiple) { if (picture->setImage(importDialog->image())) { - QString currentTime = QTime::currentTime().toString("HHmmss"); SnapmaticProperties spJson = picture->getSnapmaticProperties(); - spJson.uid = QString(currentTime + - QString::number(QDate::currentDate().dayOfYear())).toInt(); + spJson.uid = QString(QString::number(*currentTime) % + QString::number(importDateTime.date().dayOfYear())).toInt(); bool fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid)); bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".hidden"); int cEnough = 0; - while ((fExists || fExistsHidden) && cEnough < 25) + while ((fExists || fExistsHidden) && cEnough < findRetryLimit) { - currentTime = QString::number(currentTime.toInt() - 1); - spJson.uid = QString(currentTime % - QString::number(QDate::currentDate().dayOfYear())).toInt(); + *currentTime = *currentTime - 1; + spJson.uid = QString(QString::number(*currentTime) % + QString::number(importDateTime.date().dayOfYear())).toInt(); fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid)); fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".hidden"); cEnough++; } - spJson.createdDateTime = QDateTime::currentDateTime(); + spJson.createdDateTime = importDateTime; spJson.createdTimestamp = spJson.createdDateTime.toTime_t(); picture->setSnapmaticProperties(spJson); picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid))); @@ -1158,6 +1162,9 @@ void ProfileInterface::contextMenuTriggeredPIC(QContextMenuEvent *ev) editMenu.addAction(SnapmaticWidget::tr("Hide &In-game"), picWidget, SLOT(makePictureHiddenSlot())); } editMenu.addAction(PictureDialog::tr("&Edit Properties..."), picWidget, SLOT(editSnapmaticProperties())); + editMenu.addSeparator(); + editMenu.addAction(PictureDialog::tr("Open &Map Viewer..."), picWidget, SLOT(openMapViewer())); + editMenu.addAction(PictureDialog::tr("Open &JSON Editor..."), picWidget, SLOT(editSnapmaticRawJson())); QMenu exportMenu(SnapmaticWidget::tr("&Export"), this); exportMenu.addAction(PictureDialog::tr("Export as &Picture..."), picWidget, SLOT(on_cmdExport_clicked())); exportMenu.addAction(PictureDialog::tr("Export as &Snapmatic..."), picWidget, SLOT(on_cmdCopy_clicked())); @@ -1231,7 +1238,9 @@ void ProfileInterface::on_saProfileContent_dropped(const QMimeData *mimeData) if (pathList.length() == 1) { QString selectedFile = pathList.at(0); - importFile(selectedFile, true); + QDateTime importDateTime = QDateTime::currentDateTime(); + int currentTime = importDateTime.toString(importTimeFormat).toInt(); + importFile(selectedFile, QDateTime::currentDateTime(), ¤tTime, true); } else if (pathList.length() > 1) { diff --git a/ProfileInterface.h b/ProfileInterface.h index f93297c..8ccf76b 100755 --- a/ProfileInterface.h +++ b/ProfileInterface.h @@ -31,6 +31,7 @@ #include "CrewDatabase.h" #include #include +#include #include #include #include @@ -107,7 +108,7 @@ private: int contentMode; bool isSupportedImageFile(QString selectedFileName); - bool importFile(QString selectedFile, bool notMultiple); + bool importFile(QString selectedFile, QDateTime importDateTime, int *currentTime, bool notMultiple); void importFilesProgress(QStringList selectedFiles); bool importSnapmaticPicture(SnapmaticPicture *picture, bool warn = true); bool importSavegameData(SavegameData *savegame, QString sgdPath, bool warn = true); diff --git a/SnapmaticEditor.cpp b/SnapmaticEditor.cpp index 619e855..768013a 100644 --- a/SnapmaticEditor.cpp +++ b/SnapmaticEditor.cpp @@ -32,13 +32,24 @@ SnapmaticEditor::SnapmaticEditor(CrewDatabase *crewDB, QWidget *parent) : QDialog(parent), crewDB(crewDB), ui(new Ui::SnapmaticEditor) { + // Set Window Flags + setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint); + ui->setupUi(this); ui->cmdApply->setDefault(true); - if (QIcon::hasThemeIcon("dialog-apply")) + if (QIcon::hasThemeIcon("dialog-ok-apply")) + { + ui->cmdApply->setIcon(QIcon::fromTheme("dialog-ok-apply")); + } + else if (QIcon::hasThemeIcon("dialog-apply")) { ui->cmdApply->setIcon(QIcon::fromTheme("dialog-apply")); } + else if (QIcon::hasThemeIcon("dialog-ok")) + { + ui->cmdApply->setIcon(QIcon::fromTheme("dialog-ok")); + } if (QIcon::hasThemeIcon("dialog-cancel")) { ui->cmdCancel->setIcon(QIcon::fromTheme("dialog-cancel")); diff --git a/SnapmaticPicture.cpp b/SnapmaticPicture.cpp index e1ca220..4d9147e 100755 --- a/SnapmaticPicture.cpp +++ b/SnapmaticPicture.cpp @@ -774,60 +774,119 @@ void SnapmaticPicture::parseJsonContent() { QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonStr.toUtf8()); QJsonObject jsonObject = jsonDocument.object(); - QVariantMap jsonMap = jsonObject.toVariantMap(); // backward compatibility + QVariantMap jsonMap = jsonObject.toVariantMap(); + bool jsonIncomplete = false; + bool jsonError = false; if (jsonObject.contains("loc")) { - QJsonObject locObject = jsonObject["loc"].toObject(); - if (locObject.contains("x")) { localSpJson.location.x = locObject["x"].toDouble(); } - if (locObject.contains("y")) { localSpJson.location.y = locObject["y"].toDouble(); } - if (locObject.contains("z")) { localSpJson.location.z = locObject["z"].toDouble(); } + if (jsonObject["loc"].isObject()) + { + QJsonObject locObject = jsonObject["loc"].toObject(); + if (locObject.contains("x")) + { + if (locObject["x"].isDouble()) { localSpJson.location.x = locObject["x"].toDouble(); } + else { jsonError = true; } + } + else { jsonIncomplete = true; } + if (locObject.contains("y")) + { + if (locObject["y"].isDouble()) { localSpJson.location.y = locObject["y"].toDouble(); } + else { jsonError = true; } + } + else { jsonIncomplete = true; } + if (locObject.contains("z")) + { + if (locObject["z"].isDouble()) { localSpJson.location.z = locObject["z"].toDouble(); } + else { jsonError = true; } + } + else { jsonIncomplete = true; } + } + else { jsonError = true; } } + else { jsonIncomplete = true; } if (jsonObject.contains("uid")) { - localSpJson.uid = jsonObject["uid"].toInt(); + bool uidOk; + localSpJson.uid = jsonMap["uid"].toInt(&uidOk); + if (!uidOk) { jsonError = true; } } + else { jsonIncomplete = true; } if (jsonObject.contains("area")) { - localSpJson.location.area = jsonObject["area"].toString(); + if (jsonObject["area"].isString()) { localSpJson.location.area = jsonObject["area"].toString(); } + else { jsonError = true; } } + else { jsonIncomplete = true; } if (jsonObject.contains("crewid")) { - localSpJson.crewID = jsonObject["crewid"].toInt(); + bool crewIDOk; + localSpJson.crewID = jsonMap["crewid"].toInt(&crewIDOk); + if (!crewIDOk) { jsonError = true; } } + else { jsonIncomplete = true; } + if (jsonObject.contains("street")) + { + bool streetIDOk; + localSpJson.streetID = jsonMap["street"].toInt(&streetIDOk); + if (!streetIDOk) { jsonError = true; } + } + else { jsonIncomplete = true; } if (jsonObject.contains("creat")) { + bool timestampOk; QDateTime createdTimestamp; - localSpJson.createdTimestamp = jsonMap["creat"].toUInt(); + localSpJson.createdTimestamp = jsonMap["creat"].toUInt(×tampOk); createdTimestamp.setTime_t(localSpJson.createdTimestamp); localSpJson.createdDateTime = createdTimestamp; + if (!timestampOk) { jsonError = true; } } + else { jsonIncomplete = true; } if (jsonObject.contains("plyrs")) { - localSpJson.playersList = jsonMap["plyrs"].toStringList(); + if (jsonObject["plyrs"].isArray()) { localSpJson.playersList = jsonMap["plyrs"].toStringList(); } + else { jsonError = true; } } + else { jsonIncomplete = true; } if (jsonObject.contains("meme")) { - localSpJson.isMeme = jsonObject["meme"].toBool(); + if (jsonObject["meme"].isBool()) { localSpJson.isMeme = jsonObject["meme"].toBool(); } + else { jsonError = true; } } + else { jsonIncomplete = true; } if (jsonObject.contains("mug")) { - localSpJson.isMug = jsonObject["mug"].toBool(); + if (jsonObject["mug"].isBool()) { localSpJson.isMug = jsonObject["mug"].toBool(); } + else { jsonError = true; } } + else { jsonIncomplete = true; } if (jsonObject.contains("slf")) { - localSpJson.isSelfie = jsonObject["slf"].toBool(); + if (jsonObject["slf"].isBool()) { localSpJson.isSelfie = jsonObject["slf"].toBool(); } + else { jsonError = true; } } + else { jsonIncomplete = true; } if (jsonObject.contains("drctr")) { - localSpJson.isFromDirector = jsonObject["drctr"].toBool(); + if (jsonObject["drctr"].isBool()) { localSpJson.isFromDirector = jsonObject["drctr"].toBool(); } + else { jsonError = true; } } + else { jsonIncomplete = true; } if (jsonObject.contains("rsedtr")) { - localSpJson.isFromRSEditor = jsonObject["rsedtr"].toBool(); + if (jsonObject["rsedtr"].isBool()) { localSpJson.isFromRSEditor = jsonObject["rsedtr"].toBool(); } + else { jsonError = true; } } + else { jsonIncomplete = true; } - jsonOk = true; + if (!jsonIncomplete && !jsonError) + { + jsonOk = true; + } + else + { + jsonOk = false; + } } bool SnapmaticPicture::setSnapmaticProperties(SnapmaticProperties newSpJson) @@ -844,6 +903,7 @@ bool SnapmaticPicture::setSnapmaticProperties(SnapmaticProperties newSpJson) jsonObject["uid"] = newSpJson.uid; jsonObject["area"] = newSpJson.location.area; jsonObject["crewid"] = newSpJson.crewID; + jsonObject["street"] = newSpJson.streetID; jsonObject["creat"] = QJsonValue::fromVariant(newSpJson.createdTimestamp); jsonObject["plyrs"] = QJsonValue::fromVariant(newSpJson.playersList); jsonObject["meme"] = newSpJson.isMeme; @@ -862,7 +922,7 @@ bool SnapmaticPicture::setSnapmaticProperties(SnapmaticProperties newSpJson) return false; } -bool SnapmaticPicture::setJsonStr(const QString &newJsonStr) +bool SnapmaticPicture::setJsonStr(const QString &newJsonStr, bool updateProperties) { if (newJsonStr.length() < jsonStreamEditorLength) { @@ -887,6 +947,7 @@ bool SnapmaticPicture::setJsonStr(const QString &newJsonStr) { jsonStr = newJsonStr; if (lowRamMode) { rawPicContent = qCompress(rawPicContent, 9); } + if (updateProperties) { parseJsonContent(); } return true; } else diff --git a/SnapmaticPicture.h b/SnapmaticPicture.h index e0db134..206a9ec 100755 --- a/SnapmaticPicture.h +++ b/SnapmaticPicture.h @@ -37,6 +37,7 @@ struct SnapmaticProperties { }; int uid; int crewID; + int streetID; QStringList playersList; uint createdTimestamp; QDateTime createdDateTime; @@ -96,7 +97,7 @@ public: QString getJsonStr(); SnapmaticProperties getSnapmaticProperties(); bool setSnapmaticProperties(SnapmaticProperties newSpJson); - bool setJsonStr(const QString &jsonStr); + bool setJsonStr(const QString &jsonStr, bool updateProperties = false); // VISIBILITY bool isHidden(); diff --git a/SnapmaticWidget.cpp b/SnapmaticWidget.cpp index dd5ca98..789c2e9 100755 --- a/SnapmaticWidget.cpp +++ b/SnapmaticWidget.cpp @@ -18,6 +18,8 @@ #include "SnapmaticWidget.h" #include "ui_SnapmaticWidget.h" +#include "MapLocationDialog.h" +#include "JsonEditorDialog.h" #include "SnapmaticPicture.h" #include "SnapmaticEditor.h" #include "DatabaseThread.h" @@ -283,13 +285,57 @@ void SnapmaticWidget::makePictureVisibleSlot() void SnapmaticWidget::editSnapmaticProperties() { SnapmaticEditor *snapmaticEditor = new SnapmaticEditor(crewDB, this); - snapmaticEditor->setWindowFlags(snapmaticEditor->windowFlags()^Qt::WindowContextHelpButtonHint); snapmaticEditor->setSnapmaticPicture(smpic); snapmaticEditor->setModal(true); + snapmaticEditor->show(); snapmaticEditor->exec(); delete snapmaticEditor; } +void SnapmaticWidget::editSnapmaticRawJson() +{ + JsonEditorDialog *jsonEditor = new JsonEditorDialog(smpic, this); + jsonEditor->setModal(true); + jsonEditor->show(); + jsonEditor->exec(); + delete jsonEditor; +} + +void SnapmaticWidget::openMapViewer() +{ + SnapmaticPicture *picture = smpic; + MapLocationDialog *mapLocDialog; + mapLocDialog = new MapLocationDialog(picture->getSnapmaticProperties().location.x, picture->getSnapmaticProperties().location.y, this); + mapLocDialog->setModal(true); + mapLocDialog->show(); + mapLocDialog->exec(); + if (mapLocDialog->propUpdated()) + { + // Update Snapmatic Properties + SnapmaticProperties localSpJson = picture->getSnapmaticProperties(); + localSpJson.location.x = mapLocDialog->getXpos(); + localSpJson.location.y = mapLocDialog->getYpos(); + localSpJson.location.z = 0; + + // Update Snapmatic Picture + QString currentFilePath = picture->getPictureFilePath(); + QString originalFilePath = picture->getOriginalPictureFilePath(); + QString backupFileName = originalFilePath % ".bak"; + if (!QFile::exists(backupFileName)) + { + QFile::copy(currentFilePath, backupFileName); + } + SnapmaticProperties fallbackProperties = picture->getSnapmaticProperties(); + picture->setSnapmaticProperties(localSpJson); + if (!picture->exportPicture(currentFilePath)) + { + QMessageBox::warning(this, SnapmaticEditor::tr("Snapmatic Properties"), SnapmaticEditor::tr("Patching of Snapmatic Properties failed because of I/O Error")); + picture->setSnapmaticProperties(fallbackProperties); + } + } + delete mapLocDialog; +} + bool SnapmaticWidget::isSelected() { return ui->cbSelected->isChecked(); diff --git a/SnapmaticWidget.h b/SnapmaticWidget.h index 9a7b3f3..bc5b087 100755 --- a/SnapmaticWidget.h +++ b/SnapmaticWidget.h @@ -68,6 +68,8 @@ private slots: void makePictureVisibleSlot(); void makePictureHiddenSlot(); void editSnapmaticProperties(); + void editSnapmaticRawJson(); + void openMapViewer(); void snapmaticUpdated(); protected: diff --git a/anpro/JSHighlighter.cpp b/anpro/JSHighlighter.cpp new file mode 100644 index 0000000..6d3b93c --- /dev/null +++ b/anpro/JSHighlighter.cpp @@ -0,0 +1,72 @@ +/***************************************************************************** +* gta5sync GRAND THEFT AUTO V SYNC +* Copyright (C) 2017 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 "JSHighlighter.h" +#include + +JSHighlighter::JSHighlighter(QTextDocument *parent) : + QSyntaxHighlighter(parent) +{ + HighlightingRule rule; + + QBrush keywordBrush(QColor::fromRgb(66, 137, 244)); + keywordFormat.setForeground(keywordBrush); + keywordFormat.setFontItalic(true); + QStringList keywordPatterns; + keywordPatterns << "\\btrue\\b" << "\\bfalse\\b"; + for (QString pattern : keywordPatterns) + { + rule.pattern = QRegExp(pattern); + rule.format = keywordFormat; + highlightingRules.append(rule); + } + + QBrush doubleBrush(QColor::fromRgb(66, 137, 244)); + doubleFormat.setForeground(doubleBrush); + rule.pattern = QRegExp("[+-]?\\d*\\.?\\d+"); + rule.format = doubleFormat; + highlightingRules.append(rule); + + QBrush quotationBrush(QColor::fromRgb(66, 244, 104)); + quotationFormat.setForeground(quotationBrush); + rule.pattern = QRegExp("\"[^\"]*\""); + rule.format = quotationFormat; + highlightingRules.append(rule); + + QBrush objectBrush(QColor::fromRgb(255, 80, 80)); + objectFormat.setForeground(objectBrush); + rule.pattern = QRegExp("\"[^\"]*\"(?=:)"); + rule.format = objectFormat; + highlightingRules.append(rule); +} + +void JSHighlighter::highlightBlock(const QString &text) +{ + for (HighlightingRule rule : highlightingRules) + { + QRegExp expression(rule.pattern); + int index = expression.indexIn(text); + while (index >= 0) + { + int length = expression.matchedLength(); + setFormat(index, length, rule.format); + index = expression.indexIn(text, index + length); + } + } + setCurrentBlockState(0); +} diff --git a/anpro/JSHighlighter.h b/anpro/JSHighlighter.h new file mode 100644 index 0000000..08a0eb5 --- /dev/null +++ b/anpro/JSHighlighter.h @@ -0,0 +1,56 @@ +/***************************************************************************** +* gta5sync GRAND THEFT AUTO V SYNC +* Copyright (C) 2017 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 JSHIGHLIGHTER_H +#define JSHIGHLIGHTER_H + +#include +#include +#include +#include +#include +#include +#include +#include + +class QTextDocument; + +class JSHighlighter : public QSyntaxHighlighter +{ + Q_OBJECT + +public: + struct HighlightingRule + { + QRegExp pattern; + QTextCharFormat format; + }; + QVector highlightingRules; + + QTextCharFormat keywordFormat; + QTextCharFormat doubleFormat; + QTextCharFormat quotationFormat; + QTextCharFormat objectFormat; + + JSHighlighter(QTextDocument *parent = 0); + +protected: + void highlightBlock(const QString &text) override; +}; + +#endif // JSHIGHLIGHTER_H diff --git a/config.h b/config.h index f43dc83..0848287 100755 --- a/config.h +++ b/config.h @@ -50,7 +50,7 @@ #ifndef GTA5SYNC_APPVER #ifndef GTA5SYNC_DAILYB -#define GTA5SYNC_APPVER "1.5.0-dev3" +#define GTA5SYNC_APPVER "1.5.0-dev4" #else #define GTA5SYNC_APPVER GTA5SYNC_DAILYB #endif diff --git a/gta5view.pro b/gta5view.pro index 9d7ec08..61fb0d4 100755 --- a/gta5view.pro +++ b/gta5view.pro @@ -38,6 +38,7 @@ SOURCES += main.cpp \ GlobalString.cpp \ IconLoader.cpp \ ImportDialog.cpp \ + JsonEditorDialog.cpp \ MapLocationDialog.cpp \ OptionsDialog.cpp \ PictureDialog.cpp \ @@ -59,6 +60,7 @@ SOURCES += main.cpp \ StringParser.cpp \ TranslationClass.cpp \ UserInterface.cpp \ + anpro/JSHighlighter.cpp \ uimod/UiModLabel.cpp \ uimod/UiModWidget.cpp @@ -72,6 +74,7 @@ HEADERS += \ GlobalString.h \ IconLoader.h \ ImportDialog.h \ + JsonEditorDialog.h \ MapLocationDialog.h \ OptionsDialog.h \ PictureDialog.h \ @@ -93,6 +96,7 @@ HEADERS += \ StringParser.h \ TranslationClass.h \ UserInterface.h \ + anpro/JSHighlighter.h \ uimod/UiModLabel.h \ uimod/UiModWidget.h @@ -100,6 +104,7 @@ FORMS += \ AboutDialog.ui \ ExportDialog.ui \ ImportDialog.ui \ + JsonEditorDialog.ui \ MapLocationDialog.ui \ OptionsDialog.ui \ PictureDialog.ui \ @@ -131,7 +136,7 @@ DISTFILES += res/app.rc \ lang/gta5sync_no.ts \ lang/README.txt -INCLUDEPATH += ./uimod +INCLUDEPATH += ./anpro ./uimod # GTA5SYNC/GTA5VIEW ONLY diff --git a/lang/gta5sync_no.ts b/lang/gta5sync_no.ts index 81a61d4..c6a588e 100644 --- a/lang/gta5sync_no.ts +++ b/lang/gta5sync_no.ts @@ -114,6 +114,7 @@ Pictures and Savegames CrewDatabase + No Crew @@ -196,7 +197,7 @@ Pictures and Savegames - + Background Colour: <span style="color: %1">%1</span> @@ -236,29 +237,93 @@ 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! + + + + Are you sure to use a square image outside of the Avatar Zone? When you want to use it as Avatar the image will be detached! - + Snapmatic Avatar Zone - + Select Colour... - MapPreviewDialog + JsonEditorDialog + + + Snapmatic JSON Editor + + - + + &Save + + + + + &Close + + + + + MapLocationDialog + + Snapmatic Map Viewer + + + &Close + + + + + &Apply + + + + + &Revert + + + + + &Set + + + + + &Done + + + + + X: %1 +Y: %2 + X and Y position + + OptionsDialog @@ -395,75 +460,129 @@ When you want to use it as Avatar the image will be detached! + Interface + + + - Language + Language for Interface + + + + + + + + Current: %1 + + + + + Language for Areas + + + + + Style + + + + + Use Default Style (Restart) - + + Style: + + + + + Font + + + + + Always use Message Font (Windows 2003 and earlier) + + + + Sync - + Sync is not implemented at current time - + Apply changes - + &OK OK, Cancel, Apply - + Discard changes - + &Cancel OK, Cancel, Apply - + %1 (Next Closest Language) First language a person can talk with a different person/application. "Native" or "Not Native". - + System System in context of System default - + + %1 (Closest to Interface) + Next closest language compared to the Interface + + + + + Auto + Automatic language choice. + + + + %1 %1 - + The new Custom Folder will initialise after you restart %1. - + No Profile No Profile, as default - - - + + + Profile: %1 @@ -504,66 +623,73 @@ When you want to use it as Avatar the image will be detached! - - + + Export as &Picture... - - + + Export as &Snapmatic... - - Open &Map View... + + + &Edit Properties... - - - &Edit Properties... + + + 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 Crew - + Unknown Location - - + + No Players - + Avatar Preview Mode Press 1 for Default View @@ -717,212 +843,212 @@ Press 1 for Default View - + Enabled pictures: %1 of %2 - + Loading... - - + + Import... - - - - - - - - - - - - + + + + + + + + + + + + Import - - + + GTA V Export (*.g5e) - - + + Savegames files (SGTA*) - - + + Snapmatic pictures (PGTA*) - + Importable files (%1) - + 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 parsed properly - + Can't import %1 because file format can't be detected - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e - + Failed to import the Snapmatic picture, the picture is already in the game - + 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: - + Export selected... - + 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 at remove the complete selected Snapmatic pictures and/or Savegame files - + All profile files (*.g5e SGTA* PGTA*) @@ -930,15 +1056,20 @@ 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? + + SavegameDialog @@ -1013,37 +1144,37 @@ Press 1 for Default View - + &View - + &Export - + &Remove - + &Select - + &Deselect - + Select &All - + &Deselect All @@ -1137,7 +1268,13 @@ Press 1 for Default View - + + + + + + + Snapmatic Properties @@ -1183,20 +1320,20 @@ Press 1 for Default View - + Crew: %1 (%2) - + Title: %1 (%2) - - + + Appropriate: %1 @@ -1226,45 +1363,59 @@ Press 1 for Default View - - + + Edit - + Yes Yes, should work fine - + No No, could lead to issues - + + <h4>Unsaved changes detected</h4>You want to save the JSON content before you quit? + + + + + + Patching of Snapmatic Properties failed because of JSON Error + + + + + + + Patching of Snapmatic Properties failed because of I/O Error - + Snapmatic Title - + New Snapmatic title: - + Snapmatic Crew - + New Snapmatic crew: @@ -1321,8 +1472,8 @@ Press 1 for Default View - - + + Delete picture @@ -1332,62 +1483,62 @@ Press 1 for Default View - + Edi&t - + Show &In-game - + Hide &In-game - + &Export - + &View - + &Remove - + &Select - + &Deselect - + Select &All - + &Deselect All - + Are you sure to delete %1 from your Snapmatic pictures? - + Failed at deleting %1 from your Snapmatic pictures @@ -1396,7 +1547,7 @@ Press 1 for Default View UserInterface - + %2 - %1 @@ -1458,8 +1609,8 @@ Press 1 for Default View - - + + &About %1 @@ -1565,15 +1716,15 @@ Press 1 for Default View - + Select &GTA V Folder... - - - + + + Select GTA V Folder... @@ -1603,27 +1754,27 @@ Press 1 for Default View - - - + + + Select Profile - + Open File... - - - - + + + + Open File - + Can't open %1 because of not valid file format diff --git a/main.cpp b/main.cpp index ebd7d6b..d8d6a3b 100755 --- a/main.cpp +++ b/main.cpp @@ -21,6 +21,7 @@ #include "ProfileDatabase.h" #include "DatabaseThread.h" #include "SavegameDialog.h" +#include "OptionsDialog.h" #include "PictureDialog.h" #include "UserInterface.h" #include "CrewDatabase.h" @@ -28,8 +29,11 @@ #include "IconLoader.h" #include "AppEnv.h" #include "config.h" +#include #include +#include #include +#include #include #include #include @@ -52,9 +56,25 @@ int main(int argc, char *argv[]) a.setApplicationVersion(GTA5SYNC_APPVER); a.setQuitOnLastWindowClosed(false); + QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); + settings.beginGroup("Startup"); + + bool isFirstStart = settings.value("IsFirstStart", true).toBool(); + bool customStyle = settings.value("CustomStyle", false).toBool(); + QString appStyle = settings.value("AppStyle", "Default").toString(); + + if (customStyle) + { + if (QStyleFactory::keys().contains(appStyle, Qt::CaseInsensitive)) + { + a.setStyle(QStyleFactory::create(appStyle)); + } + } + #ifdef GTA5SYNC_WIN #if QT_VERSION >= 0x050400 - if (QSysInfo::windowsVersion() >= 0x0080) + bool alwaysUseMessageFont = settings.value("AlwaysUseMessageFont", false).toBool(); + if (QSysInfo::windowsVersion() >= 0x0080 || alwaysUseMessageFont) { // Get Windows Font NONCLIENTMETRICS ncm; @@ -83,6 +103,22 @@ int main(int argc, char *argv[]) TCInstance->initUserLanguage(); TCInstance->loadTranslation(&a); + if (isFirstStart) + { + QMessageBox::StandardButton button = QMessageBox::information(a.desktop(), QString("%1 %2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER), QApplication::tr("

Welcome to %1!

You want to configure %1 before you start using it?").arg(GTA5SYNC_APPSTR), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + if (button == QMessageBox::Yes) + { + ProfileDatabase profileDB; + OptionsDialog optionsDialog(&profileDB); + optionsDialog.setWindowIcon(IconLoader::loadingAppIcon()); + optionsDialog.show(); + optionsDialog.exec(); + } + settings.setValue("IsFirstStart", false); + } + + settings.endGroup(); + QStringList applicationArgs = a.arguments(); QString selectedAction; QString arg1; diff --git a/res/app.rc b/res/app.rc index ee9308c..3cfc1b1 100755 --- a/res/app.rc +++ b/res/app.rc @@ -25,12 +25,12 @@ BEGIN BEGIN VALUE "CompanyName", "Syping" VALUE "FileDescription", "gta5view\0" - VALUE "FileVersion", "1.5.0-dev3\0" + VALUE "FileVersion", "1.5.0-dev4\0" VALUE "InternalName", "gta5view\0" VALUE "LegalCopyright", "Copyright 2016-2017 Syping\0" VALUE "OriginalFilename", "gta5view.exe\0" VALUE "ProductName", "gta5view\0" - VALUE "ProductVersion", "1.5.0-dev3\0" + VALUE "ProductVersion", "1.5.0-dev4\0" END END END diff --git a/res/gta5sync_de.qm b/res/gta5sync_de.qm index c934152..dcb336b 100755 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 a6b2420..f920076 100755 --- a/res/gta5sync_de.ts +++ b/res/gta5sync_de.ts @@ -259,6 +259,7 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen CrewDatabase + No Crew Keine Crew @@ -426,12 +427,14 @@ Wenn du planst es als Avatar zu verwenden das Bild wird abgetrennt! + 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 @@ -454,6 +457,28 @@ Wenn du es als Avatar verwenden möchtest wird es abgetrennt! Farbe auswählen...
+ + JsonEditorDialog + + + Snapmatic JSON Editor + Snapmatic JSON Editor + + + + &Save + &Speichern + + + + &Close + S&chließen + + + Patching of Snapmatic Properties failed because of JSON Error + Patchen von Snapmatic Eigenschaften fehlgeschlagen wegen JSON Fehler + + MapLocationDialog @@ -502,7 +527,7 @@ Y: %2 &Fertig - + X: %1 Y: %2 X and Y position @@ -672,56 +697,93 @@ Y: %2 Name - + + Language for Areas + Sprache für Standorte + + + + Style + Stil + + + + Use Default Style (Restart) + Benutze Standard Stil (Neustart) + + + Use Default Style + Benutze Standard Stil + + + + Style: + Stil: + + + + Font + Schrift + + + + Always use Message Font (Windows 2003 and earlier) + Immer Nachrichtenschrift nutzen (Windows 2003 und früher) + + Language - Sprache + Sprache - + Interface Oberfläche + + + Language for Interface + Sprache für Oberfläche + - - + + Current: %1 Aktuell: %1 - Areas - Standorte + Standorte - + Sync Sync - + Sync is not implemented at current time Sync wurde bisher nicht implementiert - + Apply changes Änderungen übernehmen - + &OK OK, Cancel, Apply &OK - + Discard changes Änderungen verwerfen - + &Cancel OK, Cancel, Apply Abbre&chen @@ -742,7 +804,7 @@ Y: %2 %1 (%2 wenn verfügbar) - + %1 %1 %1 @@ -756,31 +818,31 @@ Y: %2 Der eigene Ordner initialisiert sobald du %1 neugestartet hast. - + %1 (Next Closest Language) First language a person can talk with a different person/application. "Native" or "Not Native". %1 (Erste näheste Sprache) - + System System in context of System default System - + %1 (Closest to Interface) Next closest language compared to the Interface %1 (Näheste zur Oberfläche) - + Auto Automatic language choice. Automatisch - + The new Custom Folder will initialise after you restart %1. Der eigene Ordner wird initialisiert sobald du %1 neugestartet hast. @@ -789,15 +851,15 @@ Y: %2 Die Änderung der Sprache nimmt Effekt sobald du %1 neugestartet hast. - + No Profile No Profile, as default Kein Profil - - - + + + Profile: %1 Profil: %1 @@ -911,8 +973,8 @@ Y: %2 Exportiere als &JPG Bild... - - + + Export as &Picture... Als &Bild exportieren... @@ -921,8 +983,8 @@ Y: %2 Exportiere als &GTA Snapmatic... - - + + Export as &Snapmatic... Als &Snapmatic exportieren... @@ -931,13 +993,12 @@ Y: %2 Bearbei&ten - Open &Map View... - &Kartenansicht öffnen... + &Kartenansicht öffnen... - - + + &Edit Properties... Eigenschaften bearb&eiten... @@ -951,7 +1012,13 @@ Y: %2 Erweitert (&A) - + + + Open &Map Viewer... + &Kartenansicht öffnen... + + + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -960,31 +1027,31 @@ Taste 2 - Overlay umschalten Pfeiltasten - Navigieren - - + + Snapmatic Picture Viewer Snapmatic Bildansicht - - + + Failed at %1 Fehlgeschlagen bei %1 - - + + No Crew Keine Crew - - + + No Players Keine Spieler - + Avatar Preview Mode Press 1 for Default View Avatar Vorschaumodus @@ -1029,7 +1096,7 @@ Drücke A für Standardansicht Keine Crew - + Unknown Location Unbekannter Standort @@ -1198,6 +1265,12 @@ Drücke A für Standardansicht No valid file is selected Keine gültige Datei wurde ausgewählt + + + + Open &JSON Editor... + &JSON Editor öffnen... + ProfileInterface @@ -1258,30 +1331,30 @@ Drücke A für Standardansicht Profil schließen - + Loading... Lade... - - + + Import... Importieren... - - - - - - - - - - - - - + + + + + + + + + + + + + Import Importieren @@ -1294,13 +1367,13 @@ Drücke A für Standardansicht Importfähige Dateien (*.g5e *.jpg *.png SGTA* PGTA*) - + Savegames files (SGTA*) Spielstanddateien (SGTA*) - + Snapmatic pictures (PGTA*) Snapmatic Bilder (PGTA*) @@ -1310,29 +1383,29 @@ Drücke A für Standardansicht Alle Bilddateien (*.jpg *.png) - + 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 @@ -1341,29 +1414,29 @@ Drücke A für Standardansicht %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 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... @@ -1372,29 +1445,29 @@ Drücke A für Standardansicht Kann %1 nicht importieren weil das Dateiformat nicht gültig ist - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e Fehlgeschlagen beim Importieren vom Snapmatic Bild, Datei beginnt nicht mit PGTA oder endet mit .g5e - + Failed to import the Snapmatic picture, the picture is already in the game Fehlgeschlagen beim Importieren vom Snapmatic Bild, dieses Bild ist bereits im Spiel - + %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 @@ -1403,35 +1476,35 @@ Drücke A für Standardansicht Fehlgeschlagen beim Importieren vom Snapmatic Bild, Datei beginnt nicht mit PGTA - + 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 @@ -1450,25 +1523,25 @@ Das GTA Snapmatic Format macht es möglich sie wieder ins Game zu importieren Exportieren als: - - + + No Snapmatic pictures or Savegames files are selected Keine Snapmatic Bilder oder Spielstände 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? - + Failed at remove the complete selected Snapmatic pictures and/or Savegame files Fehlgeschlagen beim kompletten entfernen der ausgewählten Snapmatic Bilder und/oder der Spielstanddateien @@ -1489,10 +1562,10 @@ Exportieren als: Fehlgeschlagenen beim Import vom Spielstand weil kein Spielstandslot mehr übrig ist - - - - + + + + Export selected Auswahl exportieren @@ -1513,7 +1586,7 @@ Exportieren als: Wie sollen wir mit den Snapmatic Bilder umgehen? - + Export selected... Auswahl exportieren... @@ -1526,7 +1599,7 @@ Exportieren als: Initialisierung... - + Export failed with... %1 @@ -1561,7 +1634,7 @@ Exportieren als: Alle Profildateien (*.g5e SGTA* PGTA*) - + GTA V Export (*.g5e) GTA V Export (*.g5e) @@ -1570,15 +1643,20 @@ Exportieren als: QApplication - + Font Schrift - + Selected Font: %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? + SavegameDialog @@ -1725,32 +1803,32 @@ Exportieren als: 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 @@ -1789,7 +1867,7 @@ Exportieren als: Spielstand kopieren - + &Export &Exportieren @@ -1865,8 +1943,13 @@ Exportieren als: - - + + + + + + + Snapmatic Properties Snapmatic Eigenschaften @@ -1910,7 +1993,7 @@ Exportieren als: Meme - + Snapmatic Title Snapmatic Titel @@ -1921,20 +2004,20 @@ Exportieren als: - + Crew: %1 (%2) Crew: %1 (%2) - + Title: %1 (%2) Titel: %1 (%2) - - + + Appropriate: %1 Angemessen: %1 @@ -1972,41 +2055,54 @@ Exportieren als: Cancel - - + + Edit Bearbeiten - + Yes Yes, should work fine Ja - + No No, could lead to issues Nein - - + + <h4>Unsaved changes detected</h4>You want to save the JSON content before you quit? + <h4>Ungespeicherte Änderungen erkannt</h4>Möchtest du den JSON Inhalt speichern bevor du verlässt? + + + + + Patching of Snapmatic Properties failed because of JSON Error + Patchen von Snapmatic Eigenschaften fehlgeschlagen wegen JSON Fehler + + + + + + 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: @@ -2053,18 +2149,18 @@ Exportieren als: - - + + Delete picture Bild löschen - + Are you sure to delete %1 from your Snapmatic pictures? Bist du sicher %1 von deine Snapmatic Bilder zu löschen? - + Edi&t Bearbei&ten @@ -2077,7 +2173,7 @@ Exportieren als: &Im Spiel deaktivieren - + &Export &Exportieren @@ -2090,12 +2186,12 @@ Exportieren als: Exportiere als &GTA Snapmatic - + Show &In-game &Im Spiel anzeigen - + Hide &In-game &Im Spiel ausblenden @@ -2128,32 +2224,32 @@ Exportieren als: Exportiere als &Snapmatic... - + &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 @@ -2201,7 +2297,7 @@ Exportieren als: Bist du sicher %1 von deinen Snapmatic Bilder zu löschen? - + Failed at deleting %1 from your Snapmatic pictures Fehlgeschlagen beim Löschen von %1 von deinen Snapmatic Bildern @@ -2499,7 +2595,7 @@ Exportieren als: - + Select GTA V Folder... diff --git a/res/gta5sync_en_US.qm b/res/gta5sync_en_US.qm index a017ab7..f097a03 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 cc2c4b6..46170db 100644 --- a/res/gta5sync_en_US.ts +++ b/res/gta5sync_en_US.ts @@ -114,6 +114,7 @@ Pictures and Savegames CrewDatabase + No Crew @@ -237,12 +238,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! @@ -264,6 +267,24 @@ When you want to use it as Avatar the image will be detached! Select Color... + + JsonEditorDialog + + + Snapmatic JSON Editor + + + + + &Save + + + + + &Close + + + MapLocationDialog @@ -297,7 +318,7 @@ When you want to use it as Avatar the image will be detached! - + X: %1 Y: %2 X and Y position @@ -437,106 +458,131 @@ Y: %2 Name + + + Language for Areas + + + + + Style + + + + + Style: + + + + + Font + + + + + Always use Message Font (Windows 2003 and earlier) + + - Language - + Interface + - Interface + Language for Interface - - + + Current: %1 - - Areas + + Use Default Style (Restart) - + Sync - + Sync is not implemented at current time - + Apply changes - + &OK OK, Cancel, Apply - + Discard changes - + &Cancel OK, Cancel, Apply - + %1 (Next Closest Language) First language a person can talk with a different person/application. "Native" or "Not Native". - + System System in context of System default - + %1 (Closest to Interface) Next closest language compared to the Interface - + Auto Automatic language choice. - + %1 %1 - + The new Custom Folder will initialise after you restart %1. The new Custom Folder will initialize after you restart %1. - + No Profile No Profile, as default - - - + + + Profile: %1 @@ -577,66 +623,67 @@ Y: %2 - - + + Export as &Picture... - - + + Export as &Snapmatic... - - Open &Map View... + + + &Edit Properties... - - - &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 @@ -744,6 +791,12 @@ Press 1 for Default View Exported Snapmatic to "%1" because of using the .auto extension. + + + + Open &JSON Editor... + + ProfileInterface @@ -790,207 +843,207 @@ Press 1 for Default View - + Enabled pictures: %1 of %2 - + Loading... - - + + Import... - - - - - - - - - - - - - + + + + + + + + + + + + + Import - + Importable files (%1) - + GTA V Export (*.g5e) - + Savegames files (SGTA*) - + Snapmatic pictures (PGTA*) - + 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 parsed properly - + Can't import %1 because file format can't be detected - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e - + Failed to import the Snapmatic picture, the picture is already in the game - + 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: - + 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? - + Failed at remove the complete selected Snapmatic pictures and/or Savegame files @@ -1003,15 +1056,20 @@ 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? + + SavegameDialog @@ -1086,37 +1144,37 @@ Press 1 for Default View - + &View - + &Export - + &Remove - + &Select - + &Deselect - + Select &All - + &Deselect All @@ -1210,8 +1268,13 @@ Press 1 for Default View - - + + + + + + + Snapmatic Properties @@ -1257,20 +1320,20 @@ Press 1 for Default View - + Crew: %1 (%2) - + Title: %1 (%2) - - + + Appropriate: %1 @@ -1300,46 +1363,59 @@ Press 1 for Default View - - + + Edit - + Yes Yes, should work fine - + No No, could lead to issues - - + + <h4>Unsaved changes detected</h4>You want to save the JSON content before you quit? + + + + + + Patching of Snapmatic Properties failed because of JSON Error + + + + + + + Patching of Snapmatic Properties failed because of I/O Error - + Snapmatic Title - + New Snapmatic title: - + Snapmatic Crew - + New Snapmatic crew: @@ -1396,8 +1472,8 @@ Press 1 for Default View - - + + Delete picture @@ -1407,62 +1483,62 @@ Press 1 for Default View - + Edi&t - + Show &In-game - + Hide &In-game - + &Export - + &View - + &Remove - + &Select - + &Deselect - + Select &All - + &Deselect All - + Are you sure to delete %1 from your Snapmatic pictures? - + Failed at deleting %1 from your Snapmatic pictures @@ -1646,7 +1722,7 @@ Press 1 for Default View - + Select GTA V Folder... diff --git a/res/gta5sync_fr.qm b/res/gta5sync_fr.qm index 1750a3e..53ccfdd 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 caa233d..096568d 100644 --- a/res/gta5sync_fr.ts +++ b/res/gta5sync_fr.ts @@ -223,6 +223,7 @@ et les fichiers de sauvegarde de Grand Theft Auto V CrewDatabase + No Crew Aucun crew @@ -362,12 +363,14 @@ et les fichiers de sauvegarde de Grand Theft Auto V + Custom Avatar Custom Avatar Description in SC, don't use Special Character! + Custom Picture Custom Picture Description in SC, don't use Special Character! @@ -389,6 +392,24 @@ When you want to use it as Avatar the image will be detached! + + JsonEditorDialog + + + Snapmatic JSON Editor + + + + + &Save + + + + + &Close + + + MapLocationDialog @@ -422,7 +443,7 @@ When you want to use it as Avatar the image will be detached! - + X: %1 Y: %2 X and Y position @@ -570,56 +591,85 @@ Y: %2 Nom - + + Language for Areas + + + + + Style + + + + + Style: + + + + + Font + Police + + + + Always use Message Font (Windows 2003 and earlier) + + + Language - Langue + Langue - + Interface + + + Language for Interface + + - - + + Current: %1 - - Areas + + Use Default Style (Restart) - + Sync Synchronisation - + Sync is not implemented at current time La synchronisation n'est pas encore implémentée - + Apply changes - + &OK OK, Cancel, Apply &OK - + Discard changes - + &Cancel OK, Cancel, Apply &Annuler @@ -635,37 +685,37 @@ Y: %2 Système - + %1 (Next Closest Language) First language a person can talk with a different person/application. "Native" or "Not Native". - + System System in context of System default Système - + %1 (Closest to Interface) Next closest language compared to the Interface - + Auto Automatic language choice. - + %1 %1 %1 - + The new Custom Folder will initialise after you restart %1. @@ -678,15 +728,15 @@ Y: %2 Le changement de langue sera actif au prochain lancement de %1. - + No Profile No Profile, as default Aucun profil - - - + + + Profile: %1 Profil : %1 @@ -852,8 +902,8 @@ Y: %2 Exporter comme image &JPG... - - + + Export as &Picture... @@ -862,8 +912,8 @@ Y: %2 Exporter comme &GTA Snapmatic... - - + + Export as &Snapmatic... @@ -872,18 +922,19 @@ Y: %2 Édi&ter - - Open &Map View... - - - - - + + &Edit Properties... Modifier les &propriétés... - + + + Open &Map Viewer... + + + + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -892,31 +943,31 @@ 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 @@ -935,7 +986,7 @@ Appuyer sur 1 pour le mode par défaut Aucun crew - + Unknown Location Emplacement inconnu @@ -968,6 +1019,12 @@ Appuyer sur 1 pour le mode par défaut Failed to export current Snapmatic picture Échec de l'export de la photo Snapmatic + + + + Open &JSON Editor... + + ProfileInterface @@ -1018,35 +1075,35 @@ 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... - - + + Import... Importer... - - - - - - - - - - - - - + + + + + + + + + + + + + Import Importer @@ -1055,36 +1112,36 @@ Appuyer sur 1 pour le mode par défaut Fichiers de profil GTA (SGTA* PGTA*) - + Savegames files (SGTA*) Fichiers de sauvegarde GTA (SGTA*) - + Snapmatic pictures (PGTA*) Photos Snapmatic (PGTA*) - + All image files (%1) - + All files (**) Tous les fichiers (**) - - + + Import file %1 of %2 files Importation du fichier %1 sur %2 - + Import failed with... %1 @@ -1093,25 +1150,25 @@ Appuyer sur 1 pour le mode par défaut %1 - - + + No valid file is selected Fichier invalide - + Importable files (%1) - + Failed to read Snapmatic picture Impossible d'ouvrir la photo Snapmatic - + Failed to read Savegame file Impossible de lire le fichier de sauvegarde @@ -1133,78 +1190,78 @@ Appuyer sur 1 pour le mode par défaut Tous les fichiers image (*.jpg *.png) - + 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 PGTA or end with .g5e Impossible d'importer la photo Snapmatic,nom de fichier incorrect (PGTA*, *.g5e) - + Failed to import the Snapmatic picture, the picture is already in the game Impossible d'importer la photo Snapmatic, un fichier du même nom existe déjà - + 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 - - - - + + + + Export selected Exporter la sélection - - + + 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... @@ -1213,7 +1270,7 @@ Appuyer sur 1 pour le mode par défaut Initialisation de l'export... - + Export failed with... %1 @@ -1222,25 +1279,25 @@ 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 ? - + Failed at remove the complete selected Snapmatic pictures and/or Savegame files Impossible de supprimer la sélection @@ -1250,7 +1307,7 @@ Appuyer sur 1 pour le mode par défaut Tous les fichiers de profil (*.g5e SGTA* PGTA*) - + GTA V Export (*.g5e) GTA V Export (*.g5e) @@ -1259,15 +1316,20 @@ Appuyer sur 1 pour le mode par défaut QApplication - + Font Police - + Selected Font: %1 Police sélectionnée : %1 + + + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? + + SavegameDialog @@ -1342,7 +1404,7 @@ Appuyer sur 1 pour le mode par défaut Supprimer - + &Export &Exporter @@ -1433,32 +1495,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 @@ -1468,8 +1530,13 @@ Appuyer sur 1 pour le mode par défaut - - + + + + + + + Snapmatic Properties Propriétés Snapmatic @@ -1513,7 +1580,7 @@ Appuyer sur 1 pour le mode par défaut Meme - + Snapmatic Title Titre Snapmatic @@ -1524,20 +1591,20 @@ Appuyer sur 1 pour le mode par défaut - + Crew: %1 (%2) Crew : %1 (%2) - + Title: %1 (%2) Titre : %1 (%2) - - + + Appropriate: %1 Valide : %1 @@ -1567,43 +1634,56 @@ 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 Non - - + + <h4>Unsaved changes detected</h4>You want to save the JSON content before you quit? + + + + + + Patching of Snapmatic Properties failed because of JSON Error + + + + + + + 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 : @@ -1660,8 +1740,8 @@ Appuyer sur 1 pour le mode par défaut - - + + Delete picture Supprimer la photo @@ -1671,27 +1751,27 @@ Appuyer sur 1 pour le mode par défaut Supprimer - + Are you sure to delete %1 from your Snapmatic pictures? Supprimer %1 ? - + Failed at deleting %1 from your Snapmatic pictures Impossible de supprimer %1 - + Edi&t Édi&ter - + Show &In-game &Visible en jeu - + Hide &In-game &Invisible en jeu @@ -1700,7 +1780,7 @@ Appuyer sur 1 pour le mode par défaut Modifier les &propriétés... - + &Export &Exporter @@ -1713,32 +1793,32 @@ Appuyer sur 1 pour le mode par défaut Exporter comme &GTA Snapmatic... - + &View &Voir - + &Remove S&upprimer - + &Select &Sélectionner - + &Deselect &Déselectionner - + Select &All Sélectionner &tout - + &Deselect All &Déselectionner tout @@ -1912,7 +1992,7 @@ Appuyer sur 1 pour le mode par défaut - + Select GTA V Folder... diff --git a/res/gta5sync_ru.qm b/res/gta5sync_ru.qm index 8579c33..71a4daf 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 f73b9a3..272f721 100644 --- a/res/gta5sync_ru.ts +++ b/res/gta5sync_ru.ts @@ -184,6 +184,7 @@ Grand Theft Auto V Snapmatic картинок и сохраненийCrewDatabase + No Crew Вне банды @@ -325,12 +326,14 @@ Grand Theft Auto V Snapmatic картинок и сохранений + Custom Avatar Custom Avatar Description in SC, don't use Special Character! + Custom Picture Custom Picture Description in SC, don't use Special Character! @@ -352,6 +355,24 @@ When you want to use it as Avatar the image will be detached! Выбрать цвет... + + JsonEditorDialog + + + Snapmatic JSON Editor + + + + + &Save + + + + + &Close + &Закрыть + + MapLocationDialog @@ -392,7 +413,7 @@ Y: %2 - + X: %1 Y: %2 X and Y position @@ -534,56 +555,85 @@ Y: %2 Имя - + + Language for Areas + + + + + Style + + + + + Style: + + + + + Font + Шрифт + + + + Always use Message Font (Windows 2003 and earlier) + + + Language - Язык + Язык - + Interface + + + Language for Interface + + - - + + Current: %1 - - Areas + + Use Default Style (Restart) - + Sync Sync - + Sync is not implemented at current time Синхронизация пока ещё не реализована - + Apply changes Применить изменения - + &OK OK, Cancel, Apply &ОК - + Discard changes Отвергнуть изменения - + &Cancel OK, Cancel, Apply От&мена @@ -600,37 +650,37 @@ Y: %2 %1 (%2 если имеется) - + %1 (Next Closest Language) First language a person can talk with a different person/application. "Native" or "Not Native". - + System System in context of System default Система - + %1 (Closest to Interface) Next closest language compared to the Interface - + Auto Automatic language choice. - + %1 %1 %1 - + The new Custom Folder will initialise after you restart %1. Другая папка будет загружена после перезапуска %1. @@ -643,15 +693,15 @@ Y: %2 Язык изменится после перезапуска %1. - + No Profile No Profile, as default Нет профиля - - - + + + Profile: %1 Профиль: %1 @@ -731,8 +781,8 @@ Y: %2 Эксп&ортировать как картинку JPG... - - + + Export as &Picture... Экспортировать как &картинку... @@ -741,8 +791,8 @@ Y: %2 Экс&портировать как GTA Snapmatic... - - + + Export as &Snapmatic... Экспортировать как &Snapmatic... @@ -751,18 +801,23 @@ Y: %2 &Правка - Open &Map View... - Открыть &карту... + Открыть &карту... - - + + &Edit Properties... &Изменить свойства... - + + + Open &Map Viewer... + + + + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -771,31 +826,31 @@ Arrow Keys - Navigate Стрелки - Навигация - - + + Snapmatic Picture Viewer Просмотрщик фотографий Snapmatic - - + + Failed at %1 Ошибка при %1 - - + + No Crew Вне банды - - + + No Players Игроков нет - + Avatar Preview Mode Press 1 for Default View Режим просмотра аватарок @@ -810,7 +865,7 @@ Press 1 for Default View Без группы - + Unknown Location Неизвестное место @@ -947,6 +1002,12 @@ Press 1 for Default View Failed to copy current Snapmatic picture Не удалось скопировать текущую картинку Snapmatic + + + + Open &JSON Editor... + + ProfileInterface @@ -998,30 +1059,30 @@ Press 1 for Default View Закрыть профиль - + Loading... Загрузка... - - + + Import... Импортировать... - - - - - - - - - - - - - + + + + + + + + + + + + + Import Импортировать @@ -1030,31 +1091,31 @@ Press 1 for Default View Все файлы профиля (SGTA* PGTA*) - + Savegames files (SGTA*) Файлы сохранения (SGTA*) - + Snapmatic pictures (PGTA*) Картинка Snapmatic (PGTA*) - + All files (**) Все файлы (**) - - + + Import file %1 of %2 files Импортируются файлы %1 из %2 - + Import failed with... %1 @@ -1063,13 +1124,13 @@ Press 1 for Default View %1 - + Failed to read Snapmatic picture Не удалось загрузить картинку Snapmatic - + Failed to read Savegame file Не удалось загрузить файл сохранения @@ -1079,14 +1140,14 @@ Press 1 for Default View Не получилось импортировать %1 из-за неправильного формата файла - - + + No valid file is selected Выбранный файл неверен - + Enabled pictures: %1 of %2 Включенные картинки: %1 из %2 @@ -1099,93 +1160,93 @@ Press 1 for Default View Все изображения (*.jpg *.png) - + Importable files (%1) Файлы для импорта (%1) - + All image files (%1) Все файлы изображений (%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 PGTA or end with .g5e Не удалось импортировать картинку Snapmatic, название не начинается с PGTA или не заканчивается с .g5e - + Failed to import the Snapmatic picture, the picture is already in the game Не удалось импортировать картинку Snapmatic, картинка уже в игре - + 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 и файлы сохранений? - + Failed at remove the complete selected Snapmatic pictures and/or Savegame files Не удалось удалить полностью выбранные картинки Snapmatic и/или файлы сохранений @@ -1206,20 +1267,20 @@ Press 1 for Default View Не получилось имортировать копию сохранения, потому что не осталось свободных под них слотов - - - - + + + + Export selected Экспортировать выделенное - + %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... Экпортировать выделенное... @@ -1228,7 +1289,7 @@ Press 1 for Default View Подготавливаю эскпорт... - + Export failed with... %1 @@ -1249,7 +1310,7 @@ Press 1 for Default View Все файлы профиля (*.g5e SGTA* PGTA*) - + GTA V Export (*.g5e) GTA V Export (*.g5e) @@ -1258,15 +1319,20 @@ Press 1 for Default View QApplication - + Font Шрифт - + Selected Font: %1 Выбранный шрифт: %1 + + + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? + + SavegameDialog @@ -1400,32 +1466,32 @@ Press 1 for Default View Не удалось удалить сохранение %1 - + &View &Просмотр - + &Remove &Удалить - + &Select &Выбрать - + &Deselect Сн&ять выбор - + Select &All В&ыбрать все - + &Deselect All Снять выбо&р со всех @@ -1435,7 +1501,7 @@ Press 1 for Default View Копировать сохранение - + &Export &Экспортировать @@ -1495,8 +1561,13 @@ Press 1 for Default View - - + + + + + + + Snapmatic Properties Свойства Snapmatic @@ -1537,7 +1608,7 @@ Press 1 for Default View - + Crew: %1 (%2) Банда: %1 (%2) @@ -1547,20 +1618,20 @@ Press 1 for Default View Meme - + Snapmatic Title Заголовок Snapmatic - + Title: %1 (%2) Заголовок: %1 (%2) - - + + Appropriate: %1 Подходит: %1 @@ -1590,41 +1661,54 @@ Press 1 for Default View &Отмена - - + + Edit Правка - + Yes Yes, should work fine Да - + No No, could lead to issues Нет - - + + <h4>Unsaved changes detected</h4>You want to save the JSON content before you quit? + + + + + + Patching of Snapmatic Properties failed because of JSON Error + + + + + + + Patching of Snapmatic Properties failed because of I/O Error Не удалось измененить свойства Snapmatic из-за проблемы ввода/вывода - + New Snapmatic title: Новый заголовок Snapmatic: - + Snapmatic Crew Банда на Snapmatic - + New Snapmatic crew: Новая банда на Snapmatic: @@ -1676,33 +1760,33 @@ Press 1 for Default View - - + + Delete picture Удалить картинку - + Are you sure to delete %1 from your Snapmatic pictures? Уверены, что хотите удалить %1 из коллекции картинок Snapmatic? - + Failed at deleting %1 from your Snapmatic pictures Не удалось удалить %1 из колелкции картинок Snapmatic - + Edi&t &Правка - + Show &In-game Показывать в &игре - + Hide &In-game Ск&рыть в игре @@ -1711,7 +1795,7 @@ Press 1 for Default View &Изменить свойства... - + &Export &Экспорт @@ -1724,32 +1808,32 @@ Press 1 for Default View Экс&портировать как GTA Snapmatic... - + &View По&казать - + &Remove У&далить - + &Select &Выделить - + &Deselect Сн&ять выделение - + Select &All В&ыбрать все - + &Deselect All Снять выбо&р со всех @@ -1977,7 +2061,7 @@ Press 1 for Default View - + Select GTA V Folder...