added snapmatic + savegame widget
This commit is contained in:
parent
9057b783e5
commit
a608702e69
13 changed files with 428 additions and 66 deletions
|
@ -18,6 +18,9 @@
|
|||
|
||||
#include "ProfileInterface.h"
|
||||
#include "ui_ProfileInterface.h"
|
||||
#include "SnapmaticWidget.h"
|
||||
#include "SavegameWidget.h"
|
||||
#include <QDir>
|
||||
|
||||
ProfileInterface::ProfileInterface(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
|
@ -31,3 +34,9 @@ ProfileInterface::~ProfileInterface()
|
|||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ProfileInterface::setProfileFolder(QString folder)
|
||||
{
|
||||
profileFolder = folder;
|
||||
|
||||
}
|
||||
|
|
|
@ -13,42 +13,57 @@
|
|||
<property name="windowTitle">
|
||||
<string>Profile Interface</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<layout class="QVBoxLayout" name="vlProfileInterface">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="saSnapmatic">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="saSnapmaticContent">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="hlInformation">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="labInformation">
|
||||
<widget class="QLabel" name="labProfileContent">
|
||||
<property name="text">
|
||||
<string><span style=" font-weight:600;">GTA V Snapmatic Picture:</span> PHOTO - 01/01/01 - 22:04:11</string>
|
||||
<string>Content of Profile %1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="hsInformation">
|
||||
<spacer name="vsContent">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -58,23 +73,12 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cmdView">
|
||||
<property name="text">
|
||||
<string>View</string>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cmdClose">
|
||||
<property name="text">
|
||||
<string>Close Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
32
SavegameWidget.cpp
Executable file
32
SavegameWidget.cpp
Executable file
|
@ -0,0 +1,32 @@
|
|||
/*****************************************************************************
|
||||
* gta5sync GRAND THEFT AUTO V SYNC
|
||||
* Copyright (C) 2016 Syping Gaming Team
|
||||
*
|
||||
* 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 "SavegameWidget.h"
|
||||
#include "ui_SavegameWidget.h"
|
||||
|
||||
SavegameWidget::SavegameWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::SavegameWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
SavegameWidget::~SavegameWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
40
SavegameWidget.h
Executable file
40
SavegameWidget.h
Executable file
|
@ -0,0 +1,40 @@
|
|||
/*****************************************************************************
|
||||
* gta5sync GRAND THEFT AUTO V SYNC
|
||||
* Copyright (C) 2016 Syping Gaming Team
|
||||
*
|
||||
* 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 SAVEGAMEWIDGET_H
|
||||
#define SAVEGAMEWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class SavegameWidget;
|
||||
}
|
||||
|
||||
class SavegameWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SavegameWidget(QWidget *parent = 0);
|
||||
~SavegameWidget();
|
||||
|
||||
private:
|
||||
Ui::SavegameWidget *ui;
|
||||
};
|
||||
|
||||
#endif // SAVEGAMEWIDGET_H
|
58
SavegameWidget.ui
Executable file
58
SavegameWidget.ui
Executable file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SavegameWidget</class>
|
||||
<widget class="QWidget" name="SavegameWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>405</width>
|
||||
<height>45</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Savegame Widget</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="labSavegameStr">
|
||||
<property name="text">
|
||||
<string>The Third Way (100%) - 00/00/00 00:00:00</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
<widget class="QPushButton" name="cmdCopy">
|
||||
<property name="text">
|
||||
<string>Copy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cmdDelete">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
32
SnapmaticWidget.cpp
Executable file
32
SnapmaticWidget.cpp
Executable file
|
@ -0,0 +1,32 @@
|
|||
/*****************************************************************************
|
||||
* gta5sync GRAND THEFT AUTO V SYNC
|
||||
* Copyright (C) 2016 Syping Gaming Team
|
||||
*
|
||||
* 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 "SnapmaticWidget.h"
|
||||
#include "ui_SnapmaticWidget.h"
|
||||
|
||||
SnapmaticWidget::SnapmaticWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::SnapmaticWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
SnapmaticWidget::~SnapmaticWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
42
SnapmaticWidget.h
Executable file
42
SnapmaticWidget.h
Executable file
|
@ -0,0 +1,42 @@
|
|||
/*****************************************************************************
|
||||
* gta5sync GRAND THEFT AUTO V SYNC
|
||||
* Copyright (C) 2016 Syping Gaming Team
|
||||
*
|
||||
* 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 SNAPMATICWIDGET_H
|
||||
#define SNAPMATICWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "SnapmaticPicture.h"
|
||||
|
||||
namespace Ui {
|
||||
class SnapmaticWidget;
|
||||
}
|
||||
|
||||
class SnapmaticWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SnapmaticWidget(QWidget *parent = 0);
|
||||
void setSnapmaticPicture(SnapmaticPicture *picutre, QString picturePath);
|
||||
~SnapmaticWidget();
|
||||
|
||||
private:
|
||||
Ui::SnapmaticWidget *ui;
|
||||
};
|
||||
|
||||
#endif // SNAPMATICWIDGET_H
|
83
SnapmaticWidget.ui
Executable file
83
SnapmaticWidget.ui
Executable file
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SnapmaticWidget</class>
|
||||
<widget class="QWidget" name="SnapmaticWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>385</width>
|
||||
<height>45</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Snapmatic Widget</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="labPicture">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>48</width>
|
||||
<height>27</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>48</width>
|
||||
<height>27</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labPicStr">
|
||||
<property name="text">
|
||||
<string>PHOTO - 00/00/00 00:00:00</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
<widget class="QPushButton" name="cmdView">
|
||||
<property name="text">
|
||||
<string>View</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cmdDelete">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -19,12 +19,64 @@
|
|||
#include "UserInterface.h"
|
||||
#include "ui_UserInterface.h"
|
||||
#include "ProfileInterface.h"
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
#include <QFileInfo>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QMap>
|
||||
|
||||
#ifdef QT5_MODE
|
||||
#include <QStandardPaths>
|
||||
#else
|
||||
#include <QDesktopServices>
|
||||
#endif
|
||||
|
||||
UserInterface::UserInterface(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::UserInterface)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// init settings
|
||||
QSettings SyncSettings("Syping Gaming Team", "gta5sync");
|
||||
SyncSettings.beginGroup("dir");
|
||||
bool forceDir = SyncSettings.value("force", false).toBool();
|
||||
|
||||
// init folder
|
||||
#ifdef QT5_MODE
|
||||
QString GTAV_defaultFolder = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "\\Rockstar Games\\GTA V";
|
||||
#else
|
||||
QString GTAV_defaultFolder = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation) + "\\Rockstar Games\\GTA V";
|
||||
#endif
|
||||
QDir GTAV_Dir;
|
||||
if (forceDir)
|
||||
{
|
||||
GTAV_Folder = SyncSettings.value("dir", GTAV_defaultFolder).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
GTAV_Folder = GTAV_defaultFolder;
|
||||
}
|
||||
GTAV_Dir.setPath(GTAV_Folder);
|
||||
if (GTAV_Dir.exists())
|
||||
{
|
||||
QDir::setCurrent(GTAV_Folder);
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::warning(this, tr("GTA V Sync"), tr("GTA V Folder not found!"));
|
||||
}
|
||||
|
||||
// profiles init
|
||||
QDir GTAV_ProfilesDir;
|
||||
GTAV_ProfilesFolder = GTAV_Folder + "\\Profiles";
|
||||
GTAV_ProfilesDir.setPath(GTAV_ProfilesFolder);
|
||||
|
||||
QStringList GTAV_Profiles = GTAV_ProfilesDir.entryList(QDir::NoFilter, QDir::NoSort);
|
||||
GTAV_Profiles.removeAll("..");
|
||||
GTAV_Profiles.removeAll(".");
|
||||
|
||||
ProfileInterface *profile1 = new ProfileInterface();
|
||||
ui->swProfile->addWidget(profile1);
|
||||
ui->swProfile->setCurrentWidget(profile1);
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
#define USERINTERFACE_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QString>
|
||||
#include <QMap>
|
||||
|
||||
namespace Ui {
|
||||
class UserInterface;
|
||||
|
@ -37,6 +39,9 @@ private slots:
|
|||
|
||||
private:
|
||||
Ui::UserInterface *ui;
|
||||
QString GTAV_Folder;
|
||||
QString GTAV_ProfilesFolder;
|
||||
QMap<QString, QString> GTAV_ProfileMap;
|
||||
};
|
||||
|
||||
#endif // USERINTERFACE_H
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Grand Theft Auto V Sync</string>
|
||||
<string>GTA V Sync</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="cwUI">
|
||||
<layout class="QVBoxLayout" name="vlUI">
|
||||
|
|
12
gta5sync.pro
12
gta5sync.pro
|
@ -35,7 +35,9 @@ SOURCES += main.cpp \
|
|||
SavegameDialog.cpp \
|
||||
SyncFramework.cpp \
|
||||
UserInterface.cpp \
|
||||
ProfileInterface.cpp
|
||||
ProfileInterface.cpp \
|
||||
SnapmaticWidget.cpp \
|
||||
SavegameWidget.cpp
|
||||
|
||||
HEADERS += \
|
||||
SnapmaticPicture.h \
|
||||
|
@ -47,13 +49,17 @@ HEADERS += \
|
|||
SavegameDialog.h \
|
||||
SyncFramework.h \
|
||||
UserInterface.h \
|
||||
ProfileInterface.h
|
||||
ProfileInterface.h \
|
||||
SnapmaticWidget.h \
|
||||
SavegameWidget.h
|
||||
|
||||
FORMS += \
|
||||
PictureDialog.ui \
|
||||
SavegameDialog.ui \
|
||||
UserInterface.ui \
|
||||
ProfileInterface.ui
|
||||
ProfileInterface.ui \
|
||||
SnapmaticWidget.ui \
|
||||
SavegameWidget.ui
|
||||
|
||||
TRANSLATIONS += \
|
||||
gta5sync_de.ts
|
||||
|
|
7
main.cpp
7
main.cpp
|
@ -39,12 +39,11 @@ int main(int argc, char *argv[])
|
|||
a.setApplicationName("gta5sync");
|
||||
a.setApplicationVersion("1.0.0");
|
||||
|
||||
// Loading translation settings
|
||||
QSettings settings("Syping Gaming Team", "gta5sync");
|
||||
settings.beginGroup("Interface");
|
||||
QString language = settings.value("Language","System").toString();
|
||||
settings.endGroup();
|
||||
|
||||
// Translate pre values
|
||||
bool trsf = false;
|
||||
bool svlp = false;
|
||||
|
||||
|
@ -62,7 +61,7 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
if (langList.at(0) != "en")
|
||||
{
|
||||
if (svlp) {trsf = true;}
|
||||
if (svlp) { trsf = true; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +69,7 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
if (langList.at(0) != "en")
|
||||
{
|
||||
if (svlp) {trsf = true;}
|
||||
if (svlp) { trsf = true; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue