|
|
|
@ -52,7 +52,6 @@ |
|
|
|
|
#include <QClipboard> |
|
|
|
|
#include <QFileInfo> |
|
|
|
|
#include <QPainter> |
|
|
|
|
#include <QRegExp> |
|
|
|
|
#include <QAction> |
|
|
|
|
#include <QDebug> |
|
|
|
|
#include <QColor> |
|
|
|
@ -272,10 +271,10 @@ void ProfileInterface::insertSnapmaticIPI(QWidget *widget) |
|
|
|
|
#else |
|
|
|
|
qSort(pictureKeyList.begin(), pictureKeyList.end(), qGreater<QString>()); |
|
|
|
|
#endif |
|
|
|
|
int picIndex = pictureKeyList.indexOf(QRegExp(widgetKey)); |
|
|
|
|
int picIndex = pictureKeyList.indexOf(widgetKey); |
|
|
|
|
ui->vlSnapmatic->insertWidget(picIndex, proWidget); |
|
|
|
|
|
|
|
|
|
qApp->processEvents(); |
|
|
|
|
QApplication::processEvents(); |
|
|
|
|
ui->saProfile->ensureWidgetVisible(proWidget, 0, 0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -293,10 +292,10 @@ void ProfileInterface::insertSavegameIPI(QWidget *widget) |
|
|
|
|
#else |
|
|
|
|
qSort(savegameKeyList.begin(), savegameKeyList.end()); |
|
|
|
|
#endif |
|
|
|
|
int sgdIndex = savegameKeyList.indexOf(QRegExp(widgetKey)); |
|
|
|
|
int sgdIndex = savegameKeyList.indexOf(widgetKey); |
|
|
|
|
ui->vlSavegame->insertWidget(sgdIndex, proWidget); |
|
|
|
|
|
|
|
|
|
qApp->processEvents(); |
|
|
|
|
QApplication::processEvents(); |
|
|
|
|
ui->saProfile->ensureWidgetVisible(proWidget, 0, 0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -326,7 +325,7 @@ void ProfileInterface::dialogNextPictureRequested(QWidget *dialog) |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
picIndex = pictureKeyList.indexOf(QRegExp(widgetKey)); |
|
|
|
|
picIndex = pictureKeyList.indexOf(widgetKey); |
|
|
|
|
} |
|
|
|
|
picIndex++; |
|
|
|
|
if (pictureKeyList.length() > picIndex) |
|
|
|
@ -365,7 +364,7 @@ void ProfileInterface::dialogPreviousPictureRequested(QWidget *dialog) |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
picIndex = pictureKeyList.indexOf(QRegExp(widgetKey)); |
|
|
|
|
picIndex = pictureKeyList.indexOf(widgetKey); |
|
|
|
|
} |
|
|
|
|
if (picIndex > 0) |
|
|
|
|
{ |
|
|
|
@ -408,7 +407,7 @@ void ProfileInterface::sortingProfileInterface() |
|
|
|
|
ui->vlSavegame->setEnabled(true); |
|
|
|
|
ui->vlSnapmatic->setEnabled(true); |
|
|
|
|
|
|
|
|
|
qApp->processEvents(); |
|
|
|
|
QApplication::processEvents(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ProfileInterface::profileLoaded_p() |
|
|
|
@ -772,7 +771,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime |
|
|
|
|
cEnough++; |
|
|
|
|
} |
|
|
|
|
spJson.createdDateTime = importDateTime; |
|
|
|
|
#if QT_VERSION >= 0x060000 |
|
|
|
|
spJson.createdTimestamp = QString::number(spJson.createdDateTime.toSecsSinceEpoch()).toUInt(); |
|
|
|
|
#else |
|
|
|
|
spJson.createdTimestamp = spJson.createdDateTime.toTime_t(); |
|
|
|
|
#endif |
|
|
|
|
picture->setSnapmaticProperties(spJson); |
|
|
|
|
picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid))); |
|
|
|
|
picture->setPictureTitle(customImageTitle); |
|
|
|
@ -826,7 +829,11 @@ bool ProfileInterface::importFile(QString selectedFile, QDateTime importDateTime |
|
|
|
|
cEnough++; |
|
|
|
|
} |
|
|
|
|
spJson.createdDateTime = importDateTime; |
|
|
|
|
#if QT_VERSION >= 0x060000 |
|
|
|
|
spJson.createdTimestamp = QString::number(spJson.createdDateTime.toSecsSinceEpoch()).toUInt(); |
|
|
|
|
#else |
|
|
|
|
spJson.createdTimestamp = spJson.createdDateTime.toTime_t(); |
|
|
|
|
#endif |
|
|
|
|
picture->setSnapmaticProperties(spJson); |
|
|
|
|
picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid))); |
|
|
|
|
picture->setPictureTitle(importDialog->getImageTitle()); |
|
|
|
@ -1071,7 +1078,11 @@ bool ProfileInterface::importImage(QImage *snapmaticImage, QDateTime importDateT |
|
|
|
|
cEnough++; |
|
|
|
|
} |
|
|
|
|
spJson.createdDateTime = importDateTime; |
|
|
|
|
#if QT_VERSION >= 0x060000 |
|
|
|
|
spJson.createdTimestamp = QString::number(spJson.createdDateTime.toSecsSinceEpoch()).toUInt(); |
|
|
|
|
#else |
|
|
|
|
spJson.createdTimestamp = spJson.createdDateTime.toTime_t(); |
|
|
|
|
#endif |
|
|
|
|
picture->setSnapmaticProperties(spJson); |
|
|
|
|
picture->setPicFileName(QString("PGTA5%1").arg(QString::number(spJson.uid))); |
|
|
|
|
picture->setPictureTitle(importDialog->getImageTitle()); |
|
|
|
@ -1115,7 +1126,11 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa |
|
|
|
|
// Update Snapmatic uid
|
|
|
|
|
snapmaticProperties.uid = getRandomUid(); |
|
|
|
|
snapmaticProperties.createdDateTime = QDateTime::currentDateTime(); |
|
|
|
|
#if QT_VERSION >= 0x060000 |
|
|
|
|
snapmaticProperties.createdTimestamp = QString::number(snapmaticProperties.createdDateTime.toSecsSinceEpoch()).toUInt(); |
|
|
|
|
#else |
|
|
|
|
snapmaticProperties.createdTimestamp = snapmaticProperties.createdDateTime.toTime_t(); |
|
|
|
|
#endif |
|
|
|
|
bool fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid)); |
|
|
|
|
bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".bak"); |
|
|
|
|
bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".hidden"); |
|
|
|
@ -1152,7 +1167,11 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa |
|
|
|
|
// Update Snapmatic uid
|
|
|
|
|
snapmaticProperties.uid = getRandomUid(); |
|
|
|
|
snapmaticProperties.createdDateTime = QDateTime::currentDateTime(); |
|
|
|
|
#if QT_VERSION >= 0x060000 |
|
|
|
|
snapmaticProperties.createdTimestamp = QString::number(snapmaticProperties.createdDateTime.toSecsSinceEpoch()).toUInt(); |
|
|
|
|
#else |
|
|
|
|
snapmaticProperties.createdTimestamp = snapmaticProperties.createdDateTime.toTime_t(); |
|
|
|
|
#endif |
|
|
|
|
bool fExists = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid)); |
|
|
|
|
bool fExistsBackup = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".bak"); |
|
|
|
|
bool fExistsHidden = QFile::exists(profileFolder % "/PGTA5" % QString::number(snapmaticProperties.uid) % ".hidden"); |
|
|
|
@ -2046,7 +2065,7 @@ void ProfileInterface::massTool(MassTool tool) |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
picture->emitUpdate(); |
|
|
|
|
qApp->processEvents(); |
|
|
|
|
QApplication::processEvents(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
pbDialog.close(); |
|
|
|
@ -2145,7 +2164,7 @@ void ProfileInterface::massTool(MassTool tool) |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
picture->emitUpdate(); |
|
|
|
|
qApp->processEvents(); |
|
|
|
|
QApplication::processEvents(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
pbDialog.close(); |
|
|
|
@ -2198,7 +2217,7 @@ preSelectionCrewID: |
|
|
|
|
} |
|
|
|
|
if (crewList.contains(QString::number(crewID))) |
|
|
|
|
{ |
|
|
|
|
indexNum = crewList.indexOf(QRegExp(QString::number(crewID))); |
|
|
|
|
indexNum = crewList.indexOf(QString::number(crewID)); |
|
|
|
|
} |
|
|
|
|
QString newCrew = QInputDialog::getItem(this, QApplication::translate("SnapmaticEditor", "Snapmatic Crew"), QApplication::translate("SnapmaticEditor", "New Snapmatic crew:"), itemList, indexNum, true, &ok, windowFlags()^Qt::Dialog^Qt::WindowMinMaxButtonsHint); |
|
|
|
|
if (ok && !newCrew.isEmpty()) |
|
|
|
@ -2276,7 +2295,7 @@ preSelectionCrewID: |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
picture->emitUpdate(); |
|
|
|
|
qApp->processEvents(); |
|
|
|
|
QApplication::processEvents(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
pbDialog.close(); |
|
|
|
@ -2379,7 +2398,7 @@ preSelectionTitle: |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
picture->emitUpdate(); |
|
|
|
|
qApp->processEvents(); |
|
|
|
|
QApplication::processEvents(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
pbDialog.close(); |
|
|
|
|