diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index 28d4185..167d04d 100644 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -31,6 +31,7 @@ #include "ImportDialog.h" #include "UiModLabel.h" #include "pcg_basic.h" +#include "wrapper.h" #include "AppEnv.h" #include "config.h" #include @@ -103,22 +104,18 @@ ProfileInterface::ProfileInterface(ProfileDatabase *profileDB, CrewDatabase *cre ui->saProfileContent->setImageDropEnabled(true); // Set Icon for Close Button - if (QIcon::hasThemeIcon("dialog-close")) - { + if (QIcon::hasThemeIcon("dialog-close")) { ui->cmdCloseProfile->setIcon(QIcon::fromTheme("dialog-close")); } - else if (QIcon::hasThemeIcon("gtk-close")) - { + else if (QIcon::hasThemeIcon("gtk-close")) { ui->cmdCloseProfile->setIcon(QIcon::fromTheme("gtk-close")); } // Set Icon for Import Button - if (QIcon::hasThemeIcon("document-import")) - { + if (QIcon::hasThemeIcon("document-import")) { ui->cmdImport->setIcon(QIcon::fromTheme("document-import")); } - else if (QIcon::hasThemeIcon("document-open")) - { + else if (QIcon::hasThemeIcon("document-open")) { ui->cmdImport->setIcon(QIcon::fromTheme("document-open")); } @@ -128,13 +125,11 @@ ProfileInterface::ProfileInterface(ProfileDatabase *profileDB, CrewDatabase *cre ui->hlButtons->setSpacing(6 * screenRatio); ui->hlButtons->setContentsMargins(9 * screenRatio, 9 * screenRatio, 9 * screenRatio, 9 * screenRatio); #else - if (QApplication::style()->objectName() == "macintosh") - { + if (QApplication::style()->objectName() == "macintosh") { ui->hlButtons->setSpacing(6 * screenRatio); ui->hlButtons->setContentsMargins(9 * screenRatio, 15 * screenRatio, 15 * screenRatio, 17 * screenRatio); } - else - { + else { ui->hlButtons->setSpacing(6 * screenRatio); ui->hlButtons->setContentsMargins(9 * screenRatio, 9 * screenRatio, 9 * screenRatio, 9 * screenRatio); } @@ -149,22 +144,22 @@ ProfileInterface::ProfileInterface(ProfileDatabase *profileDB, CrewDatabase *cre ProfileInterface::~ProfileInterface() { - for (ProfileWidget *widget : widgets.keys()) - { - widget->removeEventFilter(this); - widget->disconnect(); - delete widget; + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + widget->removeEventFilter(this); + widget->disconnect(); + delete widget; + } } widgets.clear(); - for (SavegameData *savegame : savegames) - { + for (SavegameData *savegame : qAsConst(savegames)) { delete savegame; } savegames.clear(); - for (SnapmaticPicture *picture : pictures) - { + for (SnapmaticPicture *picture : qAsConst(pictures)) { delete picture; } pictures.clear(); @@ -262,8 +257,8 @@ void ProfileInterface::loadingProgress(int value, int maximum) void ProfileInterface::insertSnapmaticIPI(QWidget *widget) { ProfileWidget *proWidget = qobject_cast(widget); - if (widgets.contains(proWidget)) { - QString widgetKey = widgets[proWidget]; + const QString widgetKey = widgets.value(proWidget, QString()); + if (!widgetKey.isNull()) { QStringList widgetsKeyList = widgets.values(); QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive); #if QT_VERSION >= 0x050600 @@ -282,8 +277,8 @@ void ProfileInterface::insertSnapmaticIPI(QWidget *widget) void ProfileInterface::insertSavegameIPI(QWidget *widget) { ProfileWidget *proWidget = qobject_cast(widget); - if (widgets.contains(proWidget)) { - QString widgetKey = widgets[proWidget]; + const QString widgetKey = widgets.value(proWidget, QString()); + if (!widgetKey.isNull()) { QStringList widgetsKeyList = widgets.values(); QStringList savegameKeyList = widgetsKeyList.filter("SGD", Qt::CaseSensitive); #if QT_VERSION >= 0x050600 @@ -303,8 +298,8 @@ void ProfileInterface::dialogNextPictureRequested(QWidget *dialog) { PictureDialog *picDialog = qobject_cast(dialog); ProfileWidget *proWidget = qobject_cast(sender()); - if (widgets.contains(proWidget)) { - QString widgetKey = widgets[proWidget]; + const QString widgetKey = widgets.value(proWidget, QString()); + if (!widgetKey.isNull()) { QStringList widgetsKeyList = widgets.values(); QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive); #if QT_VERSION >= 0x050600 @@ -313,22 +308,17 @@ void ProfileInterface::dialogNextPictureRequested(QWidget *dialog) qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater()); #endif int picIndex; - if (picDialog->isIndexed()) - { + if (picDialog->isIndexed()) { picIndex = picDialog->getIndex(); } - else - { + else { picIndex = pictureKeyList.indexOf(widgetKey); } picIndex++; - if (pictureKeyList.length() > picIndex) - { - QString newWidgetKey = pictureKeyList.at(picIndex); - SnapmaticWidget *picWidget = (SnapmaticWidget*)widgets.key(newWidgetKey); - //picDialog->setMaximumHeight(QWIDGETSIZE_MAX); + if (pictureKeyList.length() > picIndex) { + const QString newWidgetKey = pictureKeyList.at(picIndex); + SnapmaticWidget *picWidget = static_cast(widgets.key(newWidgetKey)); picDialog->setSnapmaticPicture(picWidget->getPicture(), picIndex); - //picDialog->setMaximumHeight(picDialog->height()); } } } @@ -337,9 +327,8 @@ void ProfileInterface::dialogPreviousPictureRequested(QWidget *dialog) { PictureDialog *picDialog = qobject_cast(dialog); ProfileWidget *proWidget = qobject_cast(sender()); - if (widgets.contains(proWidget)) - { - QString widgetKey = widgets[proWidget]; + const QString widgetKey = widgets.value(proWidget, QString()); + if (!widgetKey.isNull()) { QStringList widgetsKeyList = widgets.values(); QStringList pictureKeyList = widgetsKeyList.filter("PIC", Qt::CaseSensitive); #if QT_VERSION >= 0x050600 @@ -348,22 +337,17 @@ void ProfileInterface::dialogPreviousPictureRequested(QWidget *dialog) qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater()); #endif int picIndex; - if (picDialog->isIndexed()) - { + if (picDialog->isIndexed()) { picIndex = picDialog->getIndex(); } - else - { + else { picIndex = pictureKeyList.indexOf(widgetKey); } - if (picIndex > 0) - { + if (picIndex > 0) { picIndex--; - QString newWidgetKey = pictureKeyList.at(picIndex ); - SnapmaticWidget *picWidget = (SnapmaticWidget*)widgets.key(newWidgetKey); - //picDialog->setMaximumHeight(QWIDGETSIZE_MAX); + const QString newWidgetKey = pictureKeyList.at(picIndex); + SnapmaticWidget *picWidget = static_cast(widgets.key(newWidgetKey)); picDialog->setSnapmaticPicture(picWidget->getPicture(), picIndex); - //picDialog->setMaximumHeight(picDialog->height()); } } } @@ -381,15 +365,12 @@ void ProfileInterface::sortingProfileInterface() qSort(widgetsKeyList.begin(), widgetsKeyList.end()); #endif - for (QString widgetKey : widgetsKeyList) - { + for (const QString &widgetKey : qAsConst(widgetsKeyList)) { ProfileWidget *widget = widgets.key(widgetKey); - if (widget->getWidgetType() == "SnapmaticWidget") - { + if (widget->getWidgetType() == "SnapmaticWidget") { ui->vlSnapmatic->insertWidget(0, widget); } - else if (widget->getWidgetType() == "SavegameWidget") - { + else if (widget->getWidgetType() == "SavegameWidget") { ui->vlSavegame->addWidget(widget); } } @@ -411,12 +392,10 @@ void ProfileInterface::profileLoaded_p() isProfileLoaded = true; emit profileLoaded(); - if (!fixedPictures.isEmpty()) - { + if (!fixedPictures.isEmpty()) { int fixedInt = 0; QString fixedStr; - for (QString fixedPicture : fixedPictures) - { + for (const QString &fixedPicture : qAsConst(fixedPictures)) { if (fixedInt != 0) { fixedStr += "
"; } fixedStr += fixedPicture; fixedInt++; @@ -433,13 +412,13 @@ void ProfileInterface::savegameDeleted_event() void ProfileInterface::savegameDeleted(SavegameWidget *sgdWidget, bool isRemoteEmited) { SavegameData *savegame = sgdWidget->getSavegame(); - if (sgdWidget->isSelected()) { sgdWidget->setSelected(false); } + if (sgdWidget->isSelected()) + sgdWidget->setSelected(false); widgets.remove(sgdWidget); sgdWidget->disconnect(); sgdWidget->removeEventFilter(this); - if (sgdWidget == previousWidget) - { + if (sgdWidget == previousWidget) { previousWidget = nullptr; } @@ -458,13 +437,13 @@ void ProfileInterface::pictureDeleted_event() void ProfileInterface::pictureDeleted(SnapmaticWidget *picWidget, bool isRemoteEmited) { SnapmaticPicture *picture = picWidget->getPicture(); - if (picWidget->isSelected()) { picWidget->setSelected(false); } + if (picWidget->isSelected()) + picWidget->setSelected(false); widgets.remove(picWidget); picWidget->disconnect(); picWidget->removeEventFilter(this); - if (picWidget == previousWidget) - { + if (picWidget == previousWidget) { previousWidget = nullptr; } @@ -499,13 +478,11 @@ fileDialogPreOpen: //Work? // Getting readable Image formats QString imageFormatsStr = " "; - for (QByteArray imageFormat : QImageReader::supportedImageFormats()) - { + for (const QByteArray &imageFormat : QImageReader::supportedImageFormats()) { imageFormatsStr += QString("*.") % QString::fromUtf8(imageFormat).toLower() % " "; } QString importableFormatsStr = QString("*.g5e SGTA* PGTA*"); - if (!imageFormatsStr.trimmed().isEmpty()) - { + if (!imageFormatsStr.trimmed().isEmpty()) { importableFormatsStr = QString("*.g5e%1SGTA* PGTA*").arg(imageFormatsStr); } @@ -524,21 +501,17 @@ fileDialogPreOpen: //Work? fileDialog.setDirectory(settings.value(profileName % "+Directory", StandardPaths::documentsLocation()).toString()); fileDialog.restoreGeometry(settings.value(profileName % "+Geometry", "").toByteArray()); - if (fileDialog.exec()) - { + if (fileDialog.exec()) { QStringList selectedFiles = fileDialog.selectedFiles(); - if (selectedFiles.length() == 1) - { + if (selectedFiles.length() == 1) { QString selectedFile = selectedFiles.at(0); QDateTime importDateTime = QDateTime::currentDateTime(); if (!importFile(selectedFile, importDateTime, true)) goto fileDialogPreOpen; //Work? } - else if (selectedFiles.length() > 1) - { + else if (selectedFiles.length() > 1) { importFilesProgress(selectedFiles); } - else - { + else { QMessageBox::warning(this, tr("Import..."), tr("No valid file is selected")); goto fileDialogPreOpen; //Work? } @@ -574,25 +547,21 @@ bool ProfileInterface::importFilesProgress(QStringList selectedFiles) // THREADING HERE PLEASE QDateTime importDateTime = QDateTime::currentDateTime(); - for (QString selectedFile : selectedFiles) - { + for (const QString &selectedFile : selectedFiles) { overallId++; pbDialog.setValue(overallId); pbDialog.setLabelText(tr("Import file %1 of %2 files").arg(QString::number(overallId), QString::number(maximumId))); importDateTime = QDateTime::currentDateTime(); - if (!importFile(selectedFile, importDateTime, false)) - { + if (!importFile(selectedFile, importDateTime, false)) { failed << QFileInfo(selectedFile).fileName(); } } pbDialog.close(); - for (QString curErrorStr : failed) - { + for (const QString &curErrorStr : qAsConst(failed)) { errorStr += ", " % curErrorStr; } - if (errorStr != "") - { + if (errorStr != "") { errorStr.remove(0, 2); QMessageBox::warning(this, tr("Import..."), tr("Import failed with...\n\n%1").arg(errorStr)); return false; @@ -603,24 +572,20 @@ bool ProfileInterface::importFilesProgress(QStringList selectedFiles) bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime, bool notMultiple) { QString selectedFileName = QFileInfo(selectedFile).fileName(); - if (QFile::exists(selectedFile)) - { - if ((selectedFileName.left(4) == "PGTA" && !selectedFileName.contains('.')) || selectedFileName.right(4) == ".g5e") - { + if (QFile::exists(selectedFile)) { + if ((selectedFileName.left(4) == "PGTA" && !selectedFileName.contains('.')) || selectedFileName.right(4) == ".g5e") { SnapmaticPicture *picture = new SnapmaticPicture(selectedFile); - if (picture->readingPicture(true)) - { + if (picture->readingPicture(true)) { bool success = importSnapmaticPicture(picture, notMultiple); - if (!success) delete picture; + if (!success) + delete picture; #ifdef GTA5SYNC_TELEMETRY - if (success && notMultiple) - { + if (success && notMultiple) { 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"] = "ImportSuccess"; @@ -638,29 +603,26 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime #endif return success; } - else - { - if (notMultiple) QMessageBox::warning(this, tr("Import..."), tr("Failed to read Snapmatic picture")); + else { + if (notMultiple) + QMessageBox::warning(this, tr("Import..."), tr("Failed to read Snapmatic picture")); delete picture; return false; } } - else if (selectedFileName.left(4) == "SGTA") - { + else if (selectedFileName.left(4) == "SGTA") { SavegameData *savegame = new SavegameData(selectedFile); - if (savegame->readingSavegame()) - { + if (savegame->readingSavegame()) { bool success = importSavegameData(savegame, selectedFile, notMultiple); - if (!success) delete savegame; + if (!success) + delete savegame; #ifdef GTA5SYNC_TELEMETRY - if (success && notMultiple) - { + if (success && notMultiple) { 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"] = "ImportSuccess"; @@ -677,23 +639,18 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime #endif return success; } - else - { + else { if (notMultiple) QMessageBox::warning(this, tr("Import..."), tr("Failed to read Savegame file")); delete savegame; return false; } } - else if (isSupportedImageFile(selectedFileName)) - { + else if (isSupportedImageFile(selectedFileName)) { SnapmaticPicture *picture = new SnapmaticPicture(":/template/template.g5e"); - if (picture->readingPicture(false)) - { - if (!notMultiple) - { + if (picture->readingPicture(false)) { + if (!notMultiple) { QFile snapmaticFile(selectedFile); - if (!snapmaticFile.open(QFile::ReadOnly)) - { + if (!snapmaticFile.open(QFile::ReadOnly)) { delete picture; return false; } @@ -701,8 +658,7 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime QImageReader snapmaticImageReader; snapmaticImageReader.setDecideFormatFromContent(true); snapmaticImageReader.setDevice(&snapmaticFile); - if (!snapmaticImageReader.read(&snapmaticImage)) - { + if (!snapmaticImageReader.read(&snapmaticImage)) { delete picture; return false; } @@ -710,38 +666,32 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime QPixmap snapmaticPixmap(960, 536); snapmaticPixmap.fill(Qt::black); QPainter snapmaticPainter(&snapmaticPixmap); - if (snapmaticImage.height() == snapmaticImage.width()) - { + if (snapmaticImage.height() == snapmaticImage.width()) { // Avatar mode int diffWidth = 0; int diffHeight = 0; snapmaticImage = snapmaticImage.scaled(470, 470, Qt::KeepAspectRatio, Qt::SmoothTransformation); - if (snapmaticImage.width() > snapmaticImage.height()) - { + if (snapmaticImage.width() > snapmaticImage.height()) { diffHeight = 470 - snapmaticImage.height(); diffHeight = diffHeight / 2; } - else if (snapmaticImage.width() < snapmaticImage.height()) - { + else if (snapmaticImage.width() < snapmaticImage.height()) { diffWidth = 470 - snapmaticImage.width(); diffWidth = diffWidth / 2; } snapmaticPainter.drawImage(145 + diffWidth, 66 + diffHeight, snapmaticImage); customImageTitle = ImportDialog::tr("Custom Avatar", "Custom Avatar Description in SC, don't use Special Character!"); } - else - { + else { // Picture mode int diffWidth = 0; int diffHeight = 0; snapmaticImage = snapmaticImage.scaled(960, 536, Qt::KeepAspectRatio, Qt::SmoothTransformation); - if (snapmaticImage.width() != 960) - { + if (snapmaticImage.width() != 960) { diffWidth = 960 - snapmaticImage.width(); diffWidth = diffWidth / 2; } - else if (snapmaticImage.height() != 536) - { + else if (snapmaticImage.height() != 536) { diffHeight = 536 - snapmaticImage.height(); diffHeight = diffHeight / 2; } @@ -749,8 +699,7 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime customImageTitle = ImportDialog::tr("Custom Picture", "Custom Picture Description in SC, don't use Special Character!"); } snapmaticPainter.end(); - if (!picture->setImage(snapmaticPixmap.toImage())) - { + if (!picture->setImage(snapmaticPixmap.toImage())) { delete picture; return false; } @@ -760,8 +709,7 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".bak"); bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".hidden"); int cEnough = 0; - while ((fExists || fExistsBackup || fExistsHidden) && cEnough < findRetryLimit) - { + while ((fExists || fExistsBackup || fExistsHidden) && cEnough < findRetryLimit) { spJson.uid = getRandomUid(); fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid)); fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".bak"); @@ -783,15 +731,14 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime picture->setPictureTitle(customImageTitle); picture->updateStrings(); bool success = importSnapmaticPicture(picture, notMultiple); - if (!success) delete picture; + if (!success) + delete picture; return success; } - else - { + else { bool success = false; QFile snapmaticFile(selectedFile); - if (!snapmaticFile.open(QFile::ReadOnly)) - { + if (!snapmaticFile.open(QFile::ReadOnly)) { QMessageBox::warning(this, tr("Import..."), tr("Can't import %1 because file can't be open").arg("\""+selectedFileName+"\"")); delete picture; return false; @@ -800,8 +747,7 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime QImageReader snapmaticImageReader; snapmaticImageReader.setDecideFormatFromContent(true); snapmaticImageReader.setDevice(&snapmaticFile); - if (!snapmaticImageReader.read(snapmaticImage)) - { + if (!snapmaticImageReader.read(snapmaticImage)) { QMessageBox::warning(this, tr("Import..."), tr("Can't import %1 because file can't be parsed properly").arg("\""+selectedFileName+"\"")); delete snapmaticImage; delete picture; @@ -812,18 +758,15 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime importDialog->setModal(true); importDialog->show(); importDialog->exec(); - if (importDialog->isImportAgreed()) - { - if (picture->setImage(importDialog->image(), importDialog->isUnlimitedBuffer())) - { + if (importDialog->isImportAgreed()) { + if (picture->setImage(importDialog->image(), importDialog->isUnlimitedBuffer())) { SnapmaticProperties spJson = picture->getSnapmaticProperties(); spJson.uid = getRandomUid(); bool fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid)); bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".bak"); bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".hidden"); int cEnough = 0; - while ((fExists || fExistsBackup || fExistsHidden) && cEnough < findRetryLimit) - { + while ((fExists || fExistsBackup || fExistsHidden) && cEnough < findRetryLimit) { spJson.uid = getRandomUid(); fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid)); fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".bak"); @@ -846,14 +789,12 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime picture->updateStrings(); success = importSnapmaticPicture(picture, notMultiple); #ifdef GTA5SYNC_TELEMETRY - if (success) - { + if (success) { 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"] = "ImportSuccess"; @@ -872,40 +813,36 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime #endif } } - else - { + else { delete picture; success = true; } delete importDialog; - if (!success) delete picture; + if (!success) + delete picture; return success; } } - else - { + else { delete picture; return false; } } - else - { + else { SnapmaticPicture *picture = new SnapmaticPicture(selectedFile); SavegameData *savegame = new SavegameData(selectedFile); - if (picture->readingPicture()) - { + if (picture->readingPicture()) { bool success = importSnapmaticPicture(picture, notMultiple); delete savegame; - if (!success) delete picture; + if (!success) + delete picture; #ifdef GTA5SYNC_TELEMETRY - if (success && notMultiple) - { + if (success && notMultiple) { 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"] = "ImportSuccess"; @@ -923,20 +860,18 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime #endif return success; } - else if (savegame->readingSavegame()) - { + else if (savegame->readingSavegame()) { bool success = importSavegameData(savegame, selectedFile, notMultiple); delete picture; - if (!success) delete savegame; + if (!success) + delete savegame; #ifdef GTA5SYNC_TELEMETRY - if (success && notMultiple) - { + if (success && notMultiple) { 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"] = "ImportSuccess"; @@ -953,8 +888,7 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime #endif return success; } - else - { + else { #ifdef GTA5SYNC_DEBUG qDebug() << "ImportError SnapmaticPicture" << picture->getLastStep(); qDebug() << "ImportError SavegameData" << savegame->getLastStep(); @@ -966,7 +900,8 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime } } } - if (notMultiple) QMessageBox::warning(this, tr("Import..."), tr("No valid file is selected")); + if (notMultiple) + QMessageBox::warning(this, tr("Import..."), tr("No valid file is selected")); return false; } @@ -974,21 +909,16 @@ bool ProfileInterface::importUrls(const QMimeData *mimeData) { QStringList pathList; - for (QUrl currentUrl : mimeData->urls()) - { + for (const QUrl ¤tUrl : mimeData->urls()) { if (currentUrl.isLocalFile()) - { pathList += currentUrl.toLocalFile(); - } } - if (pathList.length() == 1) - { + if (pathList.length() == 1) { QString selectedFile = pathList.at(0); return importFile(selectedFile, QDateTime::currentDateTime(), true); } - else if (pathList.length() > 1) - { + else if (pathList.length() > 1) { return importFilesProgress(pathList); } return false; @@ -1042,23 +972,19 @@ bool ProfileInterface::importRemote(QUrl remoteUrl) urlPasteDialog.close(); - if (netReply->isFinished()) - { + if (netReply->isFinished()) { QImage *snapmaticImage = new QImage(); QImageReader snapmaticImageReader; snapmaticImageReader.setDecideFormatFromContent(true); snapmaticImageReader.setDevice(netReply); - if (snapmaticImageReader.read(snapmaticImage)) - { + if (snapmaticImageReader.read(snapmaticImage)) { retValue = importImage(snapmaticImage, QDateTime::currentDateTime()); } - else - { + else { delete snapmaticImage; } } - else - { + else { netReply->abort(); } delete netReply; @@ -1069,26 +995,22 @@ bool ProfileInterface::importRemote(QUrl remoteUrl) bool ProfileInterface::importImage(QImage *snapmaticImage, QDateTime importDateTime) { SnapmaticPicture *picture = new SnapmaticPicture(":/template/template.g5e"); - if (picture->readingPicture(false)) - { + if (picture->readingPicture(false)) { bool success = false; ImportDialog *importDialog = new ImportDialog(profileName, this); importDialog->setImage(snapmaticImage); importDialog->setModal(true); importDialog->show(); importDialog->exec(); - if (importDialog->isImportAgreed()) - { - if (picture->setImage(importDialog->image(), importDialog->isUnlimitedBuffer())) - { + if (importDialog->isImportAgreed()) { + if (picture->setImage(importDialog->image(), importDialog->isUnlimitedBuffer())) { SnapmaticProperties spJson = picture->getSnapmaticProperties(); spJson.uid = getRandomUid(); bool fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid)); bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".bak"); bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".hidden"); int cEnough = 0; - while ((fExists || fExistsBackup || fExistsHidden) && cEnough < findRetryLimit) - { + while ((fExists || fExistsBackup || fExistsHidden) && cEnough < findRetryLimit) { spJson.uid = getRandomUid(); fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid)); fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(spJson.uid) % ".bak"); @@ -1112,17 +1034,16 @@ bool ProfileInterface::importImage(QImage *snapmaticImage, QDateTime importDateT success = importSnapmaticPicture(picture, true); } } - else - { + else { delete picture; success = true; } delete importDialog; - if (!success) delete picture; + if (!success) + delete picture; return success; } - else - { + else { delete picture; return false; } @@ -1132,19 +1053,16 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa { QString picFileName = picture->getPictureFileName(); QString adjustedFileName = picture->getOriginalPictureFileName(); - if (picFileName.left(4) != "PGTA") - { - if (warn) QMessageBox::warning(this, tr("Import..."), tr("Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e")); + if (!picFileName.startsWith("PGTA5")) { + if (warn) + QMessageBox::warning(this, tr("Import..."), tr("Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e")); return false; } - else if (QFile::exists(profileFolder % "/" % adjustedFileName) || QFile::exists(profileFolder % "/" % adjustedFileName % ".hidden")) - { + else if (QFile::exists(profileFolder % "/" % adjustedFileName) || QFile::exists(profileFolder % "/" % adjustedFileName % ".hidden")) { SnapmaticProperties snapmaticProperties = picture->getSnapmaticProperties(); - if (warn) - { + if (warn) { int uchoice = QMessageBox::question(this, tr("Import..."), tr("A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp?").arg(QString::number(snapmaticProperties.uid)), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); - if (uchoice == QMessageBox::Yes) - { + if (uchoice == QMessageBox::Yes) { // Update Snapmatic uid snapmaticProperties.uid = getRandomUid(); snapmaticProperties.createdDateTime = QDateTime::currentDateTime(); @@ -1161,21 +1079,18 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".bak"); bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".hidden"); int cEnough = 0; - while ((fExists || fExistsBackup || fExistsHidden) && cEnough < findRetryLimit) - { + while ((fExists || fExistsBackup || fExistsHidden) && cEnough < findRetryLimit) { snapmaticProperties.uid = getRandomUid(); fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid)); fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".bak"); fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".hidden"); cEnough++; } - if (fExists || fExistsBackup || fExistsHidden) - { + if (fExists || fExistsBackup || fExistsHidden) { // That should never happen return false; } - if (!picture->setSnapmaticProperties(snapmaticProperties)) - { + if (!picture->setSnapmaticProperties(snapmaticProperties)) { // That should never happen return false; } @@ -1183,13 +1098,11 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa picFileName = picture->getPictureFileName(); adjustedFileName = picture->getOriginalPictureFileName(); } - else - { + else { return false; } } - else - { + else { // Update Snapmatic uid snapmaticProperties.uid = getRandomUid(); snapmaticProperties.createdDateTime = QDateTime::currentDateTime(); @@ -1206,21 +1119,18 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".bak"); bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".hidden"); int cEnough = 0; - while ((fExists || fExistsBackup || fExistsHidden) && cEnough < findRetryLimit) - { + while ((fExists || fExistsBackup || fExistsHidden) && cEnough < findRetryLimit) { snapmaticProperties.uid = getRandomUid(); fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid)); fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".bak"); fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".hidden"); cEnough++; } - if (fExists || fExistsBackup || fExistsHidden) - { + if (fExists || fExistsBackup || fExistsHidden) { // That should never happen return false; } - if (!picture->setSnapmaticProperties(snapmaticProperties)) - { + if (!picture->setSnapmaticProperties(snapmaticProperties)) { // That should never happen return false; } @@ -1229,16 +1139,15 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa adjustedFileName = picture->getOriginalPictureFileName(); } } - if (picture->exportPicture(profileFolder % "/" % adjustedFileName, SnapmaticFormat::PGTA_Format)) - { + if (picture->exportPicture(profileFolder % "/" % adjustedFileName, SnapmaticFormat::PGTA_Format)) { picture->setSnapmaticFormat(SnapmaticFormat::PGTA_Format); picture->setPicFilePath(profileFolder % "/" % adjustedFileName); pictureLoaded(picture, true); return true; } - else - { - if (warn) QMessageBox::warning(this, tr("Import..."), tr("Failed to import the Snapmatic picture, can't copy the file into profile")); + else { + if (warn) + QMessageBox::warning(this, tr("Import..."), tr("Failed to import the Snapmatic picture, can't copy the file into profile")); return false; } } @@ -1249,50 +1158,45 @@ bool ProfileInterface::importSavegameData(SavegameData *savegame, QString sgdPat bool foundFree = 0; int currentSgd = 0; - while (currentSgd < 15 && !foundFree) - { + while (currentSgd < 15 && !foundFree) { QString sgdNumber = QString::number(currentSgd); - if (sgdNumber.length() == 1) - { + if (sgdNumber.length() == 1) { sgdNumber.insert(0, "0"); } sgdFileName = "SGTA500" % sgdNumber; - if (!QFile::exists(profileFolder % "/" % sgdFileName)) - { + if (!QFile::exists(profileFolder % "/" % sgdFileName)) { foundFree = true; } currentSgd++; } - if (foundFree) - { - if (QFile::copy(sgdPath, profileFolder % "/" % sgdFileName)) - { + if (foundFree) { + if (QFile::copy(sgdPath, profileFolder % "/" % sgdFileName)) { savegame->setSavegameFileName(profileFolder % "/" % sgdFileName); savegameLoaded(savegame, profileFolder % "/" % sgdFileName, true); return true; } - else - { - if (warn) QMessageBox::warning(this, tr("Import..."), tr("Failed to import the Savegame, can't copy the file into profile")); + else { + if (warn) + QMessageBox::warning(this, tr("Import..."), tr("Failed to import the Savegame, can't copy the file into profile")); return false; } } - else - { - if (warn) QMessageBox::warning(this, tr("Import..."), tr("Failed to import the Savegame, no Savegame slot is left")); + else { + if (warn) + QMessageBox::warning(this, tr("Import..."), tr("Failed to import the Savegame, no Savegame slot is left")); return false; } } void ProfileInterface::profileWidgetSelected() { - if (selectedWidgts == 0) - { - for (ProfileWidget *widget : widgets.keys()) - { - widget->setSelectionMode(true); + if (selectedWidgts == 0) { + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) + widget->setSelectionMode(true); } } selectedWidgts++; @@ -1300,13 +1204,11 @@ void ProfileInterface::profileWidgetSelected() void ProfileInterface::profileWidgetDeselected() { - if (selectedWidgts == 1) - { + if (selectedWidgts == 1) { int scrollBarValue = ui->saProfile->verticalScrollBar()->value(); - for (ProfileWidget *widget : widgets.keys()) - { - if (contentMode != 2) - { + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr && contentMode != 2) { widget->setSelectionMode(false); } } @@ -1317,24 +1219,25 @@ void ProfileInterface::profileWidgetDeselected() void ProfileInterface::selectAllWidgets() { - for (ProfileWidget *widget : widgets.keys()) - { - widget->setSelected(true); + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) + widget->setSelected(true); } } void ProfileInterface::deselectAllWidgets() { - for (ProfileWidget *widget : widgets.keys()) - { - widget->setSelected(false); + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) + widget->setSelected(false); } } void ProfileInterface::exportSelected() { - if (selectedWidgts != 0) - { + if (selectedWidgts != 0) { int exportCount = 0; int exportPictures = 0; int exportSavegames = 0; @@ -1346,26 +1249,23 @@ void ProfileInterface::exportSelected() //bool dontUseNativeDialog = settings.value("DontUseNativeDialog", false).toBool(); settings.beginGroup("ExportDirectory"); QString exportDirectory = QFileDialog::getExistingDirectory(this, tr("Export selected..."), settings.value(profileName, profileFolder).toString()); - if (exportDirectory != "") - { + if (exportDirectory != "") { settings.setValue(profileName, exportDirectory); - for (ProfileWidget *widget : widgets.keys()) - { - if (widget->isSelected()) - { - if (widget->getWidgetType() == "SnapmaticWidget") - { - exportPictures++; - } - else if (widget->getWidgetType() == "SavegameWidget") - { - exportSavegames++; + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + if (widget->isSelected()) { + if (widget->getWidgetType() == "SnapmaticWidget") { + exportPictures++; + } + else if (widget->getWidgetType() == "SavegameWidget") { + exportSavegames++; + } } } } - if (exportPictures != 0) - { + if (exportPictures != 0) { QInputDialog inputDialog; QStringList inputDialogItems; inputDialogItems << tr("JPG pictures and GTA Snapmatic"); @@ -1384,29 +1284,23 @@ void ProfileInterface::exportSelected() bool itemSelected = false; QString selectedItem = inputDialog.getItem(this, tr("Export selected..."), tr("%1Export Snapmatic pictures%2

JPG pictures make it possible to open the picture with a Image Viewer
GTA Snapmatic make it possible to import the picture into the game

Export as:").arg(ExportPreSpan, ExportPostSpan), inputDialogItems, 0, false, &itemSelected, inputDialog.windowFlags()^Qt::WindowContextHelpButtonHint); - if (itemSelected) - { - if (selectedItem == tr("JPG pictures and GTA Snapmatic")) - { + if (itemSelected) { + if (selectedItem == tr("JPG pictures and GTA Snapmatic")) { pictureExportEnabled = true; pictureCopyEnabled = true; } - else if (selectedItem == tr("JPG pictures only")) - { + else if (selectedItem == tr("JPG pictures only")) { pictureExportEnabled = true; } - else if (selectedItem == tr("GTA Snapmatic only")) - { + else if (selectedItem == tr("GTA Snapmatic only")) { pictureCopyEnabled = true; } - else - { + else { pictureExportEnabled = true; pictureCopyEnabled = true; } } - else - { + else { // Don't export anymore when any Cancel button got clicked settings.endGroup(); settings.endGroup(); @@ -1416,13 +1310,11 @@ void ProfileInterface::exportSelected() // Counting the exports together exportCount = exportCount + exportSavegames; - if (pictureExportEnabled && pictureCopyEnabled) - { + if (pictureExportEnabled && pictureCopyEnabled) { int exportPictures2 = exportPictures * 2; exportCount = exportCount + exportPictures2; } - else - { + else { exportCount = exportCount + exportPictures; } @@ -1456,22 +1348,18 @@ void ProfileInterface::exportSelected() errorList << getFailedCopyPictures; errorList << getFailedSavegames; - for (QString curErrorStr : errorList) - { + for (const QString &curErrorStr : qAsConst(errorList)) { errorStr += ", " % curErrorStr; } - if (errorStr != "") - { + if (errorStr != "") { errorStr.remove(0, 2); QMessageBox::warning(this, tr("Export selected..."), tr("Export failed with...\n\n%1").arg(errorStr)); } - if (exportThread->isFinished()) - { + if (exportThread->isFinished()) { delete exportThread; } - else - { + else { QEventLoop threadFinishLoop; QObject::connect(exportThread, SIGNAL(finished()), &threadFinishLoop, SLOT(quit())); threadFinishLoop.exec(); @@ -1481,50 +1369,42 @@ void ProfileInterface::exportSelected() settings.endGroup(); settings.endGroup(); } - else - { + else { QMessageBox::information(this, tr("Export selected..."), tr("No Snapmatic pictures or Savegames files are selected")); } } void ProfileInterface::deleteSelectedL(bool isRemoteEmited) { - if (selectedWidgts != 0) - { - if (QMessageBox::Yes == QMessageBox::warning(this, tr("Remove selected"), tr("You really want remove the selected Snapmatic picutres and Savegame files?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No)) - { - for (ProfileWidget *widget : widgets.keys()) - { - if (widget->isSelected()) - { - if (widget->getWidgetType() == "SnapmaticWidget") - { - SnapmaticWidget *picWidget = qobject_cast(widget); - if (picWidget->getPicture()->deletePictureFile()) - { - pictureDeleted(picWidget, isRemoteEmited); + if (selectedWidgts != 0) { + if (QMessageBox::Yes == QMessageBox::warning(this, tr("Remove selected"), tr("You really want remove the selected Snapmatic picutres and Savegame files?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No)) { + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + if (widget->isSelected()) { + if (widget->getWidgetType() == "SnapmaticWidget") { + SnapmaticWidget *picWidget = qobject_cast(widget); + if (picWidget->getPicture()->deletePictureFile()) { + pictureDeleted(picWidget, isRemoteEmited); + } } - } - else if (widget->getWidgetType() == "SavegameWidget") - { - SavegameWidget *sgdWidget = qobject_cast(widget); - SavegameData *savegame = sgdWidget->getSavegame(); - QString fileName = savegame->getSavegameFileName(); - if (!QFile::exists(fileName) || QFile::remove(fileName)) - { - savegameDeleted(sgdWidget, isRemoteEmited); + else if (widget->getWidgetType() == "SavegameWidget") { + SavegameWidget *sgdWidget = qobject_cast(widget); + SavegameData *savegame = sgdWidget->getSavegame(); + QString fileName = savegame->getSavegameFileName(); + if (!QFile::exists(fileName) || QFile::remove(fileName)) { + savegameDeleted(sgdWidget, isRemoteEmited); + } } } } } - if (selectedWidgts != 0) - { + if (selectedWidgts != 0) { QMessageBox::warning(this, tr("Remove selected"), tr("Failed to remove all selected Snapmatic pictures and/or Savegame files")); } } } - else - { + else { QMessageBox::information(this, tr("Remove selected"), tr("No Snapmatic pictures or Savegames files are selected")); } } @@ -1566,39 +1446,41 @@ void ProfileInterface::importFiles() void ProfileInterface::settingsApplied(int _contentMode, bool languageChanged) { - if (languageChanged) retranslateUi(); + if (languageChanged) + retranslateUi(); contentMode = _contentMode; - if (contentMode == 2) - { - for (ProfileWidget *widget : widgets.keys()) - { - widget->setSelectionMode(true); - widget->setContentMode(contentMode); - if (languageChanged) widget->retranslate(); + if (contentMode == 2) { + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + widget->setSelectionMode(true); + widget->setContentMode(contentMode); + if (languageChanged) + widget->retranslate(); + } } } - else - { - for (ProfileWidget *widget : widgets.keys()) - { - if (selectedWidgts == 0) - { - widget->setSelectionMode(false); + else { + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + if (selectedWidgts == 0) { + widget->setSelectionMode(false); + } + widget->setContentMode(contentMode); + if (languageChanged) + widget->retranslate(); } - widget->setContentMode(contentMode); - if (languageChanged) widget->retranslate(); } } #ifdef Q_OS_MAC // DPI calculation qreal screenRatio = AppEnv::screenRatio(); - if (QApplication::style()->objectName() == "macintosh") - { + if (QApplication::style()->objectName() == "macintosh") { ui->hlButtons->setSpacing(6 * screenRatio); ui->hlButtons->setContentsMargins(9 * screenRatio, 15 * screenRatio, 15 * screenRatio, 17 * screenRatio); } - else - { + else { ui->hlButtons->setSpacing(6 * screenRatio); ui->hlButtons->setContentsMargins(9 * screenRatio, 9 * screenRatio, 9 * screenRatio, 9 * screenRatio); } @@ -1608,33 +1490,29 @@ void ProfileInterface::settingsApplied(int _contentMode, bool languageChanged) void ProfileInterface::enableSelected() { QList snapmaticWidgets; - for (ProfileWidget *widget : widgets.keys()) - { - if (widget->isSelected()) - { - if (widget->getWidgetType() == "SnapmaticWidget") - { - SnapmaticWidget *snapmaticWidget = qobject_cast(widget); - snapmaticWidgets += snapmaticWidget; + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + if (widget->isSelected()) { + if (widget->getWidgetType() == "SnapmaticWidget") { + SnapmaticWidget *snapmaticWidget = qobject_cast(widget); + snapmaticWidgets += snapmaticWidget; + } } } } - if (snapmaticWidgets.isEmpty()) - { + if (snapmaticWidgets.isEmpty()) { QMessageBox::information(this, QApplication::translate("UserInterface", "Show In-game"), QApplication::translate("ProfileInterface", "No Snapmatic pictures are selected")); return; } QStringList fails; - for (SnapmaticWidget *widget : snapmaticWidgets) - { + for (SnapmaticWidget *widget : qAsConst(snapmaticWidgets)) { SnapmaticPicture *picture = widget->getPicture(); - if (!widget->makePictureVisible()) - { + if (!widget->makePictureVisible()) { fails << QString("%1 [%2]").arg(picture->getPictureTitle(), picture->getPictureString()); } } - if (!fails.isEmpty()) - { + if (!fails.isEmpty()) { QMessageBox::warning(this, QApplication::translate("UserInterface", "Show In-game"), QApplication::translate("ProfileInterface", "%1 failed with...\n\n%2", "Action failed with...").arg(QApplication::translate("UserInterface", "Show In-game"), fails.join(", "))); } } @@ -1642,33 +1520,29 @@ void ProfileInterface::enableSelected() void ProfileInterface::disableSelected() { QList snapmaticWidgets; - for (ProfileWidget *widget : widgets.keys()) - { - if (widget->isSelected()) - { - if (widget->getWidgetType() == "SnapmaticWidget") - { - SnapmaticWidget *snapmaticWidget = qobject_cast(widget); - snapmaticWidgets += snapmaticWidget; + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + if (widget->isSelected()) { + if (widget->getWidgetType() == "SnapmaticWidget") { + SnapmaticWidget *snapmaticWidget = qobject_cast(widget); + snapmaticWidgets += snapmaticWidget; + } } } } - if (snapmaticWidgets.isEmpty()) - { + if (snapmaticWidgets.isEmpty()) { QMessageBox::information(this, QApplication::translate("UserInterface", "Hide In-game"), QApplication::translate("ProfileInterface", "No Snapmatic pictures are selected")); return; } QStringList fails; - for (SnapmaticWidget *widget : snapmaticWidgets) - { + for (SnapmaticWidget *widget : qAsConst(snapmaticWidgets)) { SnapmaticPicture *picture = widget->getPicture(); - if (!widget->makePictureHidden()) - { + if (!widget->makePictureHidden()) { fails << QString("%1 [%2]").arg(picture->getPictureTitle(), picture->getPictureString()); } } - if (!fails.isEmpty()) - { + if (!fails.isEmpty()) { QMessageBox::warning(this, QApplication::translate("UserInterface", "Hide In-game"), QApplication::translate("ProfileInterface", "%1 failed with...\n\n%2", "Action failed with...").arg(QApplication::translate("UserInterface", "Hide In-game"), fails.join(", "))); } } @@ -1740,8 +1614,9 @@ void ProfileInterface::contextMenuTriggeredPIC(QContextMenuEvent *ev) contextMenu.addAction(SavegameWidget::tr("&Export"), this, SLOT(exportSelected()), QKeySequence::fromString("Ctrl+E")); contextMenu.addAction(SavegameWidget::tr("&Remove"), this, SLOT(deleteSelectedR()), QKeySequence::fromString("Ctrl+Del")); contextMenu.addSeparator(); - if (!picWidget->isSelected()) + if (!picWidget->isSelected()) { contextMenu.addAction(SnapmaticWidget::tr("&Select"), picWidget, SLOT(pictureSelected())); + } else { contextMenu.addAction(SnapmaticWidget::tr("&Deselect"), picWidget, SLOT(pictureSelected())); } @@ -1825,14 +1700,13 @@ void ProfileInterface::contextMenuTriggeredSGD(QContextMenuEvent *ev) void ProfileInterface::on_saProfileContent_dropped(const QMimeData *mimeData) { - if (!mimeData) return; - if (mimeData->hasImage()) - { + if (!mimeData) + return; + if (mimeData->hasImage()) { QImage *snapmaticImage = new QImage(qvariant_cast(mimeData->imageData())); importImage(snapmaticImage, QDateTime::currentDateTime()); } - else if (mimeData->hasUrls()) - { + else if (mimeData->hasUrls()) { importUrls(mimeData); } } @@ -1843,7 +1717,8 @@ void ProfileInterface::retranslateUi() QString appVersion = GTA5SYNC_APPVER; #ifndef GTA5SYNC_BUILDTYPE_REL #ifdef GTA5SYNC_COMMIT - if (!appVersion.contains("-")) { appVersion = appVersion % "-" % GTA5SYNC_COMMIT; } + if (!appVersion.contains("-")) + appVersion = appVersion % "-" % GTA5SYNC_COMMIT; #endif #endif ui->labVersion->setText(QString("%1 %2").arg(GTA5SYNC_APPSTR, appVersion)); @@ -1851,52 +1726,38 @@ void ProfileInterface::retranslateUi() bool ProfileInterface::eventFilter(QObject *watched, QEvent *event) { - if (event->type() == QEvent::KeyPress) - { - if (isProfileLoaded) - { + if (event->type() == QEvent::KeyPress) { + if (isProfileLoaded) { QKeyEvent *keyEvent = dynamic_cast(event); - switch (keyEvent->key()) - { + switch (keyEvent->key()) { case Qt::Key_V: - if (QApplication::keyboardModifiers().testFlag(Qt::ControlModifier) && !QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier)) - { + if (QApplication::keyboardModifiers().testFlag(Qt::ControlModifier) && !QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier)) { const QMimeData *clipboardData = QApplication::clipboard()->mimeData(); - if (clipboardData->hasImage()) - { + if (clipboardData->hasImage()) { QImage *snapmaticImage = new QImage(qvariant_cast(clipboardData->imageData())); importImage(snapmaticImage, QDateTime::currentDateTime()); } - else if (clipboardData->hasUrls()) - { - if (clipboardData->urls().length() >= 2) - { + else if (clipboardData->hasUrls()) { + if (clipboardData->urls().length() >= 2) { importUrls(clipboardData); } - else if (clipboardData->urls().length() == 1) - { + else if (clipboardData->urls().length() == 1) { QUrl clipboardUrl = clipboardData->urls().at(0); - if (clipboardUrl.isLocalFile()) - { + if (clipboardUrl.isLocalFile()) { importFile(clipboardUrl.toLocalFile(), QDateTime::currentDateTime(), true); } - else - { + else { importRemote(clipboardUrl); } } } - else if (clipboardData->hasText()) - { + else if (clipboardData->hasText()) { QUrl clipboardUrl = QUrl::fromUserInput(clipboardData->text()); - if (clipboardUrl.isValid()) - { - if (clipboardUrl.isLocalFile()) - { + if (clipboardUrl.isValid()) { + if (clipboardUrl.isLocalFile()) { importFile(clipboardUrl.toLocalFile(), QDateTime::currentDateTime(), true); } - else - { + else { importRemote(clipboardUrl); } } @@ -1905,34 +1766,25 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event) } } } - else if (event->type() == QEvent::MouseMove) - { - if ((watched->objectName() == "SavegameWidget" || watched->objectName() == "SnapmaticWidget") && isProfileLoaded) - { + else if (event->type() == QEvent::MouseMove) { + if ((watched->objectName() == "SavegameWidget" || watched->objectName() == "SnapmaticWidget") && isProfileLoaded) { ProfileWidget *pWidget = qobject_cast(watched); - if (pWidget->underMouse()) - { + if (pWidget->underMouse()) { bool styleSheetChanged = false; - if (pWidget->getWidgetType() == "SnapmaticWidget") - { - if (pWidget != previousWidget) - { + if (pWidget->getWidgetType() == "SnapmaticWidget") { + if (pWidget != previousWidget) { pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } - else if (pWidget->getWidgetType() == "SavegameWidget") - { - if (pWidget != previousWidget) - { + else if (pWidget->getWidgetType() == "SavegameWidget") { + if (pWidget != previousWidget) { pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } - if (styleSheetChanged) - { - if (previousWidget != nullptr) - { + if (styleSheetChanged) { + if (previousWidget != nullptr) { previousWidget->setStyleSheet(QLatin1String("")); } previousWidget = pWidget; @@ -1941,47 +1793,33 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event) return true; } } - else if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease) - { - if ((watched->objectName() == "SavegameWidget" || watched->objectName() == "SnapmaticWidget") && isProfileLoaded) - { + else if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease) { + if ((watched->objectName() == "SavegameWidget" || watched->objectName() == "SnapmaticWidget") && isProfileLoaded) { ProfileWidget *pWidget = nullptr; - QMap::const_iterator it = widgets.constBegin(); - QMap::const_iterator end = widgets.constEnd(); - while (it != end) - { + for (auto it = widgets.constBegin(); it != widgets.constEnd(); it++) { ProfileWidget *widget = it.key(); QPoint mousePos = widget->mapFromGlobal(QCursor::pos()); - if (widget->rect().contains(mousePos)) - { + if (widget->rect().contains(mousePos)) { pWidget = widget; break; } - it++; } - if (pWidget != nullptr) - { + if (pWidget != nullptr) { bool styleSheetChanged = false; - if (pWidget->getWidgetType() == "SnapmaticWidget") - { - if (pWidget != previousWidget) - { + if (pWidget->getWidgetType() == "SnapmaticWidget") { + if (pWidget != previousWidget) { pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } - else if (pWidget->getWidgetType() == "SavegameWidget") - { - if (pWidget != previousWidget) - { + else if (pWidget->getWidgetType() == "SavegameWidget") { + if (pWidget != previousWidget) { pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } - if (styleSheetChanged) - { - if (previousWidget != nullptr) - { + if (styleSheetChanged) { + if (previousWidget != nullptr) { previousWidget->setStyleSheet(QLatin1String("")); } previousWidget = pWidget; @@ -1989,33 +1827,25 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event) } } } - else if (event->type() == QEvent::WindowDeactivate && isProfileLoaded) - { - if (previousWidget != nullptr && watched == previousWidget) - { + else if (event->type() == QEvent::WindowDeactivate && isProfileLoaded) { + if (previousWidget != nullptr && watched == previousWidget) { previousWidget->setStyleSheet(QLatin1String("")); previousWidget = nullptr; } } - else if (event->type() == QEvent::Leave && isProfileLoaded && !contextMenuOpened) - { - if (watched->objectName() == "SavegameWidget" || watched->objectName() == "SnapmaticWidget") - { + else if (event->type() == QEvent::Leave && isProfileLoaded && !contextMenuOpened) { + if (watched->objectName() == "SavegameWidget" || watched->objectName() == "SnapmaticWidget") { ProfileWidget *pWidget = qobject_cast(watched); QPoint mousePos = pWidget->mapFromGlobal(QCursor::pos()); - if (!pWidget->geometry().contains(mousePos)) - { - if (previousWidget != nullptr) - { + if (!pWidget->geometry().contains(mousePos)) { + if (previousWidget != nullptr) { previousWidget->setStyleSheet(QLatin1String("")); previousWidget = nullptr; } } } - else if (watched->objectName() == "ProfileInterface") - { - if (previousWidget != nullptr) - { + else if (watched->objectName() == "ProfileInterface") { + if (previousWidget != nullptr) { previousWidget->setStyleSheet(QLatin1String("")); previousWidget = nullptr; } @@ -2027,50 +1857,36 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event) void ProfileInterface::hoverProfileWidgetCheck() { ProfileWidget *pWidget = nullptr; - QMap::const_iterator it = widgets.constBegin(); - QMap::const_iterator end = widgets.constEnd(); - while (it != end) - { + for (auto it = widgets.constBegin(); it != widgets.constEnd(); it++) { ProfileWidget *widget = it.key(); - if (widget->underMouse()) - { + if (widget->underMouse()) { pWidget = widget; break; } - it++; } - if (pWidget != nullptr) - { + if (pWidget != nullptr) { bool styleSheetChanged = false; - if (pWidget->getWidgetType() == "SnapmaticWidget") - { - if (pWidget != previousWidget) - { + if (pWidget->getWidgetType() == "SnapmaticWidget") { + if (pWidget != previousWidget) { pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } - else if (pWidget->getWidgetType() == "SavegameWidget") - { - if (pWidget != previousWidget) - { + else if (pWidget->getWidgetType() == "SavegameWidget") { + if (pWidget != previousWidget) { pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } - if (styleSheetChanged) - { - if (previousWidget != nullptr) - { + if (styleSheetChanged) { + if (previousWidget != nullptr) { previousWidget->setStyleSheet(QLatin1String("")); } previousWidget = pWidget; } } - else - { - if (previousWidget != nullptr) - { + else { + if (previousWidget != nullptr) { previousWidget->setStyleSheet(QLatin1String("")); previousWidget = nullptr; } @@ -2080,14 +1896,11 @@ void ProfileInterface::hoverProfileWidgetCheck() void ProfileInterface::updatePalette() { ui->saProfile->setStyleSheet(QString("QWidget#saProfileContent{background-color:palette(base)}")); - if (previousWidget != nullptr) - { - if (previousWidget->getWidgetType() == "SnapmaticWidget") - { + if (previousWidget != nullptr) { + if (previousWidget->getWidgetType() == "SnapmaticWidget") { previousWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); } - else if (previousWidget->getWidgetType() == "SavegameWidget") - { + else if (previousWidget->getWidgetType() == "SavegameWidget") { previousWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); } } @@ -2095,11 +1908,9 @@ void ProfileInterface::updatePalette() bool ProfileInterface::isSupportedImageFile(QString selectedFileName) { - for (QByteArray imageFormat : QImageReader::supportedImageFormats()) - { + for (const QByteArray &imageFormat : QImageReader::supportedImageFormats()) { QString imageFormatStr = QString(".") % QString::fromUtf8(imageFormat).toLower(); - if (selectedFileName.length() >= imageFormatStr.length() && selectedFileName.toLower().right(imageFormatStr.length()) == imageFormatStr) - { + if (selectedFileName.length() >= imageFormatStr.length() && selectedFileName.toLower().right(imageFormatStr.length()) == imageFormatStr) { return true; } } @@ -2108,25 +1919,22 @@ bool ProfileInterface::isSupportedImageFile(QString selectedFileName) void ProfileInterface::massTool(MassTool tool) { - switch(tool) - { - case MassTool::Qualify: - { + switch(tool) { + case MassTool::Qualify: { QList snapmaticWidgets; - for (ProfileWidget *widget : widgets.keys()) - { - if (widget->isSelected()) - { - if (widget->getWidgetType() == "SnapmaticWidget") - { - SnapmaticWidget *snapmaticWidget = qobject_cast(widget); - snapmaticWidgets += snapmaticWidget; + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + if (widget->isSelected()) { + if (widget->getWidgetType() == "SnapmaticWidget") { + SnapmaticWidget *snapmaticWidget = qobject_cast(widget); + snapmaticWidgets += snapmaticWidget; + } } } } - if (snapmaticWidgets.isEmpty()) - { + if (snapmaticWidgets.isEmpty()) { QMessageBox::information(this, tr("Qualify as Avatar"), tr("No Snapmatic pictures are selected")); return; } @@ -2153,8 +1961,7 @@ void ProfileInterface::massTool(MassTool tool) // Begin Progress QStringList fails; - for (SnapmaticWidget *snapmaticWidget : snapmaticWidgets) - { + for (SnapmaticWidget *snapmaticWidget : qAsConst(snapmaticWidgets)) { // Update Progress overallId++; pbDialog.setValue(overallId); @@ -2172,54 +1979,47 @@ void ProfileInterface::massTool(MassTool tool) 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(snapmaticProperties); - if (!picture->exportPicture(currentFilePath)) - { + if (!picture->exportPicture(currentFilePath)) { picture->setSnapmaticProperties(fallbackProperties); fails << QString("%1 [%2]").arg(picture->getPictureTitle(), picture->getPictureString()); } - else - { + else { picture->emitUpdate(); QApplication::processEvents(); } } pbDialog.close(); - if (!fails.isEmpty()) - { + if (!fails.isEmpty()) { QMessageBox::warning(this, tr("Qualify as Avatar"), tr("%1 failed with...\n\n%2", "Action failed with...").arg(tr("Qualify", "%1 failed with..."), fails.join(", "))); } } break; - case MassTool::Players: - { + case MassTool::Players: { QList snapmaticWidgets; - for (ProfileWidget *widget : widgets.keys()) - { - if (widget->isSelected()) - { - if (widget->getWidgetType() == "SnapmaticWidget") - { - SnapmaticWidget *snapmaticWidget = qobject_cast(widget); - snapmaticWidgets += snapmaticWidget; + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + if (widget->isSelected()) { + if (widget->getWidgetType() == "SnapmaticWidget") { + SnapmaticWidget *snapmaticWidget = qobject_cast(widget); + snapmaticWidgets += snapmaticWidget; + } } } } - if (snapmaticWidgets.isEmpty()) - { + if (snapmaticWidgets.isEmpty()) { QMessageBox::information(this, tr("Change Players..."), tr("No Snapmatic pictures are selected")); return; } QStringList players; - if (snapmaticWidgets.length() == 1) - { + if (snapmaticWidgets.length() == 1) { players = snapmaticWidgets.at(0)->getPicture()->getSnapmaticProperties().playersList; } @@ -2228,9 +2028,7 @@ void ProfileInterface::massTool(MassTool tool) playerListDialog->show(); playerListDialog->exec(); if (!playerListDialog->isListUpdated()) - { return; - } players = playerListDialog->getPlayerList(); delete playerListDialog; @@ -2256,8 +2054,7 @@ void ProfileInterface::massTool(MassTool tool) // Begin Progress QStringList fails; - for (SnapmaticWidget *snapmaticWidget : snapmaticWidgets) - { + for (SnapmaticWidget *snapmaticWidget : qAsConst(snapmaticWidgets)) { // Update Progress overallId++; pbDialog.setValue(overallId); @@ -2271,54 +2068,47 @@ void ProfileInterface::massTool(MassTool tool) 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(snapmaticProperties); - if (!picture->exportPicture(currentFilePath)) - { + if (!picture->exportPicture(currentFilePath)) { picture->setSnapmaticProperties(fallbackProperties); fails << QString("%1 [%2]").arg(picture->getPictureTitle(), picture->getPictureString()); } - else - { + else { picture->emitUpdate(); QApplication::processEvents(); } } pbDialog.close(); - if (!fails.isEmpty()) - { + if (!fails.isEmpty()) { QMessageBox::warning(this, tr("Change Players..."), tr("%1 failed with...\n\n%2", "Action failed with...").arg(tr("Change Players", "%1 failed with..."), fails.join(", "))); } } break; - case MassTool::Crew: - { + case MassTool::Crew: { QList snapmaticWidgets; - for (ProfileWidget *widget : widgets.keys()) - { - if (widget->isSelected()) - { - if (widget->getWidgetType() == "SnapmaticWidget") - { - SnapmaticWidget *snapmaticWidget = qobject_cast(widget); - snapmaticWidgets += snapmaticWidget; + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + if (widget->isSelected()) { + if (widget->getWidgetType() == "SnapmaticWidget") { + SnapmaticWidget *snapmaticWidget = qobject_cast(widget); + snapmaticWidgets += snapmaticWidget; + } } } } - if (snapmaticWidgets.isEmpty()) - { + if (snapmaticWidgets.isEmpty()) { QMessageBox::information(this, tr("Change Crew..."), tr("No Snapmatic pictures are selected")); return; } int crewID = 0; - if (snapmaticWidgets.length() == 1) - { + if (snapmaticWidgets.length() == 1) { crewID = snapmaticWidgets.at(0)->getPicture()->getSnapmaticProperties().crewID; } { @@ -2327,40 +2117,32 @@ preSelectionCrewID: int indexNum = 0; QStringList itemList; QStringList crewList = crewDB->getCrews(); - if (!crewList.contains(QLatin1String("0"))) - { + if (!crewList.contains(QLatin1String("0"))) { crewList += QLatin1String("0"); } crewList.sort(); - for (QString crew : crewList) - { + for (QString crew : crewList) { itemList += QString("%1 (%2)").arg(crew, crewDB->getCrewName(crew.toInt())); } - if (crewList.contains(QString::number(crewID))) - { + if (crewList.contains(QString::number(crewID))) { indexNum = crewList.indexOf(QString::number(crewID)); } QString newCrew = QInputDialog::getItem(this, QApplication::translate("SnapmaticEditor", "Snapmatic Crew"), QApplication::translate("SnapmaticEditor", "New Snapmatic crew:"), itemList, indexNum, true, &ok, windowFlags()^Qt::Dialog^Qt::WindowMinMaxButtonsHint); - if (ok && !newCrew.isEmpty()) - { + if (ok && !newCrew.isEmpty()) { if (newCrew.contains(" ")) newCrew = newCrew.split(" ").at(0); if (newCrew.length() > 10) return; - for (QChar crewChar : newCrew) - { - if (!crewChar.isNumber()) - { + for (const QChar &crewChar : newCrew) { + if (!crewChar.isNumber()) { QMessageBox::warning(this, tr("Change Crew..."), tr("Failed to enter a valid Snapmatic Crew ID")); goto preSelectionCrewID; } } - if (!crewList.contains(newCrew)) - { + if (!crewList.contains(newCrew)) { crewDB->addCrew(crewID); } crewID = newCrew.toInt(); } - else - { + else { return; } } @@ -2387,8 +2169,7 @@ preSelectionCrewID: // Begin Progress QStringList fails; - for (SnapmaticWidget *snapmaticWidget : snapmaticWidgets) - { + for (SnapmaticWidget *snapmaticWidget : qAsConst(snapmaticWidgets)) { // Update Progress overallId++; pbDialog.setValue(overallId); @@ -2402,71 +2183,61 @@ preSelectionCrewID: 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(snapmaticProperties); - if (!picture->exportPicture(currentFilePath)) - { + if (!picture->exportPicture(currentFilePath)) { picture->setSnapmaticProperties(fallbackProperties); fails << QString("%1 [%2]").arg(picture->getPictureTitle(), picture->getPictureString()); } - else - { + else { picture->emitUpdate(); QApplication::processEvents(); } } pbDialog.close(); - if (!fails.isEmpty()) - { + if (!fails.isEmpty()) { QMessageBox::warning(this, tr("Change Crew..."), tr("%1 failed with...\n\n%2", "Action failed with...").arg(tr("Change Crew", "%1 failed with..."), fails.join(", "))); } } break; - case MassTool::Title: - { + case MassTool::Title: { QList snapmaticWidgets; - for (ProfileWidget *widget : widgets.keys()) - { - if (widget->isSelected()) - { - if (widget->getWidgetType() == "SnapmaticWidget") - { - SnapmaticWidget *snapmaticWidget = qobject_cast(widget); - snapmaticWidgets += snapmaticWidget; + for (const QString &widgetStr : qAsConst(widgets)) { + ProfileWidget *widget = widgets.key(widgetStr, nullptr); + if (widget != nullptr) { + if (widget->isSelected()) { + if (widget->getWidgetType() == "SnapmaticWidget") { + SnapmaticWidget *snapmaticWidget = qobject_cast(widget); + snapmaticWidgets += snapmaticWidget; + } } } } - if (snapmaticWidgets.isEmpty()) - { + if (snapmaticWidgets.isEmpty()) { QMessageBox::information(this, tr("Change Title..."), tr("No Snapmatic pictures are selected")); return; } QString snapmaticTitle; - if (snapmaticWidgets.length() == 1) - { + if (snapmaticWidgets.length() == 1) { snapmaticTitle = snapmaticWidgets.at(0)->getPicture()->getPictureTitle(); } { preSelectionTitle: bool ok; QString newTitle = QInputDialog::getText(this, QApplication::translate("SnapmaticEditor", "Snapmatic Title"), QApplication::translate("SnapmaticEditor", "New Snapmatic title:"), QLineEdit::Normal, snapmaticTitle, &ok, windowFlags()^Qt::Dialog^Qt::WindowMinMaxButtonsHint); - if (ok && !newTitle.isEmpty()) - { - if (!SnapmaticPicture::verifyTitle(newTitle)) - { + if (ok && !newTitle.isEmpty()) { + if (!SnapmaticPicture::verifyTitle(newTitle)) { QMessageBox::warning(this, tr("Change Title..."), tr("Failed to enter a valid Snapmatic title")); goto preSelectionTitle; } snapmaticTitle = newTitle; } - else - { + else { return; } } @@ -2493,8 +2264,7 @@ preSelectionTitle: // Begin Progress QStringList fails; - for (SnapmaticWidget *snapmaticWidget : snapmaticWidgets) - { + for (SnapmaticWidget *snapmaticWidget : qAsConst(snapmaticWidgets)) { // Update Progress overallId++; pbDialog.setValue(overallId); @@ -2505,26 +2275,22 @@ preSelectionTitle: QString currentFilePath = picture->getPictureFilePath(); QString originalFilePath = picture->getOriginalPictureFilePath(); QString backupFileName = originalFilePath % ".bak"; - if (!QFile::exists(backupFileName)) - { + if (!QFile::exists(backupFileName)) { QFile::copy(currentFilePath, backupFileName); } QString fallbackTitle = picture->getPictureTitle(); picture->setPictureTitle(snapmaticTitle); - if (!picture->exportPicture(currentFilePath)) - { + if (!picture->exportPicture(currentFilePath)) { picture->setPictureTitle(fallbackTitle); fails << QString("%1 [%2]").arg(picture->getPictureTitle(), picture->getPictureString()); } - else - { + else { picture->emitUpdate(); QApplication::processEvents(); } } pbDialog.close(); - if (!fails.isEmpty()) - { + if (!fails.isEmpty()) { QMessageBox::warning(this, tr("Change Title..."), tr("%1 failed with...\n\n%2", "Action failed with...").arg(tr("Change Title", "%1 failed with..."), fails.join(", "))); } } diff --git a/RagePhoto.cpp b/RagePhoto.cpp index b4e5ff8..5e2113a 100644 --- a/RagePhoto.cpp +++ b/RagePhoto.cpp @@ -182,11 +182,12 @@ bool RagePhoto::load() free(jsonBytes); return false; } - for (quint32 i = 0; i != p_jsonBuffer; i++) { + quint32 i; + for (i = 0; i != p_jsonBuffer; i++) { if (jsonBytes[i] == '\x00') break; - p_jsonData += jsonBytes[i]; } + p_jsonData = QByteArray(jsonBytes, i); free(jsonBytes); QJsonDocument t_jsonDocument = QJsonDocument::fromJson(p_jsonData); if (t_jsonDocument.isNull()) @@ -213,7 +214,6 @@ bool RagePhoto::load() free(titlBytes); return false; } - quint32 i; for (i = 0; i != p_titlBuffer; i++) { if (titlBytes[i] == '\x00') break; diff --git a/res/gta5sync.ts b/res/gta5sync.ts index 7202ed1..9381503 100644 --- a/res/gta5sync.ts +++ b/res/gta5sync.ts @@ -373,7 +373,7 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! @@ -381,7 +381,7 @@ Pictures and Savegames - + Custom Picture Custom Picture Description in SC, don't use Special Character! @@ -1020,37 +1020,37 @@ Y: %2 - + Export as &Picture... - + Export as &Snapmatic... - + &Edit Properties... - + &Overwrite Image... - + Open &Map Viewer... - + Open &JSON Editor... @@ -1300,23 +1300,23 @@ Press 1 for Default View - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + Import... @@ -1333,14 +1333,14 @@ Press 1 for Default View - + All image files (%1) - + All files (**) @@ -1348,211 +1348,211 @@ Press 1 for Default View - + Can't import %1 because file can't be open - + Can't import %1 because file can't be parsed properly - + Enabled pictures: %1 of %2 - + Loading... - + Snapmatic Loader - + <h4>Following Snapmatic Pictures got repaired</h4>%1 - + Importable files (%1) - + GTA V Export (*.g5e) - + Savegames files (SGTA*) - + Snapmatic pictures (PGTA*) - - + + No valid file is selected - - + + Import file %1 of %2 files - + Import failed with... %1 - + Failed to read Snapmatic picture - + Failed to read Savegame file - + Can't import %1 because file format can't be detected - + Prepare Content for Import... - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? - + Failed to import the Snapmatic picture, can't copy the file into profile - + Failed to import the Savegame, can't copy the file into profile - + Failed to import the Savegame, no Savegame slot is left - - - - - + + + + + Export selected... - - + + JPG pictures and GTA Snapmatic - - + + JPG pictures only - - + + GTA Snapmatic only - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: - + Initialising export... - + Export failed with... %1 - - + + No Snapmatic pictures or Savegames files are selected - - - + + + Remove selected - + You really want remove the selected Snapmatic picutres and Savegame files? - + Failed to remove all selected Snapmatic pictures and/or Savegame files - - - - - - + + + + + + No Snapmatic pictures are selected - - - + + + + + - - %1 failed with... %2 @@ -1560,81 +1560,81 @@ Press 1 for Default View - - + + Qualify as Avatar - - - - + + + + Patch selected... - - - - - - - - + + + + + + + + Patch file %1 of %2 files - + Qualify %1 failed with... - - + + Change Players... - + Change Players %1 failed with... - - - + + + Change Crew... - + Failed to enter a valid Snapmatic Crew ID - + Change Crew %1 failed with... - - - + + + Change Title... - + Failed to enter a valid Snapmatic title - + Change Title %1 failed with... @@ -1718,45 +1718,45 @@ Press 1 for Default View - + &View - - - + + + &Export - - - + + + &Remove - - + + &Select - - + + &Deselect - - + + Select &All - - + + &Deselect All @@ -1959,25 +1959,25 @@ Press 1 for Default View - + Snapmatic Crew - + New Snapmatic crew: - + Snapmatic Title - + New Snapmatic title: @@ -2152,62 +2152,62 @@ Press 1 for Default View - - - + + + Edi&t - - - + + + Show &In-game - - - + + + Hide &In-game - + &Export - + &View - + &Remove - - + + &Select - - + + &Deselect - - + + Select &All - - + + &Deselect All @@ -2409,42 +2409,42 @@ Press 1 for Default View - - + + Change &Title... - - + + Change &Crew... - - + + &Qualify as Avatar - - + + Change &Players... - - + + Show In-game - - + + Hide In-game diff --git a/res/gta5sync_de.ts b/res/gta5sync_de.ts index fe39b2d..5a6ab4c 100644 --- a/res/gta5sync_de.ts +++ b/res/gta5sync_de.ts @@ -397,7 +397,7 @@ Snapmatic Bilder und Spielständen - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! Eigener Avatar @@ -405,7 +405,7 @@ Snapmatic Bilder und Spielständen - + Custom Picture Custom Picture Description in SC, don't use Special Character! Eigenes Bild @@ -1061,31 +1061,31 @@ Y: %2 - + Export as &Picture... Als &Bild exportieren... - + Export as &Snapmatic... Als &Snapmatic exportieren... - + &Edit Properties... Eigenschaften bearb&eiten... - + &Overwrite Image... Bild &überschreiben... - + Open &Map Viewer... &Kartenansicht öffnen... @@ -1232,7 +1232,7 @@ Drücke 1 für Standardmodus - + Open &JSON Editor... &JSON Editor öffnen... @@ -1330,40 +1330,40 @@ Drücke 1 für Standardmodus S&chließen - + Loading... Lade... - + Snapmatic Loader Snapmatic Lader - + <h4>Following Snapmatic Pictures got repaired</h4>%1 <h4>Folgende Snapmatic Bilder wurden repariert</h4>%1 - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + Import... Importieren... @@ -1378,45 +1378,45 @@ Drücke 1 für Standardmodus Importieren - + Savegames files (SGTA*) Spielstanddateien (SGTA*) - + Snapmatic pictures (PGTA*) Snapmatic Bilder (PGTA*) - + 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 @@ -1425,13 +1425,13 @@ Drücke 1 für Standardmodus %1 - + Failed to read Snapmatic picture Fehler beim Lesen vom Snapmatic Bild - + Failed to read Savegame file Fehler beim Lesen von Spielstanddatei @@ -1439,135 +1439,135 @@ Drücke 1 für Standardmodus - + Can't import %1 because file can't be open Kann %1 nicht importieren weil die Datei nicht geöffnet werden kann - + Can't import %1 because file can't be parsed properly Kann %1 nicht importieren weil die Datei nicht richtig gelesen werden kann - + Can't import %1 because file format can't be detected Kann %1 nicht importieren weil das Dateiformat nicht erkannt werden kann - + Initialising export... Initialisiere Export... - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e Fehlgeschlagen beim Importieren vom Snapmatic Bild, Datei beginnt nicht mit PGTA oder endet mit .g5e - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1Exportiere Snapmatic Bilder%2<br><br>JPG Bilder machen es möglich sie mit ein Bildansicht Programm zu öffnen<br>Das GTA Snapmatic Format macht es möglich sie wieder ins Game zu importieren<br><br>Exportieren als: - - + + No valid file is selected Keine gültige Datei wurde ausgewählt - + Enabled pictures: %1 of %2 Aktivierte Bilder: %1 von %2 - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? Ein Snapmatic Bild mit der Uid %1 existiert bereits, möchtest du dein Import eine neue Uid und Zeitstempel zuweisen? - + Failed to import the Snapmatic picture, can't copy the file into profile Fehlgeschlagen beim Importieren vom Snapmatic Bild, kann Snapmatic Bild nicht ins Profil kopieren - + Failed to import the Savegame, can't copy the file into profile Fehlgeschlagen beim Importieren vom Spielstand, kann Spielstanddatei nicht ins Profil kopieren - + Failed to import the Savegame, no Savegame slot is left Fehlgeschlagen beim Importieren vom Spielstand, kein Spielstandslot mehr frei - - + + JPG pictures and GTA Snapmatic JPG Bilder und GTA Snapmatic - - + + JPG pictures only Nur JPG Bilder - - + + GTA Snapmatic only Nur GTA Snapmatic - - - - + + + + Patch selected... Auswahl patchen... - - - - - - - - + + + + + + + + Patch file %1 of %2 files Patche Datei %1 von %2 Dateien - - + + Qualify as Avatar Als Avatar qualifizieren - - - - - - + + + + + + No Snapmatic pictures are selected Keine Snapmatic Bilder sind ausgewählt - + Failed to remove all selected Snapmatic pictures and/or Savegame files Fehlgeschlagen beim Entfernen von allen augewählten Snapmatic Bildern und/oder Spielstanddateien - - - + + + + + - - %1 failed with... %2 @@ -1577,93 +1577,93 @@ Drücke 1 für Standardmodus %2 - + Prepare Content for Import... Bereite Inhalt für Import vor... - + Qualify %1 failed with... Qualifizieren - - + + Change Players... Spieler ändern... - + Change Players %1 failed with... Spieler ändern - - - + + + Change Crew... Crew ändern... - + Failed to enter a valid Snapmatic Crew ID Fehlgeschlagen beim Eingeben von einer gültigen Crew ID - + Change Crew %1 failed with... Crew ändern - - - + + + Change Title... Titel ändern... - + Failed to enter a valid Snapmatic title Fehlgeschlagen beim Eingeben eines gültigen Snapmatic Titel - + Change Title %1 failed with... Titel ändern - - + + No Snapmatic pictures or Savegames files are selected Keine Snapmatic Bilder oder Spielstände sind ausgewählt - - - + + + Remove selected Auswahl löschen - + You really want remove the selected Snapmatic picutres and Savegame files? Möchtest du wirklich die ausgewählten Snapmatic Bilder und Spielstanddateien löschen? - - - - - + + + + + Export selected... Auswahl exportieren... - + Export failed with... %1 @@ -1682,7 +1682,7 @@ Drücke 1 für Standardmodus Alle Profildateien (*.g5e SGTA* PGTA*) - + GTA V Export (*.g5e) GTA V Export (*.g5e) @@ -1806,38 +1806,38 @@ Drücke 1 für Standardmodus Fehlgeschlagen beim Löschen %1 von deinen Spielständen - + &View A&nsehen - - - + + + &Remove Entfe&rnen - - + + &Select Au&swählen - - + + &Deselect A&bwählen - - + + Select &All &Alles auswählen - - + + &Deselect All Alles a&bwählen @@ -1852,9 +1852,9 @@ Drücke 1 für Standardmodus Spielstand kopieren - - - + + + &Export &Exportieren @@ -1948,7 +1948,7 @@ Drücke 1 für Standardmodus Meme - + Snapmatic Title Snapmatic Titel @@ -2064,19 +2064,19 @@ Drücke 1 für Standardmodus 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: @@ -2204,62 +2204,62 @@ Drücke 1 für Standardmodus Fehlgeschlagen beim Anzeigen von %1 im Spiel von deinen Snapmatic Bildern - - - + + + Edi&t Bearbei&ten - + &Export &Exportieren - - - + + + Show &In-game &Im Spiel anzeigen - - - + + + Hide &In-game &Im Spiel ausblenden - + &View A&nsehen - + &Remove Entfe&rnen - - + + &Select Au&swählen - - + + &Deselect A&bwählen - - + + Select &All Alles &auswählen - - + + &Deselect All Alles a&bwählen @@ -2372,29 +2372,29 @@ Drücke 1 für Standardmodus - - + + Change &Title... &Titel ändern... - - + + &Qualify as Avatar Als Avatar &qualifizieren - - + + Change &Players... S&pieler ändern... - - + + Change &Crew... &Crew ändern... @@ -2539,15 +2539,15 @@ Drücke 1 für Standardmodus &Neuladen - - + + Show In-game Im Spiel anzeigen - - + + Hide In-game Im Spiel ausblenden diff --git a/res/gta5sync_en_US.ts b/res/gta5sync_en_US.ts index 0d59191..5979526 100644 --- a/res/gta5sync_en_US.ts +++ b/res/gta5sync_en_US.ts @@ -379,7 +379,7 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! @@ -387,7 +387,7 @@ Pictures and Savegames - + Custom Picture Custom Picture Description in SC, don't use Special Character! @@ -1020,31 +1020,31 @@ Y: %2 - + Export as &Picture... - + Export as &Snapmatic... - + &Overwrite Image... - + &Edit Properties... - + Open &Map Viewer... @@ -1194,7 +1194,7 @@ Press 1 for Default View - + Open &JSON Editor... @@ -1298,45 +1298,45 @@ Press 1 for Default View - + Enabled pictures: %1 of %2 - + Loading... - + Snapmatic Loader - + <h4>Following Snapmatic Pictures got repaired</h4>%1 - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + Import... @@ -1351,24 +1351,24 @@ Press 1 for Default View - + Importable files (%1) - + GTA V Export (*.g5e) - + Savegames files (SGTA*) - + Snapmatic pictures (PGTA*) @@ -1376,46 +1376,46 @@ Press 1 for Default View - + 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 @@ -1423,147 +1423,147 @@ Press 1 for Default View - + Can't import %1 because file can't be open - + Can't import %1 because file can't be parsed properly - + Can't import %1 because file format can't be detected - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e - + Failed to import the Snapmatic picture, can't copy the file into profile - + Failed to import the Savegame, can't copy the file into profile - + Failed to import the Savegame, no Savegame slot is left - - + + JPG pictures and GTA Snapmatic - - + + JPG pictures only - - + + GTA Snapmatic only - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: - - - - - + + + + + Export selected... - + Initialising export... Initializing export... - + Export failed with... %1 - - + + No Snapmatic pictures or Savegames files are selected - - - + + + Remove selected - + You really want remove the selected Snapmatic picutres and Savegame files? - - + + Qualify as Avatar - - - - - - + + + + + + No Snapmatic pictures are selected - - - - + + + + Patch selected... - - - - - - - - + + + + + + + + Patch file %1 of %2 files - - - + + + + + - - %1 failed with... %2 @@ -1571,70 +1571,70 @@ Press 1 for Default View - + Failed to remove all selected Snapmatic pictures and/or Savegame files - + Prepare Content for Import... - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? - + Qualify %1 failed with... - - + + Change Players... - + Change Players %1 failed with... - - - + + + Change Crew... - + Failed to enter a valid Snapmatic Crew ID - + Change Crew %1 failed with... - - - + + + Change Title... - + Failed to enter a valid Snapmatic title - + Change Title %1 failed with... @@ -1718,45 +1718,45 @@ Press 1 for Default View - + &View - - - + + + &Export - - - + + + &Remove - - + + &Select - - + + &Deselect - - + + Select &All - - + + &Deselect All @@ -2006,25 +2006,25 @@ Press 1 for Default View - + Snapmatic Title - + New Snapmatic title: - + Snapmatic Crew - + New Snapmatic crew: @@ -2152,62 +2152,62 @@ Press 1 for Default View - - - + + + Edi&t - - - + + + Show &In-game - - - + + + Hide &In-game - + &Export - + &View - + &Remove - - + + &Select - - + + &Deselect - - + + Select &All - - + + &Deselect All @@ -2404,8 +2404,8 @@ Press 1 for Default View - - + + Change &Players... @@ -2416,22 +2416,22 @@ Press 1 for Default View - - + + Change &Title... - - + + Change &Crew... - - + + &Qualify as Avatar @@ -2487,15 +2487,15 @@ Press 1 for Default View - - + + Show In-game - - + + Hide In-game diff --git a/res/gta5sync_fr.ts b/res/gta5sync_fr.ts index 589cb0a..2d72526 100644 --- a/res/gta5sync_fr.ts +++ b/res/gta5sync_fr.ts @@ -398,7 +398,7 @@ et les fichiers de sauvegarde de Grand Theft Auto V - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! Avatar personnalisé @@ -406,7 +406,7 @@ et les fichiers de sauvegarde de Grand Theft Auto V - + Custom Picture Custom Picture Description in SC, don't use Special Character! Image personnalisé @@ -1142,31 +1142,31 @@ Y : %2 - + Export as &Picture... Exporter comme &image... - + Export as &Snapmatic... Exporter comme &Snapmatic... - + &Overwrite Image... &Remplacer l'image... - + &Edit Properties... Modifier les &propriétés... - + Open &Map Viewer... Ouvrir la &Visionneuse de Carte... @@ -1233,7 +1233,7 @@ Appuyer sur 1 pour le mode par défaut - + Open &JSON Editor... Ouvrir l'éditeur &JSON... @@ -1337,45 +1337,45 @@ Appuyer sur 1 pour le mode par défaut Copie du fichier %1 sur %2 - + Enabled pictures: %1 of %2 Photos activées : %1 sur %2 - + Loading... Chargement... - + Snapmatic Loader Snapmatic Loader - + <h4>Following Snapmatic Pictures got repaired</h4>%1 <h4>Les Snapmatic suivants ont été répaés</h4>%1 - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + Import... Importer... @@ -1390,13 +1390,13 @@ Appuyer sur 1 pour le mode par défaut Importer - + Savegames files (SGTA*) Fichiers de sauvegarde GTA (SGTA*) - + Snapmatic pictures (PGTA*) Photos Snapmatic (PGTA*) @@ -1404,26 +1404,26 @@ Appuyer sur 1 pour le mode par défaut - + All image files (%1) Toutes les images (%1) - + All files (**) Tous les fichiers (**) - - + + Import file %1 of %2 files Importation du fichier %1 sur %2 - + Import failed with... %1 @@ -1432,25 +1432,25 @@ Appuyer sur 1 pour le mode par défaut %1 - - + + No valid file is selected Fichier invalide - + Importable files (%1) Fichiers importables (%1) - + Failed to read Snapmatic picture Impossible d'ouvrir la photo Snapmatic - + Failed to read Savegame file Impossible de lire le fichier de sauvegarde @@ -1458,122 +1458,122 @@ Appuyer sur 1 pour le mode par défaut - + Can't import %1 because file can't be open Impossible d'importer %1, le fichier ne peut pas être ouvert - + Can't import %1 because file can't be parsed properly Impossible d'importer %1, le fichier ne peut pas être parsé correctement - + Can't import %1 because file format can't be detected Impossible d'importer %1, le format du fichier n'est pas détecté - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e Impossible d'importer la photo Snapmatic,nom de fichier incorrect (PGTA*, *.g5e) - + Failed to import the Snapmatic picture, can't copy the file into profile Impossible d'importer la photo Snapmatic, impossible de copier le fichier dans le profil - + Failed to import the Savegame, can't copy the file into profile Impossible d'importer la sauvegarde, impossible de copier le fichier dans le profil - + Failed to import the Savegame, no Savegame slot is left Impossible d'importer la sauvegarde, aucun emplacement libre - - + + JPG pictures and GTA Snapmatic Images JPG et GTA Snapmatic - - + + JPG pictures only Images JPG seulement - - + + GTA Snapmatic only GTA Snapmatic seulement - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1Exporter les photos Snapmatic%2<br><br>Les fichiers JPG permettent d'ouvrir les photos avec une visionneuse d'images<br>Les GTA Snapmatic permettent d'importer les photos dans le jeu<br><br>Exporter comme : - - - - - + + + + + Export selected... Exporter la sélection... - + Initialising export... Initialisation de l'export... - - + + Qualify as Avatar Qualifier comme Avatar - - - - - - + + + + + + No Snapmatic pictures are selected Aucun Snapmatic sélectionné - - - - + + + + Patch selected... Patcher la sélection... - - - - - - - - + + + + + + + + Patch file %1 of %2 files Patch du fichier %1 sur %2 - - - + + + + + - - %1 failed with... %2 @@ -1583,76 +1583,76 @@ Appuyer sur 1 pour le mode par défaut %2 - + Failed to remove all selected Snapmatic pictures and/or Savegame files Échec de la supression des Snapmatic et/ou des fichiers de sauvegarde sélectionnés - + Prepare Content for Import... Préparation du contenu pour l'import... - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? Un Snapmatic existe déjà avec le uid %1, voulez-vous assigner à votre import un nouvel uid et timestamp ? - + Qualify %1 failed with... Qualifier - - + + Change Players... Modifier les joueurs... - + Change Players %1 failed with... Modifier les joueurs - - - + + + Change Crew... Modifier le Crew... - + Failed to enter a valid Snapmatic Crew ID Snapmatic Crew ID invalide - + Change Crew %1 failed with... Changer le Crew - - - + + + Change Title... Changer le titre... - + Failed to enter a valid Snapmatic title Titre Snapmatic invalide - + Change Title %1 failed with... Changer le titre - + Export failed with... %1 @@ -1661,20 +1661,20 @@ 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 ? @@ -1684,7 +1684,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) @@ -1778,9 +1778,9 @@ Appuyer sur 1 pour le mode par défaut Supprimer - - - + + + &Export &Exporter @@ -1871,38 +1871,38 @@ 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 @@ -1958,7 +1958,7 @@ Appuyer sur 1 pour le mode par défaut Meme - + Snapmatic Title Titre Snapmatic @@ -2076,19 +2076,19 @@ Appuyer sur 1 pour le mode par défaut 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 : @@ -2236,62 +2236,62 @@ Appuyer sur 1 pour le mode par défaut %1 n'a pas pu être rendu visible en jeu - - - + + + Edi&t Édi&ter - - - + + + Show &In-game &Visible en jeu - - - + + + Hide &In-game &Invisible en jeu - + &Export &Exporter - + &View &Voir - + &Remove S&upprimer - - + + &Select &Sélectionner - - + + &Deselect &Déselectionner - - + + Select &All Sélectionner &tout - - + + &Deselect All &Déselectionner tout @@ -2445,8 +2445,8 @@ Appuyer sur 1 pour le mode par défaut - - + + Change &Players... Modifier les &joueurs... @@ -2457,22 +2457,22 @@ Appuyer sur 1 pour le mode par défaut - - + + Change &Title... Changer le &titre... - - + + Change &Crew... Changer le &Crew... - - + + &Qualify as Avatar &Qualifier comme Avatar @@ -2555,15 +2555,15 @@ Appuyer sur 1 pour le mode par défaut %1 - Nouvelles - - + + Show In-game Visible en jeu - - + + Hide In-game Invisible en jeu diff --git a/res/gta5sync_ko.ts b/res/gta5sync_ko.ts index f956bd9..cfdf16e 100644 --- a/res/gta5sync_ko.ts +++ b/res/gta5sync_ko.ts @@ -391,7 +391,7 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! 소셜클럽의 사용자 지정 아바타 설명입니다. 특수 문자를 사용하지 마십시오! @@ -400,7 +400,7 @@ Pictures and Savegames - + Custom Picture Custom Picture Description in SC, don't use Special Character! 소셜클럽의 사용자 지정 그림 설명입니다. 특수 문자를 사용하지 마십시오! @@ -1069,37 +1069,37 @@ Y: %2 - + Export as &Picture... 내 PC에 이미지로 내보내기(&P) - + Export as &Snapmatic... 내 PC에 스냅매틱으로 내보내기(&S) - + &Edit Properties... 속성 편집(&E) - + &Overwrite Image... 이미지 덮어쓰기(&O) - + Open &Map Viewer... 지도 뷰어 열기(&M) - + Open &JSON Editor... JSON 편집기 열기(&J) @@ -1352,23 +1352,23 @@ Press 1 for Default View - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + Import... 가져오기 @@ -1385,14 +1385,14 @@ Press 1 for Default View - + All image files (%1) 모든 이미지 파일 (%1) - + All files (**) 모든 파일 (**) @@ -1400,75 +1400,75 @@ Press 1 for Default View - + Can't import %1 because file can't be open 파일을 열 수 없으므로 %1을 가져올 수 없습니다. - + Can't import %1 because file can't be parsed properly 파일을 구문 분석할 수 없으므로 %1을 가져올 수 없습니다. - + Enabled pictures: %1 of %2 활성화된 이미지: %2의 %1 - + Loading... 불러오는 중... - + Snapmatic Loader 스냅매틱 불러오기 - + <h4>Following Snapmatic Pictures got repaired</h4>%1 <h4>다음 스냅매틱 이미지를 복구했습니다. </h4>%1 - + Importable files (%1) 가져올 수 있는 파일 (%1) - + GTA V Export (*.g5e) GTA V로 내보내기 (*.g5e) - + Savegames files (SGTA*) 세이브 파일 (SGTA*) - + Snapmatic pictures (PGTA*) 스냅매틱 이미지 (PGTA*) - - + + No valid file is selected 올바른 파일이 선택되지 않았습니다. - - + + Import file %1 of %2 files %2 파일 중 %1 파일을 가져옵니다. - + Import failed with... %1 @@ -1477,91 +1477,91 @@ Press 1 for Default View %1 - + Failed to read Snapmatic picture 스냅매틱 이미지를 읽지 못했습니다. - + Failed to read Savegame file 세이브 파일을 읽지 못했습니다. - + Can't import %1 because file format can't be detected 파일 형식을 검색할 수 없으므로 %1을 가져올 수 없습니다. - + Prepare Content for Import... 가져올 컨텐츠를 준비합니다. - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e 스냅매틱 이미지를 가져오지 못했습니다. 파일이 PGTA로 시작되거나 .g5e로 끝나지 않습니다. - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? uid %1이(가) 있는 스냅매틱 이미지가 이미 있습니다. 가져오기를 새 uid 및 타임스탬프를 할당하시겠습니까? - + Failed to import the Snapmatic picture, can't copy the file into profile 스냅매틱 이미지를 가져오지 못했습니다. 파일을 프로필에 복사할 수 없습니다. - + Failed to import the Savegame, can't copy the file into profile 게임 저장 파일을 가져오지 못했습니다. 파일을 프로필에 복사할 수 없습니다. - + Failed to import the Savegame, no Savegame slot is left 게임 저장 파일을 가져오지 못했습니다. 게임 저장 슬롯이 남아 있지 않습니다. - - - - - + + + + + Export selected... 내보내기를 선택했습니다. - - + + JPG pictures and GTA Snapmatic JPG 이미지 및 GTA 스냅매틱 - - + + JPG pictures only JPG 이미지만 - - + + GTA Snapmatic only GTA 스냅매틱만 - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1 스냅매틱 이미지 내보내기를 시작합니다.%2 <br><br>JPG 이미지를 사용하면 이미지 뷰어로 파일을 열 수 있습니다.<br>GTA 스냅매틱을 사용하면 다음과 같이 이미지를 게임으로 가져올 수 있습니다. - + Initialising export... 내보내기를 초기화하는 중... - + Export failed with... %1 @@ -1570,45 +1570,45 @@ Press 1 for Default View %1 - - + + No Snapmatic pictures or Savegames files are selected 스냅매틱 이미지 또는 세이브 파일이 선택되지 않았습니다. - - - + + + Remove selected 선택한 항목 삭제 - + You really want remove the selected Snapmatic picutres and Savegame files? 선택한 스냅매틱 이미지 및 세이브 파일을 삭제하시겠습니까? - + Failed to remove all selected Snapmatic pictures and/or Savegame files 선택한 모든 스냅매틱 이미지 및 세이브 파일을 삭제하지 못했습니다. - - - - - - + + + + + + No Snapmatic pictures are selected 스냅매틱 이미지가 선택되지 않았습니다. - - - + + + + + - - %1 failed with... %2 @@ -1619,84 +1619,84 @@ Press 1 for Default View %2 - - + + Qualify as Avatar 아바타 자격 부여 - - - - + + + + Patch selected... 패치가 선택됨... - - - - - - - - + + + + + + + + Patch file %1 of %2 files %2 파일의 %1 패치 파일입니다. - + Qualify %1 failed with... %1이(가) 실패한 경우... 자격 부여 - - + + Change Players... 플레이어 변경 - + Change Players %1 failed with... %1이(가) 실패한 경우... 플레이어 변경 - - - + + + Change Crew... 조직 변경 - + Failed to enter a valid Snapmatic Crew ID 올바른 스냅매틱 조직 아이디를 입력하지 못했습니다. - + Change Crew %1 failed with... %1이(가) 실패한 경우... 조직 변경 - - - + + + Change Title... 제목 변경 - + Failed to enter a valid Snapmatic title 올바른 스냅매틱 제목을 입력하지 않았습니다. - + Change Title %1 failed with... %1이(가) 실패한 경우... @@ -1796,45 +1796,45 @@ Press 1 for Default View 삭제 - + &View 보기(&V) - - - + + + &Export 내보내기(&E) - - - + + + &Remove 삭제(&R) - - + + &Select 선택(&S) - - + + &Deselect 선택 해제(&D) - - + + Select &All 모두 선택(&A) - - + + &Deselect All 모두 선택 해제(&D) @@ -2039,25 +2039,25 @@ Press 1 for Default View JSON 오류로 인해 스냅매틱 속성을 패치하지 못했습니다. - + Snapmatic Crew 조직 스냅매틱 - + New Snapmatic crew: 새로운 조직 스냅매틱: - + Snapmatic Title 스냅매틱 제목 - + New Snapmatic title: 새로운 스냅매틱 제목: @@ -2237,62 +2237,62 @@ Press 1 for Default View 삭제 - - - + + + Edi&t 편집(&T) - - - + + + Show &In-game 인게임에서 보이기(&I) - - - + + + Hide &In-game 인게임에서 숨기기(&I) - + &Export 내보내기(&E) - + &View 보기(&V) - + &Remove 삭제(&R) - - + + &Select 선택(&S) - - + + &Deselect 선택 해제(&D) - - + + Select &All 모두 선택(&A) - - + + &Deselect All 모두 선택 해제(&D) @@ -2495,42 +2495,42 @@ Press 1 for Default View - - + + Change &Title... 제목 변경(&T) - - + + Change &Crew... &조직 상징 변경(&C) - - + + &Qualify as Avatar 아바타 자격 부여(&Q) - - + + Change &Players... 플레이어 변경(&P) - - + + Show In-game 인게임 보이기 - - + + Hide In-game 인게임 숨기기 diff --git a/res/gta5sync_ru.ts b/res/gta5sync_ru.ts index c3fcfa0..7a7ff2c 100644 --- a/res/gta5sync_ru.ts +++ b/res/gta5sync_ru.ts @@ -405,7 +405,7 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! Свой Аватар @@ -413,7 +413,7 @@ Pictures and Savegames - + Custom Picture Custom Picture Description in SC, don't use Special Character! Своя Картинка @@ -1072,31 +1072,31 @@ Y: %2 - + Export as &Picture... Экспортировать как &картинку... - + Export as &Snapmatic... Экспортировать как &Snapmatic... - + &Overwrite Image... &Перезаписать картинку... - + &Edit Properties... &Изменить свойства... - + Open &Map Viewer... Открыть &карту... @@ -1243,7 +1243,7 @@ Press 1 for Default View - + Open &JSON Editor... Открыть &редактор JSON... @@ -1340,17 +1340,17 @@ Press 1 for Default View &Закрыть - + Loading... Загрузка... - + Snapmatic Loader Загрузчик Snapmatic - + <h4>Following Snapmatic Pictures got repaired</h4>%1 Change wording if the %1 is not a multiline beginning at new line @@ -1359,23 +1359,23 @@ Press 1 for Default View - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + Import... Импортировать... @@ -1390,13 +1390,13 @@ Press 1 for Default View Импортировать - + Savegames files (SGTA*) Файлы сохранения (SGTA*) - + Snapmatic pictures (PGTA*) Картинка Snapmatic (PGTA*) @@ -1404,19 +1404,19 @@ Press 1 for Default View - + All files (**) Все файлы (**) - - + + Import file %1 of %2 files Импортируются файлы %1 из %2 - + Import failed with... %1 @@ -1425,169 +1425,169 @@ Press 1 for Default View %1 - + Failed to read Snapmatic picture Не удалось загрузить картинку Snapmatic - + Failed to read Savegame file Не удалось загрузить файл сохранения - - + + No valid file is selected Выбранный файл неверен - + Enabled pictures: %1 of %2 Включенные картинки: %1 из %2 - + Importable files (%1) Файлы для импорта (%1) - + All image files (%1) Все файлы изображений (%1) - + Can't import %1 because file can't be open Не удалось открыть %1, файл не может быть открыт - + Can't import %1 because file can't be parsed properly Не получилось импортировать %1, файл не может быть правильно обработан - + Can't import %1 because file format can't be detected Не получилось импортировать %1, не удалось определить формат файла - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e Не удалось импортировать картинку Snapmatic, название не начинается с PGTA или не заканчивается с .g5e - + Failed to import the Snapmatic picture, can't copy the file into profile Не удалось импортировать картинку Snapmatic, не получилось скопировать файл в профиль - + Failed to import the Savegame, can't copy the file into profile Не удалось импортировать сохранение, не получилось скопировать файл в профиль - + Failed to import the Savegame, no Savegame slot is left Не удалось импортировать сохранение, нет пустых ячеек под сохранения - - + + JPG pictures and GTA Snapmatic Картинки JPG и GTA Snapmatic - - + + JPG pictures only Только картинки JPG - - + + GTA Snapmatic only Только GTA Snapmatic - + Initialising export... Подготовка к экспорту... - - + + No Snapmatic pictures or Savegames files are selected Не выделен ни один Snapmatic или сохранение - - - + + + Remove selected Снять выделение - + You really want remove the selected Snapmatic picutres and Savegame files? Точно ли хочешь удалить выбранные картинки Snapmatic и файлы сохранений? - + Prepare Content for Import... Подготовка данных к импорту... - - + + Qualify as Avatar Пометить как Аватар - - - - - - + + + + + + No Snapmatic pictures are selected Не выделена ни одна картинка Snapmatic - - - - + + + + Patch selected... Пропатчить выделенные... - - - - - - - - + + + + + + + + Patch file %1 of %2 files Изменяется файл %1 из %2 - - - + + + + + - - %1 failed with... %2 @@ -1597,86 +1597,86 @@ Press 1 for Default View %2 - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? Можно использовать слово "приписать" - + Failed to remove all selected Snapmatic pictures and/or Savegame files Не удалось удалить все выделенные картинки Snapmatic и/или сохранения - + Qualify %1 failed with... Помечание - - + + Change Players... Изменить игроков... - + Change Players %1 failed with... Измение игроков - - - + + + Change Crew... Изменить банду... - + Failed to enter a valid Snapmatic Crew ID Введённый идентификатор банды не верен - + Change Crew %1 failed with... Изменение банды - - - + + + Change Title... Изменить заголовок... - + Failed to enter a valid Snapmatic title Введённый заголовок не верен - + Change Title %1 failed with... Изменение заголовка - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1Эскпортировать картинки Snapmatic%2<br><br>Картинки JPG можно открыть любым просмотрщиком<br>Картинки формата GTA Snapmatic можно снова импортировать в игру<br><br>Экспортировать как: - - - - - + + + + + Export selected... Экпортировать выделенное... - + Export failed with... %1 @@ -1697,7 +1697,7 @@ Press 1 for Default View Все файлы профиля (*.g5e SGTA* PGTA*) - + GTA V Export (*.g5e) GTA V Export (*.g5e) @@ -1826,38 +1826,38 @@ Press 1 for Default View Не удалось удалить сохранение %1 - + &View &Просмотр - - - + + + &Remove &Удалить - - + + &Select &Выбрать - - + + &Deselect Сн&ять выбор - - + + Select &All В&ыбрать все - - + + &Deselect All Снять выбо&р со всех @@ -1867,9 +1867,9 @@ Press 1 for Default View Копировать сохранение - - - + + + &Export &Экспортировать @@ -1973,7 +1973,7 @@ Press 1 for Default View Meme - + Snapmatic Title Заголовок Snapmatic @@ -2079,19 +2079,19 @@ Press 1 for Default View Не удалось измененить свойства Snapmatic из-за проблемы ввода/вывода - + New Snapmatic title: Новый заголовок Snapmatic: - + Snapmatic Crew Банда на Snapmatic - + New Snapmatic crew: Новая банда на Snapmatic: @@ -2229,62 +2229,62 @@ Press 1 for Default View Не удалось показать %1 в списке картинок Snapmatic в игре - - - + + + Edi&t &Правка - - - + + + Show &In-game Показывать в &игре - - - + + + Hide &In-game Ск&рыть в игре - + &Export &Экспорт - + &View По&казать - + &Remove У&далить - - + + &Select &Выделить - - + + &Deselect Сн&ять выделение - - + + Select &All В&ыбрать все - - + + &Deselect All Снять выбо&р со всех @@ -2408,29 +2408,29 @@ Press 1 for Default View - - + + Change &Players... &Изменить игрока... - - + + Change &Title... Изменить &Заголовок... - - + + Change &Crew... Изменить &банду... - - + + &Qualify as Avatar &Пометить как Аватар @@ -2558,15 +2558,15 @@ Press 1 for Default View Пере&загрузить - - + + Show In-game Показывать в игре - - + + Hide In-game Скрыть в игре diff --git a/res/gta5sync_uk.ts b/res/gta5sync_uk.ts index feadacc..1810514 100644 --- a/res/gta5sync_uk.ts +++ b/res/gta5sync_uk.ts @@ -394,7 +394,7 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! Користувацький Аватар @@ -402,7 +402,7 @@ Pictures and Savegames - + Custom Picture Custom Picture Description in SC, don't use Special Character! Користувацьке Зображення @@ -1059,37 +1059,37 @@ Y: %2 - + Export as &Picture... Експортувати як &зображення... - + Export as &Snapmatic... Експортувати як &Snapmatic... - + &Edit Properties... &Змінити властивості... - + &Overwrite Image... &Перезаписати зображення... - + Open &Map Viewer... Відкрити &карту... - + Open &JSON Editor... Відкрити редактор &JSON... @@ -1342,23 +1342,23 @@ Press 1 for Default View - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + Import... Імпортування... @@ -1375,14 +1375,14 @@ Press 1 for Default View - + All image files (%1) Файли зображень (%1) - + All files (**) Усі файли (**) @@ -1390,75 +1390,75 @@ Press 1 for Default View - + Can't import %1 because file can't be open Неможливо імпортувати %1, оскільки файл не може бути відкритий - + Can't import %1 because file can't be parsed properly Неможливо імпортувати %1, оскільки файл неможливо розібрати правильно - + Enabled pictures: %1 of %2 Увімкнено фотографії:%1 з%2 - + Loading... Завантаження... - + Snapmatic Loader Snapmatic Loader - + <h4>Following Snapmatic Pictures got repaired</h4>%1 <h4>Наступні Snapmatic зображення були відновлені</h4>%1 - + Importable files (%1) Імпортуються файли (%1) - + GTA V Export (*.g5e) GTA V Export (*.g5e) - + Savegames files (SGTA*) Файли збереження гри (SGTA*) - + Snapmatic pictures (PGTA*) Snapmatic зображення (PGTA*) - - + + No valid file is selected Вибрані недійсні файли - - + + Import file %1 of %2 files Імпортується файл %1 з %2 файлів - + Import failed with... %1 @@ -1467,81 +1467,81 @@ Press 1 for Default View %1 - + Failed to read Snapmatic picture Не вдалося прочитати Snapmatic картинку - + Failed to read Savegame file Не вдалося прочитати файл збереження гри - + Can't import %1 because file format can't be detected Неможливо імпортувати%1, оскільки формат файлу не може бути виявлений - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e Не вдалося імпортувати зображення Snapmatic, файл не починається з PGTA або закінчується .g5e - + Failed to import the Snapmatic picture, can't copy the file into profile Не вдалося імпортувати зображення Snapmatic, не можна скопіювати файл у профіль - + Failed to import the Savegame, can't copy the file into profile Не вдалося імпортувати Сейв, не можна скопіювати файл у профіль - + Failed to import the Savegame, no Savegame slot is left Не вдалося імпортувати Сейв, немає вільного слота - - - - - + + + + + Export selected... Експорт обраних... - - + + JPG pictures and GTA Snapmatic JPG картинки і GTA Snapmatic - - + + JPG pictures only Тільки JPG картинки - - + + GTA Snapmatic only Тільки GTA Snapmatic - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1 Експортувати Snapmatic фотографії %2 <br><br> Фотографії JPG дозволяють відкривати зображення за допомогою засобу перегляду зображень<br>GTA Snapmatic дає змогу імпортувати зображення в гру<br><br>Експортувати як: - + Initialising export... Ініціалізація експорту... - + Export failed with... %1 @@ -1550,45 +1550,45 @@ Press 1 for Default View %1 - - + + No Snapmatic pictures or Savegames files are selected Не вибрано жодного Snapmatic зображення або файлу збереження - - - + + + Remove selected Видалити вибрані - + You really want remove the selected Snapmatic picutres and Savegame files? Ви дійсно хочете видалити вибрані Snapmatic фотографії та файли збереження гри? - + Failed to remove all selected Snapmatic pictures and/or Savegame files Не вдалося видалити всі обрані Snapmatic фотографії та/або Сейви - - - - - - + + + + + + No Snapmatic pictures are selected Не вибрано жодного Snapmatic зображення - - - + + + + + - - %1 failed with... %2 @@ -1598,91 +1598,91 @@ Press 1 for Default View %2 - + Prepare Content for Import... Підготувати контент для імпорту ... - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? Snapmatic зображення з uid %1 вже існує, ви хочете призначити для імпорту новий uid та мітку часу? - - + + Qualify as Avatar Позначити як Аватар - - - - + + + + Patch selected... Вибір патчу... - - - - - - - - + + + + + + + + Patch file %1 of %2 files Патч файлу %1 з %2 файлів - + Qualify %1 failed with... Якість - - + + Change Players... Зміна гравців... - + Change Players %1 failed with... Змінити гравців - - - + + + Change Crew... Зміна банди... - + Failed to enter a valid Snapmatic Crew ID Не вдалося ввести дійсний ID Банди Snapmatic - + Change Crew %1 failed with... Змінити банду - - - + + + Change Title... Зміна назви... - + Failed to enter a valid Snapmatic title Не вдалося ввести дійсний заголовок Snapmatic - + Change Title %1 failed with... Змінити назву @@ -1781,45 +1781,45 @@ Press 1 for Default View Видалити - + &View &Перегляд - - - + + + &Export &Експорт - - - + + + &Remove &Видалення - - + + &Select &Виділення - - + + &Deselect &Зняти виділення - - + + Select &All Вибрати &усі - - + + &Deselect All &Зняти виділення усіх @@ -2024,25 +2024,25 @@ Press 1 for Default View Змінити властивості Snapmatic не вдалося через JSON Помилку - + Snapmatic Crew Snapmatic банда - + New Snapmatic crew: Нова Snapmatic банда: - + Snapmatic Title Snapmatic назва - + New Snapmatic title: Новий Snapmatic заголовок: @@ -2217,62 +2217,62 @@ Press 1 for Default View Видалити - - - + + + Edi&t Редагува&ти - - - + + + Show &In-game Показати &у грі - - - + + + Hide &In-game Сховати &у грі - + &Export &Експортувати - + &View &Переглянути - + &Remove &Видалити - - + + &Select &Виділення - - + + &Deselect &Зняти виділення - - + + Select &All Вибрати &усі - - + + &Deselect All &Зняти виділення усіх @@ -2475,42 +2475,42 @@ Press 1 for Default View - - + + Change &Title... Змінити &заголовок... - - + + Change &Crew... Змінити &банду... - - + + &Qualify as Avatar Позначити як &аватар - - + + Change &Players... Змінити &гравців... - - + + Show In-game Показати у грі - - + + Hide In-game Сховати у грі diff --git a/res/gta5sync_zh_TW.ts b/res/gta5sync_zh_TW.ts index 80e65a3..2ef112b 100644 --- a/res/gta5sync_zh_TW.ts +++ b/res/gta5sync_zh_TW.ts @@ -390,7 +390,7 @@ Pictures and Savegames - + Custom Avatar Custom Avatar Description in SC, don't use Special Character! 自訂大頭貼 @@ -398,7 +398,7 @@ Pictures and Savegames - + Custom Picture Custom Picture Description in SC, don't use Special Character! 自訂圖片 @@ -1053,37 +1053,37 @@ Y: %2 - + Export as &Picture... 匯出成圖片(&P)... - + Export as &Snapmatic... 匯出成 Snapmatic(&S)... - + &Edit Properties... 編輯屬性(&E) ... - + &Overwrite Image... 修改圖片(&O)... - + Open &Map Viewer... 開啟地圖檢視器(&M)... - + Open &JSON Editor... 開啟 JSON 編輯器(&J)... @@ -1336,23 +1336,23 @@ Press 1 for Default View - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + Import... 匯入... @@ -1369,14 +1369,14 @@ Press 1 for Default View - + All image files (%1) 所有圖片 (%1) - + All files (**) 所有檔案 (**) @@ -1384,201 +1384,201 @@ Press 1 for Default View - + Can't import %1 because file can't be open 無法匯入 %1,因為檔案無法開啟 - + Can't import %1 because file can't be parsed properly 無法匯入 %1,因為檔案無法正確解析 - + Enabled pictures: %1 of %2 開啟圖片 %1 共 %2 - + Loading... 載入中... - + Snapmatic Loader Snapmatic 載入器 - + <h4>Following Snapmatic Pictures got repaired</h4>%1 <h4>下列的 Snapmatic 圖片已被更新</h4>%1 - + Importable files (%1) 可匯入的檔案 (%1) - + GTA V Export (*.g5e) GTA V Export (*.g5e) - + Savegames files (SGTA*) 遊戲存檔 (SGTA*) - + Snapmatic pictures (PGTA*) Snapmatic 圖片 (PGTA*) - - + + No valid file is selected 沒有選擇有效的檔案 - - + + Import file %1 of %2 files 匯入檔案 %1 共 %2 個 - + Import failed with... %1 %1 匯入失敗 - + Failed to read Snapmatic picture 無法讀取 Snapmatic 圖片 - + Failed to read Savegame file 無法讀取遊戲存檔 - + Can't import %1 because file format can't be detected 無法匯入 %1,因為無法檢測該檔案格式 - + Failed to import the Snapmatic picture, file not begin with PGTA or end with .g5e 匯入 Snapmatic 圖片失敗,檔案不是 PGTA 開頭或附檔名不是 .g5e - + Failed to import the Snapmatic picture, can't copy the file into profile 匯入 Snapmatic 圖片失敗,無法將該檔案複製到設定檔中 - + Failed to import the Savegame, can't copy the file into profile 匯入遊戲存檔失敗,無法將該檔案複製到設定檔中 - + Failed to import the Savegame, no Savegame slot is left 匯入遊戲存檔失敗,沒有遊戲存檔欄位 - - - - - + + + + + Export selected... 匯出所選... - - + + JPG pictures and GTA Snapmatic JPG 圖片和 GTA Snapmatic - - + + JPG pictures only 只有 JPG 圖片 - - + + GTA Snapmatic only 只有 GTA Snapmatic - + %1Export Snapmatic pictures%2<br><br>JPG pictures make it possible to open the picture with a Image Viewer<br>GTA Snapmatic make it possible to import the picture into the game<br><br>Export as: %1 匯出 Snapmatic 圖片 %2<br><br>JPG 圖片可使用圖片檢視器開啟<br>GTA Snapmatic 可以匯入到遊戲中<br><br>匯出成: - + Initialising export... 初始化... - + Export failed with... %1 %1 匯出失敗 - - + + No Snapmatic pictures or Savegames files are selected 未選擇 Snapmatic 圖片或遊戲存檔 - - - + + + Remove selected 移除所選 - + You really want remove the selected Snapmatic picutres and Savegame files? 你想移除所選的 Snapmatic 圖片/存檔嗎? - + Failed to remove all selected Snapmatic pictures and/or Savegame files 無法移除所選擇的 Snapmatic 圖片/遊戲存檔 - - - - - - + + + + + + No Snapmatic pictures are selected 未選擇 Snapmatic 圖片 - - - + + + + + - - %1 failed with... %2 @@ -1588,91 +1588,91 @@ Press 1 for Default View %2 - + Prepare Content for Import... 準備匯入內容... - + A Snapmatic picture already exists with the uid %1, you want assign your import a new uid and timestamp? 已有與 uid %1 相同的 Snapmatic 圖片,你想要匯入新的 uid 和時間戳嗎? - - + + Qualify as Avatar 合格大頭貼 - - - - + + + + Patch selected... 修改所選... - - - - - - - - + + + + + + + + Patch file %1 of %2 files 修改檔案 %1 共 %2 個檔案 - + Qualify %1 failed with... 合格 - - + + Change Players... 更改玩家... - + Change Players %1 failed with... 更改玩家 - - - + + + Change Crew... 更改幫會... - + Failed to enter a valid Snapmatic Crew ID 輸入了無效的幫會 ID - + Change Crew %1 failed with... 更改幫會 - - - + + + Change Title... 更改標題... - + Failed to enter a valid Snapmatic title 輸入了無效的標題 - + Change Title %1 failed with... 更改標題 @@ -1763,45 +1763,45 @@ Press 1 for Default View 刪除 - + &View 檢視(&V) - - - + + + &Export 匯出(&E) - - - + + + &Remove 移除(&R) - - + + &Select 選擇(&S) - - + + &Deselect 取消選擇(&D) - - + + Select &All 選擇全部(&A) - - + + &Deselect All 取消選擇全部(&D) @@ -2006,25 +2006,25 @@ Press 1 for Default View JSON 錯誤,未能更新 Snapmatic 屬性 - + Snapmatic Crew 幫會 - + New Snapmatic crew: 輸入新的幫會: - + Snapmatic Title 標題 - + New Snapmatic title: 輸入新的標題: @@ -2199,62 +2199,62 @@ Press 1 for Default View 刪除 - - - + + + Edi&t 編輯(&E) - - - + + + Show &In-game 在遊戲中顯示(&I) - - - + + + Hide &In-game 在遊戲中隱藏(&I) - + &Export 匯出(&E) - + &View 檢視(&V) - + &Remove 移除(&R) - - + + &Select 選擇(&S) - - + + &Deselect 取消選擇(&D) - - + + Select &All 選擇全部(&A) - - + + &Deselect All 取消選擇全部(&D) @@ -2456,42 +2456,42 @@ Press 1 for Default View - - + + Change &Title... 更改標題(&T)... - - + + Change &Crew... 更改幫會(&C)... - - + + &Qualify as Avatar 符合大頭貼資格(&Q) - - + + Change &Players... 更改玩家(&P)... - - + + Show In-game 在遊戲中顯示 - - + + Hide In-game 在遊戲中隱藏