latest changes from gta5sync

This commit is contained in:
Syping 2017-03-30 03:44:48 +02:00
parent c3643aece0
commit 6b4f856e4d
21 changed files with 569 additions and 451 deletions

View file

@ -60,7 +60,9 @@ QStringList CrewDatabase::getCrews()
QString CrewDatabase::getCrewName(int crewID)
{
return crewDB->value(QString::number(crewID), crewID).toString();
QString crewStr = crewDB->value(QString::number(crewID), crewID).toString();
if (crewID == 0) crewStr = tr("No Crew", "");
return crewStr;
}
void CrewDatabase::setCrewName(int crewID, QString crewName)

View file

@ -137,7 +137,7 @@ void ExportThread::run()
QString exportFilePath = exportDirectory + "/" + exportFileName;
if (QFile::exists(exportFilePath)) {QFile::remove(exportFilePath);}
if (!picture->exportPicture(exportDirectory + "/" + exportFileName, true))
if (!picture->exportPicture(exportDirectory + "/" + exportFileName, "G5E"))
{
failedCopyPictures.append(exportFileName);
}

View file

@ -259,7 +259,7 @@ fileDialogPreSave: //Work?
if (selectedFile.right(4) == ".g5e")
{
bool isExported = picture->exportPicture(selectedFile, true);
bool isExported = picture->exportPicture(selectedFile, "G5E");
if (!isExported)
{
QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("Failed to export current Snapmatic picture"));
@ -280,7 +280,7 @@ fileDialogPreSave: //Work?
{
selectedFile.remove(".rem");
}
bool isCopied = picture->exportPicture(selectedFile, false);
bool isCopied = picture->exportPicture(selectedFile, "PGTA");
if (!isCopied)
{
QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("Failed to export current Snapmatic picture"));

View file

@ -701,7 +701,7 @@ bool ProfileInterface::importSnapmaticPicture(SnapmaticPicture *picture, bool wa
if (warn) QMessageBox::warning(this, tr("Import"), tr("Failed to import the Snapmatic picture, the picture is already in the game"));
return false;
}
else if (picture->exportPicture(profileFolder + QDir::separator() + adjustedFileName, false))
else if (picture->exportPicture(profileFolder + QDir::separator() + adjustedFileName, "PGTA"))
{
picture->setPicFilePath(profileFolder + QDir::separator() + adjustedFileName);
pictureLoaded(picture, true);

View file

@ -27,7 +27,7 @@
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>9</number>
</property>
<item>
<widget class="QStackedWidget" name="swProfile">
@ -108,8 +108,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>98</width>
<height>28</height>
<width>398</width>
<height>256</height>
</rect>
</property>
<layout class="QVBoxLayout" name="vlProfile">
@ -160,9 +160,6 @@
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<widget class="QLabel" name="labVersion">
<property name="text">

View file

@ -151,9 +151,13 @@ void SavegameWidget::on_cmdView_clicked()
SavegameDialog *savegameDialog = new SavegameDialog(this);
savegameDialog->setSavegameData(sgdata, sgdPath, true);
savegameDialog->setModal(true);
#ifdef Q_OS_ANDROID
// Android ...
savegameDialog->showMaximized();
#else
savegameDialog->show();
#endif
savegameDialog->exec();
savegameDialog->deleteLater();
delete savegameDialog;
}

View file

@ -26,14 +26,11 @@
#include <QDebug>
#include <QFile>
SnapmaticEditor::SnapmaticEditor(QWidget *parent) :
QDialog(parent),
SnapmaticEditor::SnapmaticEditor(CrewDatabase *crewDB, QWidget *parent) :
QDialog(parent), crewDB(crewDB),
ui(new Ui::SnapmaticEditor)
{
ui->setupUi(this);
ui->cbSelfie->setVisible(false);
ui->cbMugshot->setVisible(false);
ui->cbEditor->setVisible(false);
ui->cmdApply->setDefault(true);
if (QIcon::hasThemeIcon("dialog-apply"))
@ -54,63 +51,45 @@ SnapmaticEditor::~SnapmaticEditor()
delete ui;
}
void SnapmaticEditor::on_cbSelfie_toggled(bool checked)
void SnapmaticEditor::selfie_toggled(bool checked)
{
if (checked)
{
ui->cbMugshot->setEnabled(false);
ui->cbEditor->setEnabled(false);
isSelfie = true;
}
else if (!ui->cbDirector->isChecked())
else
{
ui->cbMugshot->setEnabled(true);
ui->cbEditor->setEnabled(true);
isSelfie = false;
}
}
void SnapmaticEditor::on_cbMugshot_toggled(bool checked)
void SnapmaticEditor::mugshot_toggled(bool checked)
{
if (checked)
{
ui->cbSelfie->setEnabled(false);
ui->cbEditor->setEnabled(false);
isMugshot = true;
ui->cbDirector->setEnabled(false);
ui->cbDirector->setChecked(false);
}
else
{
ui->cbSelfie->setEnabled(true);
ui->cbEditor->setEnabled(true);
isMugshot = false;
ui->cbDirector->setEnabled(true);
}
}
void SnapmaticEditor::on_cbDirector_toggled(bool checked)
void SnapmaticEditor::editor_toggled(bool checked)
{
if (checked)
{
ui->cbMugshot->setEnabled(false);
ui->cbEditor->setEnabled(false);
}
else if (!ui->cbSelfie->isChecked())
{
ui->cbMugshot->setEnabled(true);
ui->cbEditor->setEnabled(true);
}
}
void SnapmaticEditor::on_cbEditor_toggled(bool checked)
{
if (checked)
{
ui->cbSelfie->setEnabled(false);
ui->cbMugshot->setEnabled(false);
isEditor = true;
ui->cbDirector->setEnabled(false);
ui->cbDirector->setChecked(false);
}
else
{
ui->cbSelfie->setEnabled(true);
ui->cbMugshot->setEnabled(true);
isEditor = false;
ui->cbDirector->setEnabled(true);
}
}
@ -119,9 +98,9 @@ void SnapmaticEditor::on_rbSelfie_toggled(bool checked)
{
if (checked)
{
ui->cbMugshot->setChecked(false);
ui->cbEditor->setChecked(false);
ui->cbSelfie->setChecked(true);
mugshot_toggled(false);
editor_toggled(false);
selfie_toggled(true);
}
}
@ -129,10 +108,9 @@ void SnapmaticEditor::on_rbMugshot_toggled(bool checked)
{
if (checked)
{
ui->cbSelfie->setChecked(false);
ui->cbEditor->setChecked(false);
ui->cbDirector->setChecked(false);
ui->cbMugshot->setChecked(true);
selfie_toggled(false);
editor_toggled(false);
mugshot_toggled(true);
}
}
@ -140,10 +118,9 @@ void SnapmaticEditor::on_rbEditor_toggled(bool checked)
{
if (checked)
{
ui->cbSelfie->setChecked(false);
ui->cbMugshot->setChecked(false);
ui->cbDirector->setChecked(false);
ui->cbEditor->setChecked(true);
selfie_toggled(false);
mugshot_toggled(false);
editor_toggled(true);
}
}
@ -151,9 +128,9 @@ void SnapmaticEditor::on_rbCustom_toggled(bool checked)
{
if (checked)
{
ui->cbSelfie->setChecked(false);
ui->cbMugshot->setChecked(false);
ui->cbEditor->setChecked(false);
selfie_toggled(false);
mugshot_toggled(false);
editor_toggled(false);
}
}
@ -162,20 +139,21 @@ void SnapmaticEditor::setSnapmaticPicture(SnapmaticPicture *picture)
smpic = picture;
localSpJson = smpic->getSnapmaticProperties();
ui->rbCustom->setChecked(true);
ui->cbSelfie->setChecked(localSpJson.isSelfie);
ui->cbMugshot->setChecked(localSpJson.isMug);
ui->cbEditor->setChecked(localSpJson.isFromRSEditor);
crewID = localSpJson.crewID;
isSelfie = localSpJson.isSelfie;
isMugshot = localSpJson.isMug;
isEditor = localSpJson.isFromRSEditor;
ui->cbDirector->setChecked(localSpJson.isFromDirector);
ui->cbMeme->setChecked(localSpJson.isMeme);
if (ui->cbSelfie->isChecked())
if (isSelfie)
{
ui->rbSelfie->setChecked(true);
}
else if (ui->cbMugshot->isChecked())
else if (isMugshot)
{
ui->rbMugshot->setChecked(true);
}
else if (ui->cbEditor->isChecked())
else if (isEditor)
{
ui->rbEditor->setChecked(true);
}
@ -183,6 +161,7 @@ void SnapmaticEditor::setSnapmaticPicture(SnapmaticPicture *picture)
{
ui->rbCustom->setChecked(true);
}
setSnapmaticCrew(returnCrewName(crewID));
setSnapmaticTitle(picture->getPictureTitle());
}
@ -209,6 +188,18 @@ void SnapmaticEditor::setSnapmaticTitle(const QString &title)
}
}
void SnapmaticEditor::setSnapmaticCrew(const QString &crew)
{
QString editStr = QString("<a href=\"g5e://editcrew\" style=\"text-decoration: none;\">%1</a>").arg(tr("Edit"));
QString crewStr = tr("Crew: %1 (%2)").arg(StringParser::escapeString(crew), editStr);
ui->labCrew->setText(crewStr);
}
QString SnapmaticEditor::returnCrewName(int crewID_)
{
return crewDB->getCrewName(crewID_);
}
void SnapmaticEditor::on_cmdCancel_clicked()
{
close();
@ -220,9 +211,10 @@ void SnapmaticEditor::on_cmdApply_clicked()
{
qualifyAvatar();
}
localSpJson.isSelfie = ui->cbSelfie->isChecked();
localSpJson.isMug = ui->cbMugshot->isChecked();
localSpJson.isFromRSEditor = ui->cbEditor->isChecked();
localSpJson.crewID = crewID;
localSpJson.isSelfie = isSelfie;
localSpJson.isMug = isMugshot;
localSpJson.isFromRSEditor = isEditor;
localSpJson.isFromDirector = ui->cbDirector->isChecked();
localSpJson.isMeme = ui->cbMeme->isChecked();
if (smpic)
@ -301,3 +293,38 @@ void SnapmaticEditor::on_labTitle_linkActivated(const QString &link)
}
}
}
void SnapmaticEditor::on_labCrew_linkActivated(const QString &link)
{
if (link == "g5e://editcrew")
{
bool ok;
int indexNum = 0;
QStringList itemList;
QStringList crewList = crewDB->getCrews();
crewList.sort();
foreach(const QString &crew, crewList)
{
itemList.append(QString("%1 (%2)").arg(crew, returnCrewName(crew.toInt())));
}
if (crewList.contains(QString::number(crewID)))
{
indexNum = crewList.indexOf(QRegExp(QString::number(crewID)));
}
QString newCrew = QInputDialog::getItem(this, tr("Snapmatic Crew"), tr("New Snapmatic crew:"), itemList, indexNum, true, &ok, windowFlags());
if (ok && !newCrew.isEmpty())
{
if (newCrew.contains(" ")) newCrew = newCrew.split(" ").at(0);
if (newCrew.length() > 10) return;
foreach (const QChar &crewChar, newCrew)
{
if (!crewChar.isNumber())
{
return;
}
}
crewID = newCrew.toInt();
setSnapmaticCrew(returnCrewName(crewID));
}
}
}

View file

@ -20,6 +20,7 @@
#define SNAPMATICEDITOR_H
#include <QDialog>
#include "CrewDatabase.h"
#include "SnapmaticPicture.h"
namespace Ui {
@ -31,16 +32,14 @@ class SnapmaticEditor : public QDialog
Q_OBJECT
public:
explicit SnapmaticEditor(QWidget *parent = 0);
explicit SnapmaticEditor(CrewDatabase *crewDB, QWidget *parent = 0);
void setSnapmaticPicture(SnapmaticPicture *picture);
void setSnapmaticTitle(const QString &title);
void setSnapmaticCrew(const QString &crew = "");
QString returnCrewName(int crewID);
~SnapmaticEditor();
private slots:
void on_cbSelfie_toggled(bool checked);
void on_cbMugshot_toggled(bool checked);
void on_cbDirector_toggled(bool checked);
void on_cbEditor_toggled(bool checked);
void on_rbSelfie_toggled(bool checked);
void on_rbMugshot_toggled(bool checked);
void on_rbEditor_toggled(bool checked);
@ -49,12 +48,21 @@ private slots:
void on_cmdApply_clicked();
void on_cbQualify_toggled(bool checked);
void on_labTitle_linkActivated(const QString &link);
void on_labCrew_linkActivated(const QString &link);
private:
CrewDatabase *crewDB;
Ui::SnapmaticEditor *ui;
SnapmaticProperties localSpJson;
SnapmaticPicture *smpic;
QString snapmaticTitle;
int crewID;
bool isSelfie;
bool isMugshot;
bool isEditor;
void selfie_toggled(bool checked);
void mugshot_toggled(bool checked);
void editor_toggled(bool checked);
void qualifyAvatar();
};

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>350</height>
<height>362</height>
</rect>
</property>
<property name="windowTitle">
@ -81,13 +81,6 @@
<string>Snapmatic Properties</string>
</property>
<layout class="QGridLayout" name="gdProperties">
<item row="5" column="1">
<widget class="QCheckBox" name="cbEditor">
<property name="text">
<string>Editor</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="cbMeme">
<property name="text">
@ -102,37 +95,30 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="cbSelfie">
<property name="text">
<string>Selfie</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QCheckBox" name="cbMugshot">
<property name="text">
<string>Mugshot</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gbTitle">
<widget class="QGroupBox" name="gbValues">
<property name="title">
<string>Snapmatic Title</string>
<string>Snapmatic Values</string>
</property>
<layout class="QVBoxLayout" name="vlTitle">
<item>
<widget class="UiModLabel" name="labTitle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="UiModLabel" name="labCrew">
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="text">
<string>Crew: %1 (%2)</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="UiModLabel" name="labTitle">
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
@ -146,12 +132,6 @@
</item>
<item>
<widget class="UiModLabel" name="labAppropriate">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Appropriate: %1</string>
</property>

View file

@ -69,6 +69,7 @@ void SnapmaticPicture::reset()
// INIT PIC
rawPicContent = "";
cachePicture = QImage();
jpegRawContentSizeE = 0;
jpegRawContentSize = 0;
picExportFileName = "";
isCustomFormat = 0;
@ -105,7 +106,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
if (!picFile->open(QFile::ReadOnly))
{
lastStep = "1;/1,OpenFile," + StringParser::convertDrawStringForLog(picFilePath);
picFile->deleteLater();
delete picFile;
return false;
}
@ -190,7 +190,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
{
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",1,NOHEADER";
picStream->close();
picStream->deleteLater();
delete picStream;
return false;
}
@ -202,7 +201,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
{
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",2,NOHEADER";
picStream->close();
picStream->deleteLater();
delete picStream;
return false;
}
@ -214,7 +212,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
{
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",2,NOJPEG";
picStream->close();
picStream->deleteLater();
delete picStream;
return false;
}
@ -224,7 +221,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
{
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",2,NOPIC";
picStream->close();
picStream->deleteLater();
delete picStream;
return false;
}
@ -232,6 +228,7 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
if (jpegRawContent.contains(QByteArray::fromHex("FFD9")))
{
int jpegRawContentSizeT = jpegRawContent.indexOf(QByteArray::fromHex("FFD9")) + 2;
jpegRawContentSizeE = jpegRawContentSizeT;
jpegRawContentSize = jpegRawContentSizeT;
if (jpegRawContent.contains(QByteArray::fromHex("FF454F49")))
{
@ -267,7 +264,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
{
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",3,NOJSON";
picStream->close();
picStream->deleteLater();
delete picStream;
return false;
}
@ -275,7 +271,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
{
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",3,CTJSON";
picStream->close();
picStream->deleteLater();
delete picStream;
return false;
}
@ -287,7 +282,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
{
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",4,NOTITL";
picStream->close();
picStream->deleteLater();
delete picStream;
return false;
}
@ -295,7 +289,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
{
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",4,CTTITL";
picStream->close();
picStream->deleteLater();
delete picStream;
return false;
}
@ -306,7 +299,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
{
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",5,NODESC";
picStream->close();
picStream->deleteLater();
delete picStream;
return picOk;
}
@ -314,7 +306,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
{
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",5,CTDESC";
picStream->close();
picStream->deleteLater();
delete picStream;
return false;
}
@ -324,7 +315,6 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
updateStrings();
picStream->close();
picStream->deleteLater();
delete picStream;
if (!writeEnabled) { rawPicContent.clear(); }
return picOk;
@ -577,7 +567,6 @@ QImage SnapmaticPicture::getImage()
if (!picFile->open(QFile::ReadOnly))
{
lastStep = "1;/1,OpenFile," + StringParser::convertDrawStringForLog(picFilePath);
picFile->deleteLater();
delete picFile;
return QImage(0, 0, QImage::Format_RGB888);
}
@ -766,19 +755,12 @@ bool SnapmaticPicture::setSnapmaticProperties(SnapmaticProperties newSpJson)
// FILE MANAGEMENT
bool SnapmaticPicture::exportPicture(const QString &fileName, bool customFormat)
bool SnapmaticPicture::exportPicture(const QString &fileName, const QString format)
{
QFile *picFile = new QFile(fileName);
if (picFile->open(QIODevice::WriteOnly))
{
if (!customFormat)
{
// Classic straight export
picFile->write(rawPicContent);
picFile->close();
picFile->deleteLater();
}
else
if (format == "G5E")
{
// Modern compressed export
QByteArray stockFileNameUTF8 = picFileName.toUtf8();
@ -801,7 +783,31 @@ bool SnapmaticPicture::exportPicture(const QString &fileName, bool customFormat)
picFile->write("COM"); // Before Compressed
picFile->write(qCompress(rawPicContent, 9)); // Compressed Snapmatic
picFile->close();
picFile->deleteLater();
delete picFile;
}
else if (format == "JPG")
{
// JPEG export
QBuffer snapmaticStream(&rawPicContent);
snapmaticStream.open(QIODevice::ReadOnly);
if (snapmaticStream.seek(jpegStreamEditorBegin))
{
QByteArray jpegRawContent = snapmaticStream.read(jpegPicStreamLength);
if (jpegRawContentSizeE != 0)
{
jpegRawContent = jpegRawContent.left(jpegRawContentSizeE);
}
picFile->write(jpegRawContent);
}
picFile->close();
delete picFile;
}
else
{
// Classic straight export
picFile->write(rawPicContent);
picFile->close();
delete picFile;
}
return true;
}

View file

@ -75,7 +75,7 @@ public:
void emitUpdate();
// FILE MANAGEMENT
bool exportPicture(const QString &fileName, bool customFormat = false);
bool exportPicture(const QString &fileName, const QString format = "PGTA");
void setPicFileName(const QString &picFileName);
void setPicFilePath(const QString &picFilePath);
bool deletePicFile();
@ -122,6 +122,7 @@ private:
bool cacheEnabled;
bool isCustomFormat;
int jpegRawContentSize;
int jpegRawContentSizeE;
// PICTURE STREAM
QByteArray rawPicContent;

View file

@ -125,11 +125,16 @@ void SnapmaticWidget::on_cmdView_clicked()
if (navigationBar) picDialog->addPreviousNextButtons();
// show picture dialog
#ifdef Q_OS_ANDROID
// Android ...
picDialog->showMaximized();
#else
picDialog->show();
if (navigationBar) picDialog->stylizeDialog();
//picDialog->adaptNewDialogSize();
picDialog->setMinimumSize(picDialog->size());
picDialog->setMaximumSize(picDialog->size());
#endif
picDialog->exec();
delete picDialog;
}
@ -283,7 +288,7 @@ void SnapmaticWidget::makePictureVisibleSlot()
void SnapmaticWidget::editSnapmaticProperties()
{
SnapmaticEditor *snapmaticEditor = new SnapmaticEditor(this);
SnapmaticEditor *snapmaticEditor = new SnapmaticEditor(crewDB, this);
snapmaticEditor->setWindowFlags(snapmaticEditor->windowFlags()^Qt::WindowContextHelpButtonHint);
snapmaticEditor->setSnapmaticPicture(smpic);
snapmaticEditor->setModal(true);

View file

@ -19,7 +19,9 @@
#include "StringParser.h"
#include "config.h"
#include <QTextDocument>
#ifndef GTA5VIEW_CMD
#include <QApplication>
#endif
#include <QTextCodec>
#include <QByteArray>
#include <QFileInfo>
@ -52,6 +54,7 @@ QString StringParser::convertLogStringForDraw(const QString &inputStr)
return outputStr.replace("&c;",",").replace("&u;","&");
}
#ifndef GTA5VIEW_CMD
QString StringParser::convertBuildedString(const QString &buildedStr)
{
QString outputStr = buildedStr;
@ -61,6 +64,7 @@ QString StringParser::convertBuildedString(const QString &buildedStr)
outputStr.replace("$SEPARATOR", QDir::separator());
return outputStr;
}
#endif
QString StringParser::escapeString(const QString &toEscape)
{

View file

@ -29,7 +29,9 @@ public:
static QString parseTitleString(const QByteArray &commitBytes, int maxLength);
static QString convertDrawStringForLog(const QString &inputStr);
static QString convertLogStringForDraw(const QString &inputStr);
#ifndef GTA5VIEW_CMD
static QString convertBuildedString(const QString &buildedStr);
#endif
static QString escapeString(const QString &toEscape);
};

View file

@ -68,13 +68,13 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, D
}
if (QIcon::hasThemeIcon("preferences-system"))
{
#ifndef Q_WS_MAC // Setting icon for preferences/settings/options lead to a crash in Mac OS X
#ifndef Q_OS_MACOS // Setting icon for preferences/settings/options lead to a crash in Mac OS X
ui->actionOptions->setIcon(QIcon::fromTheme("preferences-system"));
#endif
}
if (QIcon::hasThemeIcon("application-exit"))
{
#ifndef Q_WS_MAC // Setting icon for exit/quit lead to a crash in Mac OS X
#ifndef Q_OS_MACOS // Setting icon for exit/quit lead to a crash in Mac OS X
ui->actionExit->setIcon(QIcon::fromTheme("application-exit"));
#endif
}
@ -249,7 +249,12 @@ void UserInterface::on_actionAbout_gta5sync_triggered()
AboutDialog *aboutDialog = new AboutDialog(this);
aboutDialog->setWindowIcon(windowIcon());
aboutDialog->setModal(true);
#ifdef Q_OS_ANDROID
// Android ...
aboutDialog->showMaximized();
#else
aboutDialog->show();
#endif
aboutDialog->exec();
delete aboutDialog;
}
@ -300,7 +305,12 @@ void UserInterface::on_actionOptions_triggered()
QObject::connect(optionsDialog, SIGNAL(settingsApplied(int, QString)), this, SLOT(settingsApplied(int, QString)));
optionsDialog->setModal(true);
#ifdef Q_OS_ANDROID
// Android ...
optionsDialog->showMaximized();
#else
optionsDialog->show();
#endif
optionsDialog->exec();
delete optionsDialog;
@ -437,9 +447,14 @@ void UserInterface::openSnapmaticFile(SnapmaticPicture *picture)
QObject::connect(threadDB, SIGNAL(playerNameFound(int, QString)), profileDB, SLOT(setPlayerName(int, QString)));
QObject::connect(threadDB, SIGNAL(playerNameUpdated()), &picDialog, SLOT(playerNameUpdated()));
#ifdef Q_OS_ANDROID
// Android optimization should be put here
picDialog.showMaximized();
#else
picDialog.show();
picDialog.setMinimumSize(picDialog.size());
picDialog.setMaximumSize(picDialog.size());
#endif
picDialog.exec();
}
@ -449,7 +464,12 @@ void UserInterface::openSavegameFile(SavegameData *savegame)
SavegameDialog sgdDialog(this);
sgdDialog.setSavegameData(savegame, savegame->getSavegameFileName(), true);
sgdDialog.setModal(true);
#ifdef Q_OS_ANDROID
// Android optimization should be put here
sgdDialog.showMaximized();
#else
sgdDialog.show();
#endif
sgdDialog.exec();
}

View file

@ -50,7 +50,7 @@
#ifndef GTA5SYNC_APPVER
#ifndef GTA5SYNC_DAILYB
#define GTA5SYNC_APPVER "1.4.0-dev2"
#define GTA5SYNC_APPVER "1.4.0-dev3"
#else
#define GTA5SYNC_APPVER QString("%1").arg(GTA5SYNC_DAILYB)
#endif

View file

@ -480,7 +480,11 @@ int main(int argc, char *argv[])
UserInterface uiWindow(&profileDB, &crewDB, &threadDB);
uiWindow.setWindowIcon(IconLoader::loadingAppIcon());
uiWindow.setupDirEnv();
#ifdef Q_OS_ANDROID
uiWindow.showMaximized();
#else
uiWindow.show();
#endif
threadLoop.exec();

View file

@ -25,12 +25,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Syping"
VALUE "FileDescription", "gta5view\0"
VALUE "FileVersion", "1.4.0-dev2\0"
VALUE "FileVersion", "1.4.0-dev3\0"
VALUE "InternalName", "gta5view\0"
VALUE "LegalCopyright", "Copyright © 2016-2017 Syping\0"
VALUE "OriginalFilename", "gta5view.exe\0"
VALUE "ProductName", "gta5view\0"
VALUE "ProductVersion", "1.4.0-dev2\0"
VALUE "ProductVersion", "1.4.0-dev3\0"
END
END
END

Binary file not shown.

View file

@ -103,20 +103,34 @@ Copyright &amp;copy; &lt;a href=&quot;%5&quot;&gt;%6&lt;/a&gt; %7&lt;br/&gt;%8 i
<translation type="obsolete">&lt;span style=&quot; font-weight:600;&quot;&gt;gta5sync&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;Ein Projekt zum ansehen und synchronisieren von Grand Theft Auto 5 Snapmatic Bilder und Spielständen&lt;br/&gt;&lt;br/&gt;Projektversion: %1&lt;br/&gt;Gebaut mit Qt %2&lt;br/&gt;Läuft auf Qt %3&lt;br/&gt;&lt;br/&gt;Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping&lt;/a&gt; 2016&lt;br/&gt;gta5sync is lizenziert unter &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html#content&quot;&gt;GNU GPLv3&lt;/a&gt;</translation>
</message>
<message>
<location filename="../AboutDialog.cpp" line="39"/>
<location filename="../AboutDialog.cpp" line="40"/>
<source>A project for viewing Grand Theft Auto V Snapmatic&lt;br/&gt;
Pictures and Savegames</source>
<translation>Ein Projekt zum ansehen von Grand Theft Auto V&lt;br/&gt;
Snapmatic Bilder und Spielständen</translation>
</message>
<message>
<location filename="../AboutDialog.cpp" line="37"/>
<location filename="../AboutDialog.cpp" line="38"/>
<source>A project for viewing and sync Grand Theft Auto V Snapmatic&lt;br/&gt;
Pictures and Savegames</source>
<translation>Ein Projekt zum ansehen und synchronisieren von&lt;br/&gt;
Grand Theft Auto V Snapmatic Bilder und Spielständen</translation>
</message>
</context>
<context>
<name>CrewDatabase</name>
<message>
<location filename="../CrewDatabase.cpp" line="64"/>
<source>No Crew</source>
<translation>Keine Crew</translation>
</message>
<message>
<source>Free</source>
<comment>Crew Free (means no crew)</comment>
<translatorcomment>Crew Keine (bedeutet keine Crew)</translatorcomment>
<translation type="vanished">Keine</translation>
</message>
</context>
<context>
<name>ExportDialog</name>
<message>
@ -421,26 +435,26 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen</translation>
<translation type="obsolete">%1 (%2 wenn verfügbar) [sys]</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="125"/>
<location filename="../OptionsDialog.cpp" line="129"/>
<source>System</source>
<comment>System like PC System</comment>
<translation>System</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="125"/>
<location filename="../OptionsDialog.cpp" line="129"/>
<source>%1 (%2 if available)</source>
<comment>System like PC System = %1, System Language like Deutsch = %2</comment>
<translation>%1 (%2 wenn verfügbar)</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="284"/>
<location filename="../OptionsDialog.cpp" line="288"/>
<location filename="../OptionsDialog.cpp" line="292"/>
<source>%1</source>
<comment>%1</comment>
<translation>%1</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="284"/>
<location filename="../OptionsDialog.cpp" line="288"/>
<source>The new Custom Folder will initialize after you restart %1.</source>
<translation>Der eigene Ordner wird initialisiert sobald du %1 neugestartet hast.</translation>
</message>
@ -449,20 +463,20 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen</translation>
<translation type="vanished">Der eigene Ordner initialisiert sobald du %1 neugestartet hast.</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="288"/>
<location filename="../OptionsDialog.cpp" line="292"/>
<source>The language change will take effect after you restart %1.</source>
<translation>Die Änderung der Sprache nimmt Effekt sobald du %1 neugestartet hast.</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="298"/>
<location filename="../OptionsDialog.cpp" line="302"/>
<source>No Profile</source>
<comment>No Profile, as default</comment>
<translation>Kein Profil</translation>
</message>
<message>
<location filename="../OptionsDialog.cpp" line="306"/>
<location filename="../OptionsDialog.cpp" line="310"/>
<location filename="../OptionsDialog.cpp" line="312"/>
<location filename="../OptionsDialog.cpp" line="314"/>
<location filename="../OptionsDialog.cpp" line="316"/>
<source>Profile: %1</source>
<translation>Profil: %1</translation>
</message>
@ -511,7 +525,6 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen</translation>
</message>
<message>
<location filename="../PictureDialog.ui" line="167"/>
<location filename="../PictureExport.cpp" line="221"/>
<source>&amp;Export</source>
<translation>&amp;Exportieren</translation>
</message>
@ -546,6 +559,7 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen</translation>
</message>
<message>
<location filename="../PictureExport.cpp" line="89"/>
<location filename="../PictureExport.cpp" line="221"/>
<source>Export</source>
<translation>Exportieren</translation>
</message>
@ -559,17 +573,17 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen</translation>
<translation>Schließen</translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="128"/>
<location filename="../PictureDialog.cpp" line="132"/>
<source>Export as &amp;JPG picture...</source>
<translation>Exportiere als &amp;JPG Bild...</translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="129"/>
<location filename="../PictureDialog.cpp" line="133"/>
<source>Export as &amp;GTA Snapmatic...</source>
<translation>Exportiere als &amp;GTA Snapmatic...</translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="343"/>
<location filename="../PictureDialog.cpp" line="347"/>
<source>Key 1 - Avatar Preview Mode
Key 2 - Toggle Overlay
Arrow Keys - Navigate</source>
@ -578,19 +592,19 @@ Taste 2 - Overlay umschalten
Pfeiltasten - Navigieren</translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="402"/>
<location filename="../PictureDialog.cpp" line="474"/>
<location filename="../PictureDialog.cpp" line="406"/>
<location filename="../PictureDialog.cpp" line="478"/>
<source>Snapmatic Picture Viewer</source>
<translation>Snapmatic Bildansicht</translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="402"/>
<location filename="../PictureDialog.cpp" line="474"/>
<location filename="../PictureDialog.cpp" line="406"/>
<location filename="../PictureDialog.cpp" line="478"/>
<source>Failed at %1</source>
<translation>Fehlgeschlagen bei %1</translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="529"/>
<location filename="../PictureDialog.cpp" line="533"/>
<source>Avatar Preview Mode
Press 1 for Default View</source>
<translation>Avatar Vorschaumodus
@ -627,19 +641,19 @@ Drücke A für Standardansicht</translation>
<translation type="vanished">Avatar Vorschaumodus&lt;br&gt;Drücke A für Standardansicht</translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="463"/>
<location filename="../PictureDialog.cpp" line="473"/>
<location filename="../PictureDialog.cpp" line="467"/>
<location filename="../PictureDialog.cpp" line="477"/>
<source>No player</source>
<translation>Keine Spieler</translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="466"/>
<location filename="../PictureDialog.cpp" line="473"/>
<location filename="../PictureDialog.cpp" line="470"/>
<location filename="../PictureDialog.cpp" line="477"/>
<source>No crew</source>
<translation>Keine Crew</translation>
</message>
<message>
<location filename="../PictureDialog.cpp" line="473"/>
<location filename="../PictureDialog.cpp" line="477"/>
<source>Unknown Location</source>
<translation>Unbekannter Standort</translation>
</message>
@ -786,27 +800,27 @@ Drücke A für Standardansicht</translation>
<translation>Lade Datei %1 von %2 Dateien</translation>
</message>
<message>
<location filename="../ProfileInterface.ui" line="169"/>
<location filename="../ProfileInterface.ui" line="166"/>
<source>%1 %2</source>
<translation>%1 %2</translation>
</message>
<message>
<location filename="../ProfileInterface.ui" line="195"/>
<location filename="../ProfileInterface.ui" line="192"/>
<source>Import exported file</source>
<translation>Importiere exportierte Datei</translation>
</message>
<message>
<location filename="../ProfileInterface.ui" line="198"/>
<location filename="../ProfileInterface.ui" line="195"/>
<source>&amp;Import...</source>
<translation>&amp;Importieren...</translation>
</message>
<message>
<location filename="../ProfileInterface.ui" line="214"/>
<location filename="../ProfileInterface.ui" line="211"/>
<source>Close profile</source>
<translation>Profil schließen</translation>
</message>
<message>
<location filename="../ProfileInterface.ui" line="217"/>
<location filename="../ProfileInterface.ui" line="214"/>
<source>&amp;Close</source>
<translation>S&amp;chließen</translation>
</message>
@ -827,29 +841,29 @@ Drücke A für Standardansicht</translation>
<translation type="obsolete">Profil schließen</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="111"/>
<location filename="../ProfileInterface.cpp" line="108"/>
<source>Loading...</source>
<translation>Lade...</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="369"/>
<location filename="../ProfileInterface.cpp" line="406"/>
<location filename="../ProfileInterface.cpp" line="384"/>
<location filename="../ProfileInterface.cpp" line="421"/>
<source>Import...</source>
<translation>Importieren...</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="370"/>
<location filename="../ProfileInterface.cpp" line="460"/>
<location filename="../ProfileInterface.cpp" line="465"/>
<location filename="../ProfileInterface.cpp" line="492"/>
<location filename="../ProfileInterface.cpp" line="508"/>
<location filename="../ProfileInterface.cpp" line="658"/>
<location filename="../ProfileInterface.cpp" line="663"/>
<location filename="../ProfileInterface.cpp" line="681"/>
<location filename="../ProfileInterface.cpp" line="686"/>
<location filename="../ProfileInterface.cpp" line="697"/>
<location filename="../ProfileInterface.cpp" line="734"/>
<location filename="../ProfileInterface.cpp" line="740"/>
<location filename="../ProfileInterface.cpp" line="385"/>
<location filename="../ProfileInterface.cpp" line="475"/>
<location filename="../ProfileInterface.cpp" line="480"/>
<location filename="../ProfileInterface.cpp" line="507"/>
<location filename="../ProfileInterface.cpp" line="523"/>
<location filename="../ProfileInterface.cpp" line="673"/>
<location filename="../ProfileInterface.cpp" line="678"/>
<location filename="../ProfileInterface.cpp" line="696"/>
<location filename="../ProfileInterface.cpp" line="701"/>
<location filename="../ProfileInterface.cpp" line="712"/>
<location filename="../ProfileInterface.cpp" line="749"/>
<location filename="../ProfileInterface.cpp" line="755"/>
<source>Import</source>
<translation>Importieren</translation>
</message>
@ -858,41 +872,41 @@ Drücke A für Standardansicht</translation>
<translation type="vanished">Alle Profildateien (SGTA* PGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="373"/>
<location filename="../ProfileInterface.cpp" line="388"/>
<source>Importable files (*.g5e *.jpg *.png SGTA* PGTA*)</source>
<translation>Importfähige Dateien (*.g5e *.jpg *.png SGTA* PGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="375"/>
<location filename="../UserInterface.cpp" line="335"/>
<location filename="../ProfileInterface.cpp" line="390"/>
<location filename="../UserInterface.cpp" line="344"/>
<source>Savegames files (SGTA*)</source>
<translation>Spielstanddateien (SGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="376"/>
<location filename="../UserInterface.cpp" line="336"/>
<location filename="../ProfileInterface.cpp" line="391"/>
<location filename="../UserInterface.cpp" line="345"/>
<source>Snapmatic pictures (PGTA*)</source>
<translation>Snapmatic Bilder (PGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="377"/>
<location filename="../ProfileInterface.cpp" line="392"/>
<source>All image files (*.jpg *.png)</source>
<translation>Alle Bilddateien (*.jpg *.png)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="378"/>
<location filename="../UserInterface.cpp" line="337"/>
<location filename="../ProfileInterface.cpp" line="393"/>
<location filename="../UserInterface.cpp" line="346"/>
<source>All files (**)</source>
<translation>Alle Dateien (**)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="407"/>
<location filename="../ProfileInterface.cpp" line="422"/>
<location filename="../ProfileInterface.cpp" line="437"/>
<source>Import file %1 of %2 files</source>
<translation>Importiere Datei %1 von %2 Dateien</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="460"/>
<location filename="../ProfileInterface.cpp" line="475"/>
<source>Import failed with...
%1</source>
@ -901,46 +915,46 @@ Drücke A für Standardansicht</translation>
%1</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="492"/>
<location filename="../UserInterface.cpp" line="377"/>
<location filename="../ProfileInterface.cpp" line="507"/>
<location filename="../UserInterface.cpp" line="386"/>
<source>Failed to read Snapmatic picture</source>
<translation>Fehler beim Lesen vom Snapmatic Bild</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="508"/>
<location filename="../UserInterface.cpp" line="393"/>
<location filename="../ProfileInterface.cpp" line="523"/>
<location filename="../UserInterface.cpp" line="402"/>
<source>Failed to read Savegame file</source>