picture parsing is now on Thread, design changes

This commit is contained in:
Rafael 2016-03-27 09:52:23 +02:00
parent e7a878c36a
commit 7d099291ad
48 changed files with 235 additions and 128 deletions

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -38,7 +38,7 @@ CrewDatabase::CrewDatabase(QObject *parent) : QObject(parent)
QString dirPath = dir.absolutePath(); QString dirPath = dir.absolutePath();
QString defaultConfPath = dirPath + "/crews.ini"; QString defaultConfPath = dirPath + "/crews.ini";
QSettings confPathSettings("Syping Gaming Team","gta5sync"); QSettings confPathSettings("Syping","gta5sync");
confPathSettings.beginGroup("Database"); confPathSettings.beginGroup("Database");
QString confPathFile = confPathSettings.value("Location", defaultConfPath).toString(); QString confPathFile = confPathSettings.value("Location", defaultConfPath).toString();
confPathSettings.endGroup(); confPathSettings.endGroup();

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -68,7 +68,7 @@ void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, bool readOk)
if (picture->isPicOk()) if (picture->isPicOk())
{ {
ui->labPicture->setPixmap(picture->getPixmap()); ui->labPicture->setPixmap(QPixmap::fromImage(picture->getPicture(), Qt::AutoColor));
ui->cmdExport->setEnabled(true); ui->cmdExport->setEnabled(true);
} }
if (picture->isJsonOk()) if (picture->isJsonOk())

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -38,7 +38,7 @@ ProfileDatabase::ProfileDatabase(QObject *parent) : QObject(parent)
QString dirPath = dir.absolutePath(); QString dirPath = dir.absolutePath();
QString defaultConfPath = dirPath + "/players.ini"; QString defaultConfPath = dirPath + "/players.ini";
QSettings confPathSettings("Syping Gaming Team","gta5sync"); QSettings confPathSettings("Syping","gta5sync");
confPathSettings.beginGroup("Database"); confPathSettings.beginGroup("Database");
QString confPathFile = confPathSettings.value("Location", defaultConfPath).toString(); QString confPathFile = confPathSettings.value("Location", defaultConfPath).toString();
confPathSettings.endGroup(); confPathSettings.endGroup();

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,6 +20,7 @@
#include "ui_ProfileInterface.h" #include "ui_ProfileInterface.h"
#include "SnapmaticWidget.h" #include "SnapmaticWidget.h"
#include "SavegameWidget.h" #include "SavegameWidget.h"
#include "ProfileLoader.h"
#include <QSpacerItem> #include <QSpacerItem>
#include <QFileInfo> #include <QFileInfo>
#include <QRegExp> #include <QRegExp>
@ -50,42 +51,26 @@ void ProfileInterface::setProfileFolder(QString folder, QString profile)
void ProfileInterface::setupProfileInterface() void ProfileInterface::setupProfileInterface()
{ {
QDir profileDir;
profileDir.setPath(profileFolder);
ui->labProfileContent->setText(contentStr.arg(profileName)); ui->labProfileContent->setText(contentStr.arg(profileName));
profileDir.setNameFilters(QStringList("PGTA*")); ProfileLoader *profileLoader = new ProfileLoader(profileFolder, crewDB);
QStringList SnapmaticPics = profileDir.entryList(QDir::Files | QDir::NoDot, QDir::NoSort); QObject::connect(profileLoader, SIGNAL(savegameLoaded(SavegameData*, QString)), this, SLOT(on_savegameLoaded(SavegameData*, QString)));
foreach(const QString &SnapmaticPic, SnapmaticPics) QObject::connect(profileLoader, SIGNAL(pictureLoaded(SnapmaticPicture*, QString)), this, SLOT(on_pictureLoaded(SnapmaticPicture*, QString)));
{ profileLoader->start();
QString picturePath = profileFolder + "/" + SnapmaticPic; }
SnapmaticPicture *picture = new SnapmaticPicture(picturePath);
if (picture->readingPicture()) void ProfileInterface::on_savegameLoaded(SavegameData *savegame, QString savegamePath)
{ {
SavegameWidget *sgdWidget = new SavegameWidget();
sgdWidget->setSavegameData(savegame, savegamePath);
ui->vlSavegame->addWidget(sgdWidget);
}
void ProfileInterface::on_pictureLoaded(SnapmaticPicture *picture, QString picturePath)
{
SnapmaticWidget *picWidget = new SnapmaticWidget(profileDB); SnapmaticWidget *picWidget = new SnapmaticWidget(profileDB);
picWidget->setSnapmaticPicture(picture, picturePath); picWidget->setSnapmaticPicture(picture, picturePath);
ui->vlSnapmatic->addWidget(picWidget); ui->vlSnapmatic->addWidget(picWidget);
crewDB->addCrew(picture->getCrewNumber());
}
}
QSpacerItem *snapmaticSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
ui->vlSnapmatic->addSpacerItem(snapmaticSpacer);
profileDir.setNameFilters(QStringList("SGTA*"));
QStringList SavegameFiles = profileDir.entryList(QDir::Files | QDir::NoDot, QDir::NoSort);
foreach(const QString &SavegameFile, SavegameFiles)
{
QString sgdPath = profileFolder + "/" + SavegameFile;
SavegameData *savegame = new SavegameData(sgdPath);
if (savegame->readingSavegame())
{
SavegameWidget *sgdWidget = new SavegameWidget();
sgdWidget->setSavegameData(savegame, sgdPath);
ui->vlSavegame->addWidget(sgdWidget);
}
}
QSpacerItem *savegameSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
ui->vlSavegame->addSpacerItem(savegameSpacer);
} }
void ProfileInterface::on_cmdCloseProfile_clicked() void ProfileInterface::on_cmdCloseProfile_clicked()

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -19,7 +19,9 @@
#ifndef PROFILEINTERFACE_H #ifndef PROFILEINTERFACE_H
#define PROFILEINTERFACE_H #define PROFILEINTERFACE_H
#include "SnapmaticPicture.h"
#include "ProfileDatabase.h" #include "ProfileDatabase.h"
#include "SavegameData.h"
#include "CrewDatabase.h" #include "CrewDatabase.h"
#include <QWidget> #include <QWidget>
@ -38,6 +40,8 @@ public:
private slots: private slots:
void on_cmdCloseProfile_clicked(); void on_cmdCloseProfile_clicked();
void on_pictureLoaded(SnapmaticPicture *picture, QString picturePath);
void on_savegameLoaded(SavegameData *savegame, QString savegamePath);
private: private:
ProfileDatabase *profileDB; ProfileDatabase *profileDB;

View file

@ -64,13 +64,16 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="hlContent"> <layout class="QVBoxLayout" name="vlContent">
<item> <property name="spacing">
<layout class="QVBoxLayout" name="vlSnapmatic"/> <number>0</number>
</item> </property>
<item> <item>
<layout class="QVBoxLayout" name="vlSavegame"/> <layout class="QVBoxLayout" name="vlSavegame"/>
</item> </item>
<item>
<layout class="QVBoxLayout" name="vlSnapmatic"/>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

66
ProfileLoader.cpp Executable file
View file

@ -0,0 +1,66 @@
/*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#include "ProfileLoader.h"
#include "SnapmaticPicture.h"
#include "SavegameData.h"
#include "CrewDatabase.h"
#include <QStringList>
#include <QString>
#include <QFile>
#include <QDir>
ProfileLoader::ProfileLoader(QString profileFolder, CrewDatabase *crewDB, QObject *parent) : QThread(parent), profileFolder(profileFolder), crewDB(crewDB)
{
}
void ProfileLoader::run()
{
QDir profileDir;
profileDir.setPath(profileFolder);
profileDir.setNameFilters(QStringList("SGTA*"));
QStringList SavegameFiles = profileDir.entryList(QDir::Files | QDir::NoDot, QDir::NoSort);
QStringList BackupFiles = SavegameFiles.filter(".bak", Qt::CaseInsensitive);
foreach(const QString &BackupFile, BackupFiles)
{
SavegameFiles.removeAll(BackupFile);
}
foreach(const QString &SavegameFile, SavegameFiles)
{
QString sgdPath = profileFolder + "/" + SavegameFile;
SavegameData *savegame = new SavegameData(sgdPath);
if (savegame->readingSavegame())
{
emit savegameLoaded(savegame, sgdPath);
}
}
profileDir.setNameFilters(QStringList("PGTA*"));
QStringList SnapmaticPics = profileDir.entryList(QDir::Files | QDir::NoDot, QDir::NoSort);
foreach(const QString &SnapmaticPic, SnapmaticPics)
{
QString picturePath = profileFolder + "/" + SnapmaticPic;
SnapmaticPicture *picture = new SnapmaticPicture(picturePath);
if (picture->readingPicture())
{
emit pictureLoaded(picture, picturePath);
crewDB->addCrew(picture->getCrewNumber());
}
}
}

46
ProfileLoader.h Executable file
View file

@ -0,0 +1,46 @@
/*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef PROFILELOADER_H
#define PROFILELOADER_H
#include "SnapmaticPicture.h"
#include "SavegameData.h"
#include "CrewDatabase.h"
#include <QThread>
#include <QDir>
class ProfileLoader : public QThread
{
Q_OBJECT
public:
explicit ProfileLoader(QString profileFolder, CrewDatabase *crewDB, QObject *parent = 0);
protected:
void run();
private:
QString profileFolder;
CrewDatabase *crewDB;
signals:
void pictureLoaded(SnapmaticPicture *picture, QString picturePath);
void savegameLoaded(SavegameData *savegame, QString savegamePath);
};
#endif // PROFILELOADER_H

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -14,8 +14,24 @@
<string>Savegame Widget</string> <string>Savegame Widget</string>
</property> </property>
<layout class="QHBoxLayout" name="hlSavegameContent"> <layout class="QHBoxLayout" name="hlSavegameContent">
<item>
<widget class="QLabel" name="labSavegamePic">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="app.qrc">:/img/savegame.png</pixmap>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="labSavegameStr"> <widget class="QLabel" name="labSavegameStr">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>The Third Way (100%) - 00/00/00 00:00:00</string> <string>The Third Way (100%) - 00/00/00 00:00:00</string>
</property> </property>
@ -24,19 +40,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="hsSavegameWidget">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QPushButton" name="cmdCopy"> <widget class="QPushButton" name="cmdCopy">
<property name="text"> <property name="text">
@ -53,6 +56,8 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources>
<include location="app.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -21,8 +21,8 @@
#include <QJsonObject> #include <QJsonObject>
#include <QVariantMap> #include <QVariantMap>
#include <QJsonArray> #include <QJsonArray>
#include <QPixmap>
#include <QString> #include <QString>
#include <QImage>
#include <QFile> #include <QFile>
SnapmaticPicture::SnapmaticPicture(QString fileName, QObject *parent) : QObject(parent), picFileName(fileName) SnapmaticPicture::SnapmaticPicture(QString fileName, QObject *parent) : QObject(parent), picFileName(fileName)
@ -36,7 +36,7 @@ SnapmaticPicture::SnapmaticPicture(QString fileName, QObject *parent) : QObject(
jsonStreamLength = 3076; jsonStreamLength = 3076;
// INIT PIC // INIT PIC
cachePicture = QPixmap(0,0); cachePicture = QImage(0, 0, QImage::Format_RGB32);
pictureStr = ""; pictureStr = "";
lastStep = ""; lastStep = "";
picOk = 0; picOk = 0;
@ -95,7 +95,7 @@ bool SnapmaticPicture::readingPicture()
return false; return false;
} }
QByteArray jpegRawContent = picFile->read(jpegPicStreamLength); QByteArray jpegRawContent = picFile->read(jpegPicStreamLength);
picOk = cachePicture.loadFromData(jpegRawContent); picOk = cachePicture.loadFromData(jpegRawContent, "JPEG");
// Read JSON Stream // Read JSON Stream
if (!picFile->isReadable()) if (!picFile->isReadable())
@ -145,9 +145,9 @@ bool SnapmaticPicture::readingPictureFromFile(QString fileName)
} }
} }
void SnapmaticPicture::setPixmap(QPixmap pixmap) void SnapmaticPicture::setPicture(QImage picture)
{ {
cachePicture = pixmap; cachePicture = picture;
} }
QString SnapmaticPicture::getPictureStr() QString SnapmaticPicture::getPictureStr()
@ -160,7 +160,7 @@ QString SnapmaticPicture::getLastStep()
return lastStep; return lastStep;
} }
QPixmap SnapmaticPicture::getPixmap() QImage SnapmaticPicture::getPicture()
{ {
return cachePicture; return cachePicture;
} }

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -21,8 +21,8 @@
#include <QStringList> #include <QStringList>
#include <QObject> #include <QObject>
#include <QPixmap>
#include <QString> #include <QString>
#include <QImage>
#include <QFile> #include <QFile>
class SnapmaticPicture : public QObject class SnapmaticPicture : public QObject
@ -32,9 +32,9 @@ public:
explicit SnapmaticPicture(QString fileName = "", QObject *parent = 0); explicit SnapmaticPicture(QString fileName = "", QObject *parent = 0);
bool readingPictureFromFile(QString fileName); bool readingPictureFromFile(QString fileName);
bool readingPicture(); bool readingPicture();
void setPixmap(QPixmap pixmap); void setPicture(QImage picture);
bool isPicOk(); bool isPicOk();
QPixmap getPixmap(); QImage getPicture();
QString getLastStep(); QString getLastStep();
QString getPictureStr(); QString getPictureStr();
@ -52,7 +52,7 @@ private:
QString getSnapmaticJSONString(QByteArray jsonBytes); QString getSnapmaticJSONString(QByteArray jsonBytes);
QString convertDrawStringForLog(QString inputStr); QString convertDrawStringForLog(QString inputStr);
QString convertLogStringForDraw(QString inputStr); QString convertLogStringForDraw(QString inputStr);
QPixmap cachePicture; QImage cachePicture;
QString picFileName; QString picFileName;
QString pictureStr; QString pictureStr;
QString lastStep; QString lastStep;

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -38,7 +38,7 @@ SnapmaticWidget::~SnapmaticWidget()
void SnapmaticWidget::setSnapmaticPicture(SnapmaticPicture *picture, QString picturePath) void SnapmaticWidget::setSnapmaticPicture(SnapmaticPicture *picture, QString picturePath)
{ {
QPixmap SnapmaticPixmap = picture->getPixmap(); QPixmap SnapmaticPixmap = QPixmap::fromImage(picture->getPicture(), Qt::AutoColor);
SnapmaticPixmap.scaled(ui->labPicture->width(), ui->labPicture->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation); SnapmaticPixmap.scaled(ui->labPicture->width(), ui->labPicture->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->labPicStr->setText(picture->getPictureStr()); ui->labPicStr->setText(picture->getPictureStr());
ui->labPicture->setPixmap(SnapmaticPixmap); ui->labPicture->setPixmap(SnapmaticPixmap);

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -41,6 +41,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="labPicStr"> <widget class="QLabel" name="labPicStr">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>PHOTO - 00/00/00 00:00:00</string> <string>PHOTO - 00/00/00 00:00:00</string>
</property> </property>
@ -49,19 +55,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="hsView">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QPushButton" name="cmdView"> <widget class="QPushButton" name="cmdView">
<property name="text"> <property name="text">

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -40,7 +40,7 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, Q
ui->setupUi(this); ui->setupUi(this);
// init settings // init settings
QSettings SyncSettings("Syping Gaming Team", "gta5sync"); QSettings SyncSettings("Syping", "gta5sync");
SyncSettings.beginGroup("dir"); SyncSettings.beginGroup("dir");
bool forceDir = SyncSettings.value("force", false).toBool(); bool forceDir = SyncSettings.value("force", false).toBool();

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -6,14 +6,14 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>625</width>
<height>600</height> <height>500</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>800</width> <width>625</width>
<height>600</height> <height>500</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -48,7 +48,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>625</width>
<height>21</height> <height>21</height>
</rect> </rect>
</property> </property>

View file

@ -4,4 +4,7 @@
<file>qt_de.qm</file> <file>qt_de.qm</file>
<file>qtbase_de.qm</file> <file>qtbase_de.qm</file>
</qresource> </qresource>
<qresource prefix="/img">
<file>savegame.png</file>
</qresource>
</RCC> </RCC>

4
app.rc
View file

@ -19,11 +19,11 @@ BEGIN
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "CompanyName", "Syping Gaming Team\0" VALUE "CompanyName", "Syping"
VALUE "FileDescription", "Grand Theft Auto V Sync\0" VALUE "FileDescription", "Grand Theft Auto V Sync\0"
VALUE "FileVersion", "1.0.0.0\0" VALUE "FileVersion", "1.0.0.0\0"
VALUE "InternalName", "gta5sync\0" VALUE "InternalName", "gta5sync\0"
VALUE "LegalCopyright", "Copyright © 2015-2016 Syping Gaming Team\0" VALUE "LegalCopyright", "Copyright © 2015-2016 Syping\0"
VALUE "OriginalFilename", "gta5sync.exe\0" VALUE "OriginalFilename", "gta5sync.exe\0"
VALUE "ProductName", "Grand Theft Auto V Sync\0" VALUE "ProductName", "Grand Theft Auto V Sync\0"
VALUE "ProductVersion", "1.0.0.0\0" VALUE "ProductVersion", "1.0.0.0\0"

View file

@ -1,6 +1,6 @@
#/***************************************************************************** #/*****************************************************************************
#* gta5sync GRAND THEFT AUTO V SYNC #* gta5sync GRAND THEFT AUTO V SYNC
#* Copyright (C) 2015-2016 Syping Gaming Team #* Copyright (C) 2015-2016 Syping
#* #*
#* This program is free software: you can redistribute it and/or modify #* This program is free software: you can redistribute it and/or modify
#* it under the terms of the GNU General Public License as published by #* it under the terms of the GNU General Public License as published by
@ -37,7 +37,8 @@ SOURCES += main.cpp \
UserInterface.cpp \ UserInterface.cpp \
ProfileInterface.cpp \ ProfileInterface.cpp \
SnapmaticWidget.cpp \ SnapmaticWidget.cpp \
SavegameWidget.cpp SavegameWidget.cpp \
ProfileLoader.cpp
HEADERS += \ HEADERS += \
SnapmaticPicture.h \ SnapmaticPicture.h \
@ -51,7 +52,8 @@ HEADERS += \
UserInterface.h \ UserInterface.h \
ProfileInterface.h \ ProfileInterface.h \
SnapmaticWidget.h \ SnapmaticWidget.h \
SavegameWidget.h SavegameWidget.h \
ProfileLoader.h
FORMS += \ FORMS += \
PictureDialog.ui \ PictureDialog.ui \

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -40,7 +40,7 @@ int main(int argc, char *argv[])
a.setApplicationVersion("1.0.0"); a.setApplicationVersion("1.0.0");
// Loading translation settings // Loading translation settings
QSettings settings("Syping Gaming Team", "gta5sync"); QSettings settings("Syping", "gta5sync");
settings.beginGroup("Interface"); settings.beginGroup("Interface");
QString language = settings.value("Language","System").toString(); QString language = settings.value("Language","System").toString();
settings.endGroup(); settings.endGroup();

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping Gaming Team * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

BIN
savegame.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB