Browse Source

Qt6 telemetry build fix, PictureDialog crash fix

1.10.x
Syping 1 year ago
parent
commit
2f7e4a154d
  1. 6
      JsonEditorDialog.cpp
  2. 6
      OptionsDialog.cpp
  3. 188
      PictureDialog.cpp
  4. 22
      ProfileInterface.cpp
  5. 10
      SavegameWidget.cpp
  6. 6
      SnapmaticEditor.cpp
  7. 14
      SnapmaticWidget.cpp
  8. 426
      res/gta5sync.ts
  9. 426
      res/gta5sync_de.ts
  10. 426
      res/gta5sync_en_US.ts
  11. 426
      res/gta5sync_fr.ts
  12. 426
      res/gta5sync_ko.ts
  13. 426
      res/gta5sync_ru.ts
  14. 426
      res/gta5sync_uk.ts
  15. 426
      res/gta5sync_zh_TW.ts

6
JsonEditorDialog.cpp

@ -1,6 +1,6 @@
/*****************************************************************************
* gta5view Grand Theft Auto V Profile Viewer
* Copyright (C) 2017-2018 Syping
* Copyright (C) 2017-2021 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
@ -212,7 +212,11 @@ bool JsonEditorDialog::saveJsonContent()
QJsonObject jsonObject;
jsonObject["Type"] = "JSONEdited";
jsonObject["EditedSize"] = QString::number(smpic->getContentMaxLength());
#if QT_VERSION >= 0x060000
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
}

6
OptionsDialog.cpp

@ -1,6 +1,6 @@
/*****************************************************************************
* gta5view Grand Theft Auto V Profile Viewer
* Copyright (C) 2016-2020 Syping
* Copyright (C) 2016-2021 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
@ -457,7 +457,11 @@ void OptionsDialog::applySettings()
QJsonDocument jsonDocument;
QJsonObject jsonObject;
jsonObject["Type"] = "SettingsUpdated";
#if QT_VERSION >= 0x060000
jsonObject["UpdateTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["UpdateTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
}

188
PictureDialog.cpp

@ -1,6 +1,6 @@
/*****************************************************************************
* gta5view Grand Theft Auto V Profile Viewer
* Copyright (C) 2016-2020 Syping
* Copyright (C) 2016-2021 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
@ -148,12 +148,10 @@ void PictureDialog::setupPictureDialog()
// Avatar area
qreal screenRatio = AppEnv::screenRatio();
qreal screenRatioPR = AppEnv::screenRatioPR();
if (screenRatio != 1 || screenRatioPR != 1)
{
if (screenRatio != 1 || screenRatioPR != 1) {
avatarAreaPicture = QImage(":/img/avatararea.png").scaledToHeight(snapmaticResolution.height() * screenRatio * screenRatioPR, Qt::FastTransformation);
}
else
{
else {
avatarAreaPicture = QImage(":/img/avatararea.png");
}
avatarLocX = 145;
@ -189,17 +187,14 @@ void PictureDialog::setupPictureDialog()
connect(ui->labJSON, SIGNAL(resized(QSize)), this, SLOT(adaptNewDialogSize(QSize)));
// Set Icon for Close Button
if (QIcon::hasThemeIcon("dialog-close"))
{
if (QIcon::hasThemeIcon("dialog-close")) {
ui->cmdClose->setIcon(QIcon::fromTheme("dialog-close"));
}
else if (QIcon::hasThemeIcon("gtk-close"))
{
else if (QIcon::hasThemeIcon("gtk-close")) {
ui->cmdClose->setIcon(QIcon::fromTheme("gtk-close"));
}
installEventFilter(this);
installEventFilter(ui->labPicture);
// DPI calculation
ui->hlButtons->setSpacing(6 * screenRatio);
@ -214,32 +209,6 @@ void PictureDialog::setupPictureDialog()
PictureDialog::~PictureDialog()
{
#ifdef Q_OS_WIN
#if QT_VERSION >= 0x050200
if (naviEnabled)
{
for (QObject *obj : layout()->menuBar()->children())
{
delete obj;
}
delete layout()->menuBar();
}
#endif
#else
if (naviEnabled)
{
for (QObject *obj : layout()->menuBar()->children())
{
delete obj;
}
delete layout()->menuBar();
}
#endif
for (QObject *obj : manageMenu->children())
{
delete obj;
}
delete manageMenu;
delete ui;
}
@ -247,9 +216,7 @@ void PictureDialog::closeEvent(QCloseEvent *ev)
{
Q_UNUSED(ev)
if (primaryWindow)
{
emit endDatabaseThread();
}
}
void PictureDialog::addPreviousNextButtons()
@ -343,12 +310,10 @@ void PictureDialog::previousPictureRequestedSlot()
bool PictureDialog::eventFilter(QObject *obj, QEvent *ev)
{
bool returnValue = false;
if (obj == this || obj == ui->labPicture)
{
if (ev->type() == QEvent::KeyPress)
{
if (obj == this || obj == ui->labPicture) {
if (ev->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = dynamic_cast<QKeyEvent*>(ev);
switch (keyEvent->key()){
switch (keyEvent->key()) {
case Qt::Key_Left:
emit previousPictureRequested();
returnValue = true;
@ -358,25 +323,21 @@ bool PictureDialog::eventFilter(QObject *obj, QEvent *ev)
returnValue = true;
break;
case Qt::Key_1:
if (previewMode)
{
if (previewMode) {
previewMode = false;
renderPicture();
}
else
{
else {
previewMode = true;
renderPicture();
}
break;
case Qt::Key_2:
if (overlayEnabled)
{
if (overlayEnabled) {
overlayEnabled = false;
if (!previewMode) renderPicture();
}
else
{
else {
overlayEnabled = true;
if (!previewMode) renderPicture();
}
@ -403,38 +364,28 @@ bool PictureDialog::eventFilter(QObject *obj, QEvent *ev)
}
#ifdef Q_OS_WIN
#if QT_VERSION >= 0x050200
if (obj != ui->labPicture && naviEnabled)
{
if (ev->type() == QEvent::MouseButtonPress)
{
if (obj != ui->labPicture && naviEnabled) {
if (ev->type() == QEvent::MouseButtonPress) {
QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(ev);
if (mouseEvent->pos().y() <= layout()->menuBar()->height())
{
if (mouseEvent->button() == Qt::LeftButton)
{
if (mouseEvent->pos().y() <= layout()->menuBar()->height()) {
if (mouseEvent->button() == Qt::LeftButton) {
dragPosition = mouseEvent->pos();
dragStart = true;
}
}
}
if (ev->type() == QEvent::MouseButtonRelease)
{
if (ev->type() == QEvent::MouseButtonRelease) {
QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(ev);
if (mouseEvent->pos().y() <= layout()->menuBar()->height())
{
if (mouseEvent->button() == Qt::LeftButton)
{
if (mouseEvent->pos().y() <= layout()->menuBar()->height()) {
if (mouseEvent->button() == Qt::LeftButton) {
dragStart = false;
}
}
}
if (ev->type() == QEvent::MouseMove && dragStart)
{
if (ev->type() == QEvent::MouseMove && dragStart) {
QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(ev);
if (mouseEvent->pos().y() <= layout()->menuBar()->height())
{
if (mouseEvent->buttons() & Qt::LeftButton)
{
if (mouseEvent->pos().y() <= layout()->menuBar()->height()) {
if (mouseEvent->buttons() & Qt::LeftButton) {
QPoint diff = mouseEvent->pos() - dragPosition;
move(QPoint(pos() + diff));
updateGeometry();
@ -493,14 +444,12 @@ void PictureDialog::renderOverlayPicture()
QRect overlaySpace = fontMetrics.boundingRect(preferedRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextDontClip | Qt::TextWordWrap, overlayText);
int hOverlay = Qt::AlignTop;
if (overlaySpace.height() < 74 * screenRatio * screenRatioPR)
{
if (overlaySpace.height() < 74 * screenRatio * screenRatioPR) {
hOverlay = Qt::AlignVCenter;
preferedRect.setHeight(71 * screenRatio * screenRatioPR);
overlaySpace.setHeight(80 * screenRatio * screenRatioPR);
}
else
{
else {
overlaySpace.setHeight(overlaySpace.height() + 6 * screenRatio * screenRatioPR);
}
@ -513,12 +462,10 @@ void PictureDialog::renderOverlayPicture()
overlayPainter.drawText(preferedRect, Qt::AlignLeft | hOverlay | Qt::TextDontClip | Qt::TextWordWrap, overlayText);
overlayPainter.end();
if (overlaySpace.width() < 194 * screenRatio * screenRatioPR)
{
if (overlaySpace.width() < 194 * screenRatio * screenRatioPR) {
overlaySpace.setWidth(200 * screenRatio * screenRatioPR);
}
else
{
else {
overlaySpace.setWidth(overlaySpace.width() + 6 * screenRatio * screenRatioPR);
}
@ -633,8 +580,7 @@ void PictureDialog::crewNameUpdated()
{
SnapmaticPicture *picture = smpic; // used by macro
QString crewIDStr = crewID;
if (crewIDStr == crewStr)
{
if (crewIDStr == crewStr) {
crewStr = crewDB->getCrewName(crewIDStr);
ui->labJSON->setText(jsonDrawString.arg(locX, locY, locZ, generatePlayersString(), generateCrewString(), picTitl, picAreaStr, created));
}
@ -643,8 +589,7 @@ void PictureDialog::crewNameUpdated()
void PictureDialog::playerNameUpdated()
{
SnapmaticPicture *picture = smpic; // used by macro
if (plyrsList.count() >= 1)
{
if (plyrsList.count() >= 1) {
ui->labJSON->setText(jsonDrawString.arg(locX, locY, locZ, generatePlayersString(), generateCrewString(), picTitl, picAreaStr, created));
}
}
@ -653,8 +598,7 @@ QString PictureDialog::generateCrewString()
{
SnapmaticPicture *picture = smpic; // used by macro
const QString crewIDStr = crewID; // save operation time
if (crewIDStr != "0" && !crewIDStr.isEmpty())
{
if (crewIDStr != "0" && !crewIDStr.isEmpty()) {
if (crewIDStr != crewStr) {
return QString("<a href=\"https://socialclub.rockstargames.com/crew/" % QString(crewStr).replace(" ", "_") % "/" % crewIDStr % "\">" % crewStr % "</a>");
}
@ -769,12 +713,10 @@ void PictureDialog::openPreviewMap()
{
SnapmaticPicture *picture = smpic;
MapLocationDialog *mapLocDialog;
if (rqFullscreen && fullscreenWidget != nullptr)
{
if (rqFullscreen && fullscreenWidget != nullptr) {
mapLocDialog = new MapLocationDialog(picture->getSnapmaticProperties().location.x, picture->getSnapmaticProperties().location.y, fullscreenWidget);
}
else
{
else {
mapLocDialog = new MapLocationDialog(picture->getSnapmaticProperties().location.x, picture->getSnapmaticProperties().location.y, this);
}
mapLocDialog->setWindowIcon(windowIcon());
@ -785,8 +727,7 @@ void PictureDialog::openPreviewMap()
mapLocDialog->showMaximized();
#endif
mapLocDialog->exec();
if (mapLocDialog->propUpdated())
{
if (mapLocDialog->propUpdated()) {
// Update Snapmatic Properties
SnapmaticProperties localSpJson = picture->getSnapmaticProperties();
localSpJson.location.x = mapLocDialog->getXpos();
@ -797,33 +738,33 @@ void PictureDialog::openPreviewMap()
QString currentFilePath = picture->getPictureFilePath();
QString originalFilePath = picture->getOriginalPictureFilePath();
QString backupFileName = originalFilePath % ".bak";
if (!QFile::exists(backupFileName))
{
if (!QFile::exists(backupFileName)) {
QFile::copy(currentFilePath, backupFileName);
}
SnapmaticProperties fallbackProperties = picture->getSnapmaticProperties();
picture->setSnapmaticProperties(localSpJson);
if (!picture->exportPicture(currentFilePath))
{
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);
}
else
{
else {
updated();
#ifdef GTA5SYNC_TELEMETRY
QSettings telemetrySettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
telemetrySettings.beginGroup("Telemetry");
bool pushUsageData = telemetrySettings.value("PushUsageData", false).toBool();
telemetrySettings.endGroup();
if (pushUsageData && Telemetry->canPush())
{
if (pushUsageData && Telemetry->canPush()) {
QJsonDocument jsonDocument;
QJsonObject jsonObject;
jsonObject["Type"] = "LocationEdited";
jsonObject["ExtraFlags"] = "Viewer";
jsonObject["EditedSize"] = QString::number(picture->getContentMaxLength());
#if QT_VERSION >= 0x060000
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
}
@ -837,12 +778,10 @@ void PictureDialog::editSnapmaticProperties()
{
SnapmaticPicture *picture = smpic;
SnapmaticEditor *snapmaticEditor;
if (rqFullscreen && fullscreenWidget != nullptr)
{
if (rqFullscreen && fullscreenWidget != nullptr) {
snapmaticEditor = new SnapmaticEditor(crewDB, profileDB, fullscreenWidget);
}
else
{
else {
snapmaticEditor = new SnapmaticEditor(crewDB, profileDB, this);
}
snapmaticEditor->setWindowIcon(windowIcon());
@ -861,12 +800,10 @@ void PictureDialog::editSnapmaticImage()
{
QImage *currentImage = new QImage(smpic->getImage());
ImportDialog *importDialog;
if (rqFullscreen && fullscreenWidget != nullptr)
{
if (rqFullscreen && fullscreenWidget != nullptr) {
importDialog = new ImportDialog(profileName, fullscreenWidget);
}
else
{
else {
importDialog = new ImportDialog(profileName, this);
}
importDialog->setWindowIcon(windowIcon());
@ -874,21 +811,17 @@ void PictureDialog::editSnapmaticImage()
importDialog->enableOverwriteMode();
importDialog->setModal(true);
importDialog->exec();
if (importDialog->isImportAgreed())
{
if (importDialog->isImportAgreed()) {
const QByteArray previousPicture = smpic->getPictureStream();
bool success = smpic->setImage(importDialog->image());
if (success)
{
if (success) {
QString currentFilePath = smpic->getPictureFilePath();
QString originalFilePath = smpic->getOriginalPictureFilePath();
QString backupFileName = originalFilePath % ".bak";
if (!QFile::exists(backupFileName))
{
if (!QFile::exists(backupFileName)) {
QFile::copy(currentFilePath, backupFileName);
}
if (!smpic->exportPicture(currentFilePath))
{
if (!smpic->exportPicture(currentFilePath)) {
smpic->setPictureStream(previousPicture);
QMessageBox::warning(this, QApplication::translate("ImageEditorDialog", "Snapmatic Image Editor"), QApplication::translate("ImageEditorDialog", "Patching of Snapmatic Image failed because of I/O Error"));
return;
@ -899,21 +832,23 @@ void PictureDialog::editSnapmaticImage()
telemetrySettings.beginGroup("Telemetry");
bool pushUsageData = telemetrySettings.value("PushUsageData", false).toBool();
telemetrySettings.endGroup();
if (pushUsageData && Telemetry->canPush())
{
if (pushUsageData && Telemetry->canPush()) {
QJsonDocument jsonDocument;
QJsonObject jsonObject;
jsonObject["Type"] = "ImageEdited";
jsonObject["ExtraFlags"] = "Viewer";
jsonObject["EditedSize"] = QString::number(smpic->getContentMaxLength());
#if QT_VERSION >= 0x060000
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
}
#endif
}
else
{
else {
QMessageBox::warning(this, QApplication::translate("ImageEditorDialog", "Snapmatic Image Editor"), QApplication::translate("ImageEditorDialog", "Patching of Snapmatic Image failed because of Image Error"));
return;
}
@ -925,12 +860,10 @@ void PictureDialog::editSnapmaticRawJson()
{
SnapmaticPicture *picture = smpic;
JsonEditorDialog *jsonEditor;
if (rqFullscreen && fullscreenWidget != nullptr)
{
if (rqFullscreen && fullscreenWidget != nullptr) {
jsonEditor = new JsonEditorDialog(picture, fullscreenWidget);
}
else
{
else {
jsonEditor = new JsonEditorDialog(picture, this);
}
jsonEditor->setWindowIcon(windowIcon());
@ -948,12 +881,10 @@ void PictureDialog::updated()
{
SnapmaticPicture *picture = smpic; // used by macro
crewStr = crewDB->getCrewName(crewID);
if (globalMap.contains(picArea))
{
if (globalMap.contains(picArea)) {
picAreaStr = globalMap[picArea];
}
else
{
else {
picAreaStr = picArea;
}
setWindowTitle(windowTitleStr.arg(picTitl));
@ -963,8 +894,7 @@ void PictureDialog::updated()
void PictureDialog::customSignal(QString signal)
{
SnapmaticPicture *picture = smpic; // used by macro
if (signal == "PictureUpdated")
{
if (signal == "PictureUpdated") {
snapmaticPicture = picture->getImage();
renderPicture();
}

22
ProfileInterface.cpp

@ -1,6 +1,6 @@
/*****************************************************************************
* gta5view Grand Theft Auto V Profile Viewer
* Copyright (C) 2016-2020 Syping
* Copyright (C) 2016-2021 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
@ -625,7 +625,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime
QJsonObject jsonObject;
jsonObject["Type"] = "ImportSuccess";
jsonObject["ImportSize"] = QString::number(picture->getContentMaxLength());
#if QT_VERSION >= 0x060000
jsonObject["ImportTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["ImportTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonObject["ImportType"] = "Snapmatic";
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
@ -660,7 +664,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime
QJsonDocument jsonDocument;
QJsonObject jsonObject;
jsonObject["Type"] = "ImportSuccess";
#if QT_VERSION >= 0x060000
jsonObject["ImportTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["ImportTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonObject["ImportType"] = "Savegame";
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
@ -851,7 +859,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime
jsonObject["Type"] = "ImportSuccess";
jsonObject["ExtraFlag"] = "Dialog";
jsonObject["ImportSize"] = QString::number(picture->getContentMaxLength());
#if QT_VERSION >= 0x060000
jsonObject["ImportTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["ImportTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonObject["ImportType"] = "Image";
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
@ -898,7 +910,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime
QJsonObject jsonObject;
jsonObject["Type"] = "ImportSuccess";
jsonObject["ImportSize"] = QString::number(picture->getContentMaxLength());
#if QT_VERSION >= 0x060000
jsonObject["ImportTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["ImportTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonObject["ImportType"] = "Snapmatic";
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
@ -924,7 +940,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime
QJsonDocument jsonDocument;
QJsonObject jsonObject;
jsonObject["Type"] = "ImportSuccess";
#if QT_VERSION >= 0x060000
jsonObject["ImportTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["ImportTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonObject["ImportType"] = "Savegame";
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);

10
SavegameWidget.cpp

@ -1,6 +1,6 @@
/*****************************************************************************
* gta5view Grand Theft Auto V Profile Viewer
* Copyright (C) 2016-2018 Syping
* Copyright (C) 2016-2021 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
@ -152,7 +152,11 @@ void SavegameWidget::on_cmdDelete_clicked()
QJsonObject jsonObject;
jsonObject["Type"] = "DeleteSuccess";
jsonObject["ExtraFlags"] = "Savegame";
#if QT_VERSION >= 0x060000
jsonObject["DeletedTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["DeletedTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
}
@ -171,7 +175,11 @@ void SavegameWidget::on_cmdDelete_clicked()
QJsonObject jsonObject;
jsonObject["Type"] = "DeleteSuccess";
jsonObject["ExtraFlags"] = "Savegame";
#if QT_VERSION >= 0x060000
jsonObject["DeletedTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["DeletedTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
}

6
SnapmaticEditor.cpp

@ -1,6 +1,6 @@
/*****************************************************************************
* gta5view Grand Theft Auto V Profile Viewer
* Copyright (C) 2016-2018 Syping
* Copyright (C) 2016-2021 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
@ -349,7 +349,11 @@ void SnapmaticEditor::on_cmdApply_clicked()
QJsonObject jsonObject;
jsonObject["Type"] = "PropertyEdited";
jsonObject["EditedSize"] = QString::number(smpic->getContentMaxLength());
#if QT_VERSION >= 0x060000
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
}

14
SnapmaticWidget.cpp

@ -1,6 +1,6 @@
/*****************************************************************************
* gta5view Grand Theft Auto V Profile Viewer
* Copyright (C) 2016-2020 Syping
* Copyright (C) 2016-2021 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
@ -197,7 +197,11 @@ bool SnapmaticWidget::deletePicture()
jsonObject["Type"] = "DeleteSuccess";
jsonObject["ExtraFlags"] = "Snapmatic";
jsonObject["DeletedSize"] = QString::number(smpic->getContentMaxLength());
#if QT_VERSION >= 0x060000
jsonObject["DeletedTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["DeletedTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
}
@ -403,7 +407,11 @@ void SnapmaticWidget::editSnapmaticImage()
jsonObject["Type"] = "ImageEdited";
jsonObject["ExtraFlags"] = "Interface";
jsonObject["EditedSize"] = QString::number(smpic->getContentMaxLength());
#if QT_VERSION >= 0x060000
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
}
@ -462,7 +470,11 @@ void SnapmaticWidget::openMapViewer()
jsonObject["Type"] = "LocationEdited";
jsonObject["ExtraFlags"] = "Interface";
jsonObject["EditedSize"] = QString::number(picture->getContentMaxLength());
#if QT_VERSION >= 0x060000
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
#else
jsonObject["EditedTime"] = QString::number(QDateTime::currentDateTimeUtc().toTime_t());
#endif
jsonDocument.setObject(jsonObject);
Telemetry->push(TelemetryCategory::PersonalData, jsonDocument);
}

426
res/gta5sync.ts

@ -192,22 +192,22 @@ Pictures and Savegames</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="893"/>
<location filename="../PictureDialog.cpp" line="917"/>
<location filename="../SnapmaticWidget.cpp" line="390"/>
<location filename="../SnapmaticWidget.cpp" line="414"/>
<location filename="../PictureDialog.cpp" line="826"/>
<location filename="../PictureDialog.cpp" line="852"/>
<location filename="../SnapmaticWidget.cpp" line="394"/>
<location filename="../SnapmaticWidget.cpp" line="422"/>
<source>Snapmatic Image Editor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="893"/>
<location filename="../SnapmaticWidget.cpp" line="390"/>
<location filename="../PictureDialog.cpp" line="826"/>
<location filename="../SnapmaticWidget.cpp" line="394"/>
<source>Patching of Snapmatic Image failed because of I/O Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="917"/>
<location filename="../SnapmaticWidget.cpp" line="414"/>
<location filename="../PictureDialog.cpp" line="852"/>
<location filename="../SnapmaticWidget.cpp" line="422"/>
<source>Patching of Snapmatic Image failed because of Image Error</source>
<translation type="unfinished"></translation>
</message>
@ -368,14 +368,14 @@ Pictures and Savegames</source>
</message>
<message>
<location filename="../ImportDialog.cpp" line="195"/>
<location filename="../ProfileInterface.cpp" line="722"/>
<location filename="../ProfileInterface.cpp" line="730"/>
<source>Custom Avatar</source>
<comment>Custom Avatar Description in SC, don&apos;t use Special Character!</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ImportDialog.cpp" line="218"/>
<location filename="../ProfileInterface.cpp" line="741"/>
<location filename="../ProfileInterface.cpp" line="749"/>
<source>Custom Picture</source>
<comment>Custom Picture Description in SC, don&apos;t use Special Character!</comment>
<translation type="unfinished"></translation>
@ -722,26 +722,26 @@ Y: %2</source>
<message>
<location filename="../OptionsDialog.ui" line="399"/>
<location filename="../OptionsDialog.ui" line="422"/>
<location filename="../OptionsDialog.cpp" line="639"/>
<location filename="../OptionsDialog.cpp" line="640"/>
<location filename="../OptionsDialog.cpp" line="654"/>
<location filename="../OptionsDialog.cpp" line="655"/>
<location filename="../OptionsDialog.cpp" line="668"/>
<location filename="../OptionsDialog.cpp" line="669"/>
<location filename="../OptionsDialog.cpp" line="643"/>
<location filename="../OptionsDialog.cpp" line="644"/>
<location filename="../OptionsDialog.cpp" line="658"/>
<location filename="../OptionsDialog.cpp" line="659"/>
<location filename="../OptionsDialog.cpp" line="672"/>
<location filename="../OptionsDialog.cpp" line="673"/>
<source>Found: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.ui" line="406"/>
<location filename="../OptionsDialog.ui" line="429"/>
<location filename="../OptionsDialog.cpp" line="643"/>
<location filename="../OptionsDialog.cpp" line="647"/>
<location filename="../OptionsDialog.cpp" line="659"/>
<location filename="../OptionsDialog.cpp" line="651"/>
<location filename="../OptionsDialog.cpp" line="663"/>
<location filename="../OptionsDialog.cpp" line="672"/>
<location filename="../OptionsDialog.cpp" line="667"/>
<location filename="../OptionsDialog.cpp" line="676"/>
<location filename="../OptionsDialog.cpp" line="680"/>
<location filename="../OptionsDialog.cpp" line="684"/>
<location filename="../OptionsDialog.cpp" line="688"/>
<source>Language: %1</source>
<translation type="unfinished"></translation>
</message>
@ -762,7 +762,7 @@ Y: %2</source>
</message>
<message>
<location filename="../OptionsDialog.ui" line="465"/>
<location filename="../OptionsDialog.cpp" line="601"/>
<location filename="../OptionsDialog.cpp" line="605"/>
<source>Participate in %1 User Statistics</source>
<translation type="unfinished"></translation>
</message>
@ -798,8 +798,8 @@ Y: %2</source>
</message>
<message>
<location filename="../OptionsDialog.ui" line="554"/>
<location filename="../OptionsDialog.cpp" line="617"/>
<location filename="../OptionsDialog.cpp" line="621"/>
<location filename="../OptionsDialog.cpp" line="625"/>
<source>Participation ID: %1</source>
<translation type="unfinished"></translation>
</message>
@ -917,62 +917,62 @@ Y: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="489"/>
<location filename="../OptionsDialog.cpp" line="493"/>
<source>%1</source>
<comment>%1</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="489"/>
<location filename="../OptionsDialog.cpp" line="493"/>
<source>The new Custom Folder will initialise after you restart %1.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="499"/>
<location filename="../OptionsDialog.cpp" line="503"/>
<source>No Profile</source>
<comment>No Profile, as default</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="507"/>
<location filename="../OptionsDialog.cpp" line="511"/>
<location filename="../OptionsDialog.cpp" line="513"/>
<location filename="../OptionsDialog.cpp" line="515"/>
<location filename="../OptionsDialog.cpp" line="517"/>
<source>Profile: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="602"/>
<location filename="../OptionsDialog.cpp" line="606"/>
<source>View %1 User Statistics Online</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="621"/>
<location filename="../OptionsDialog.cpp" line="625"/>
<source>Not registered</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="639"/>
<location filename="../OptionsDialog.cpp" line="655"/>
<location filename="../OptionsDialog.cpp" line="668"/>
<location filename="../OptionsDialog.cpp" line="669"/>
<location filename="../OptionsDialog.cpp" line="643"/>
<location filename="../OptionsDialog.cpp" line="659"/>
<location filename="../OptionsDialog.cpp" line="672"/>
<location filename="../OptionsDialog.cpp" line="673"/>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="640"/>
<location filename="../OptionsDialog.cpp" line="654"/>
<location filename="../OptionsDialog.cpp" line="644"/>
<location filename="../OptionsDialog.cpp" line="658"/>
<source>No</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="647"/>
<location filename="../OptionsDialog.cpp" line="676"/>
<location filename="../OptionsDialog.cpp" line="651"/>
<location filename="../OptionsDialog.cpp" line="680"/>
<source>OS defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="663"/>
<location filename="../OptionsDialog.cpp" line="684"/>
<location filename="../OptionsDialog.cpp" line="667"/>
<location filename="../OptionsDialog.cpp" line="688"/>
<source>Steam defined</source>
<translation type="unfinished"></translation>
</message>
@ -1013,78 +1013,78 @@ Y: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="174"/>
<location filename="../ProfileInterface.cpp" line="1687"/>
<location filename="../PictureDialog.cpp" line="172"/>
<location filename="../ProfileInterface.cpp" line="1707"/>
<source>Export as &amp;Picture...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="175"/>
<location filename="../ProfileInterface.cpp" line="1688"/>
<location filename="../PictureDialog.cpp" line="173"/>
<location filename="../ProfileInterface.cpp" line="1708"/>
<source>Export as &amp;Snapmatic...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="177"/>
<location filename="../ProfileInterface.cpp" line="1681"/>
<location filename="../PictureDialog.cpp" line="175"/>
<location filename="../ProfileInterface.cpp" line="1701"/>
<source>&amp;Edit Properties...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="178"/>
<location filename="../ProfileInterface.cpp" line="1682"/>
<location filename="../PictureDialog.cpp" line="176"/>
<location filename="../ProfileInterface.cpp" line="1702"/>
<source>&amp;Overwrite Image...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="180"/>
<location filename="../ProfileInterface.cpp" line="1684"/>
<location filename="../PictureDialog.cpp" line="178"/>
<location filename="../ProfileInterface.cpp" line="1704"/>
<source>Open &amp;Map Viewer...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="182"/>
<location filename="../ProfileInterface.cpp" line="1685"/>
<location filename="../PictureDialog.cpp" line="180"/>
<location filename="../ProfileInterface.cpp" line="1705"/>
<source>Open &amp;JSON Editor...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="488"/>
<location filename="../PictureDialog.cpp" line="439"/>
<source>Key 1 - Avatar Preview Mode
Key 2 - Toggle Overlay
Arrow Keys - Navigate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="547"/>
<location filename="../PictureDialog.cpp" line="494"/>
<source>Snapmatic Picture Viewer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="547"/>
<location filename="../PictureDialog.cpp" line="494"/>
<source>Failed at %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="567"/>
<location filename="../PictureDialog.cpp" line="686"/>
<location filename="../PictureDialog.cpp" line="514"/>
<location filename="../PictureDialog.cpp" line="630"/>
<location filename="../SnapmaticEditor.cpp" line="246"/>
<source>No Players</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="567"/>
<location filename="../PictureDialog.cpp" line="665"/>
<location filename="../PictureDialog.cpp" line="514"/>
<location filename="../PictureDialog.cpp" line="609"/>
<source>No Crew</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="567"/>
<location filename="../PictureDialog.cpp" line="514"/>
<source>Unknown Location</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="620"/>
<location filename="../PictureDialog.cpp" line="567"/>
<source>Avatar Preview Mode
Press 1 for Default View</source>
<translation type="unfinished"></translation>
@ -1299,18 +1299,18 @@ Press 1 for Default View</source>
<location filename="../ProfileInterface.cpp" line="542"/>
<location filename="../ProfileInterface.cpp" line="563"/>
<location filename="../ProfileInterface.cpp" line="597"/>
<location filename="../ProfileInterface.cpp" line="639"/>
<location filename="../ProfileInterface.cpp" line="674"/>
<location filename="../ProfileInterface.cpp" line="787"/>
<location filename="../ProfileInterface.cpp" line="797"/>
<location filename="../ProfileInterface.cpp" line="944"/>
<location filename="../ProfileInterface.cpp" line="949"/>
<location filename="../ProfileInterface.cpp" line="987"/>
<location filename="../ProfileInterface.cpp" line="1117"/>
<location filename="../ProfileInterface.cpp" line="1125"/>
<location filename="../ProfileInterface.cpp" line="1221"/>
<location filename="../ProfileInterface.cpp" line="1258"/>
<location filename="../ProfileInterface.cpp" line="1264"/>
<location filename="../ProfileInterface.cpp" line="643"/>
<location filename="../ProfileInterface.cpp" line="682"/>
<location filename="../ProfileInterface.cpp" line="795"/>
<location filename="../ProfileInterface.cpp" line="805"/>
<location filename="../ProfileInterface.cpp" line="964"/>
<location filename="../ProfileInterface.cpp" line="969"/>
<location filename="../ProfileInterface.cpp" line="1007"/>
<location filename="../ProfileInterface.cpp" line="1137"/>
<location filename="../ProfileInterface.cpp" line="1145"/>
<location filename="../ProfileInterface.cpp" line="1241"/>
<location filename="../ProfileInterface.cpp" line="1278"/>
<location filename="../ProfileInterface.cpp" line="1284"/>
<source>Import...</source>
<translation type="unfinished"></translation>
</message>
@ -1342,14 +1342,14 @@ Press 1 for Default View</source>
<message>
<location filename="../ImportDialog.cpp" line="509"/>
<location filename="../ImportDialog.cpp" line="836"/>
<location filename="../ProfileInterface.cpp" line="787"/>
<location filename="../ProfileInterface.cpp" line="795"/>
<source>Can&apos;t import %1 because file can&apos;t be open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ImportDialog.cpp" line="518"/>
<location filename="../ImportDialog.cpp" line="845"/>
<location filename="../ProfileInterface.cpp" line="797"/>
<location filename="../ProfileInterface.cpp" line="805"/>
<source>Can&apos;t import %1 because file can&apos;t be parsed properly</source>
<translation type="unfinished"></translation>
</message>
@ -1398,7 +1398,7 @@ Press 1 for Default View</source>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="542"/>
<location filename="../ProfileInterface.cpp" line="949"/>
<location filename="../ProfileInterface.cpp" line="969"/>
<location filename="../UserInterface.cpp" line="558"/>
<source>No valid file is selected</source>
<translation type="unfinished"></translation>
@ -1417,136 +1417,136 @@ Press 1 for Default View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="639"/>
<location filename="../ProfileInterface.cpp" line="643"/>
<location filename="../UserInterface.cpp" line="510"/>
<source>Failed to read Snapmatic picture</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="674"/>
<location filename="../ProfileInterface.cpp" line="682"/>
<location filename="../UserInterface.cpp" line="526"/>
<source>Failed to read Savegame file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="944"/>
<location filename="../ProfileInterface.cpp" line="964"/>
<source>Can&apos;t import %1 because file format can&apos;t be detected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1003"/>
<location filename="../ProfileInterface.cpp" line="1023"/>
<source>Prepare Content for Import...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1117"/>
<location filename="../ProfileInterface.cpp" line="1137"/>
<source>Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1125"/>
<location filename="../ProfileInterface.cpp" line="1145"/>
<source>A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1221"/>
<location filename="../ProfileInterface.cpp" line="1241"/>
<source>Failed to import the Snapmatic picture, can&apos;t copy the file into profile</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1258"/>
<location filename="../ProfileInterface.cpp" line="1278"/>
<source>Failed to import the Savegame, can&apos;t copy the file into profile</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1264"/>
<location filename="../ProfileInterface.cpp" line="1284"/>
<source>Failed to import the Savegame, no Savegame slot is left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1328"/>
<location filename="../ProfileInterface.cpp" line="1366"/>
<location filename="../ProfileInterface.cpp" line="1411"/>
<location filename="../ProfileInterface.cpp" line="1446"/>
<location filename="../ProfileInterface.cpp" line="1348"/>
<location filename="../ProfileInterface.cpp" line="1386"/>
<location filename="../ProfileInterface.cpp" line="1431"/>
<location filename="../ProfileInterface.cpp" line="1466"/>
<location filename="../ProfileInterface.cpp" line="1486"/>
<source>Export selected...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1351"/>
<location filename="../ProfileInterface.cpp" line="1369"/>
<location filename="../ProfileInterface.cpp" line="1371"/>
<location filename="../ProfileInterface.cpp" line="1389"/>
<source>JPG pictures and GTA Snapmatic</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1352"/>
<location filename="../ProfileInterface.cpp" line="1374"/>
<location filename="../ProfileInterface.cpp" line="1372"/>
<location filename="../ProfileInterface.cpp" line="1394"/>
<source>JPG pictures only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1353"/>
<location filename="../ProfileInterface.cpp" line="1378"/>
<location filename="../ProfileInterface.cpp" line="1373"/>
<location filename="../ProfileInterface.cpp" line="1398"/>
<source>GTA Snapmatic only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1366"/>
<location filename="../ProfileInterface.cpp" line="1386"/>
<source>%1Export Snapmatic pictures%2&lt;br&gt;&lt;br&gt;JPG pictures make it possible to open the picture with a Image Viewer&lt;br&gt;GTA Snapmatic make it possible to import the picture into the game&lt;br&gt;&lt;br&gt;Export as:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1412"/>
<location filename="../ProfileInterface.cpp" line="1432"/>
<source>Initialising export...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1446"/>
<location filename="../ProfileInterface.cpp" line="1466"/>
<source>Export failed with...
%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1466"/>
<location filename="../ProfileInterface.cpp" line="1508"/>
<location filename="../ProfileInterface.cpp" line="1486"/>
<location filename="../ProfileInterface.cpp" line="1528"/>
<source>No Snapmatic pictures or Savegames files are selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="1474"/>
<location filename="../ProfileInterface.cpp" line="1502"/>
<location filename="../ProfileInterface.cpp" line="1508"/>