diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index dd840df..8cb3cb0 100755 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -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; + +} diff --git a/ProfileInterface.ui b/ProfileInterface.ui index 4449ddb..ee55804 100755 --- a/ProfileInterface.ui +++ b/ProfileInterface.ui @@ -13,67 +13,71 @@ <property name="windowTitle"> <string>Profile Interface</string> </property> - <widget class="QWidget" name="horizontalLayoutWidget"> - <property name="geometry"> - <rect> - <x>10</x> - <y>110</y> - <width>400</width> - <height>300</height> - </rect> + <layout class="QVBoxLayout" name="vlProfileInterface"> + <property name="leftMargin"> + <number>0</number> </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> - <item> - <widget class="QLabel" name="labInformation"> - <property name="text"> - <string><span style=" font-weight:600;">GTA V Snapmatic Picture:</span> PHOTO - 01/01/01 - 22:04:11</string> + <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>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="labProfileContent"> + <property name="text"> + <string>Content of Profile %1</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <spacer name="vsContent"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + </layout> </widget> - </item> - <item> - <spacer name="hsInformation"> - <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="cmdClose"> - <property name="text"> - <string>Close Profile</string> - </property> - </widget> - </item> - </layout> - </widget> + </widget> + </item> + </layout> </widget> <resources/> <connections/> diff --git a/SavegameWidget.cpp b/SavegameWidget.cpp new file mode 100755 index 0000000..a13f1da --- /dev/null +++ b/SavegameWidget.cpp @@ -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; +} diff --git a/SavegameWidget.h b/SavegameWidget.h new file mode 100755 index 0000000..203b530 --- /dev/null +++ b/SavegameWidget.h @@ -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 diff --git a/SavegameWidget.ui b/SavegameWidget.ui new file mode 100755 index 0000000..d3f89c8 --- /dev/null +++ b/SavegameWidget.ui @@ -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> diff --git a/SnapmaticWidget.cpp b/SnapmaticWidget.cpp new file mode 100755 index 0000000..c8503ad --- /dev/null +++ b/SnapmaticWidget.cpp @@ -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; +} diff --git a/SnapmaticWidget.h b/SnapmaticWidget.h new file mode 100755 index 0000000..eac8ea6 --- /dev/null +++ b/SnapmaticWidget.h @@ -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 diff --git a/SnapmaticWidget.ui b/SnapmaticWidget.ui new file mode 100755 index 0000000..1065636 --- /dev/null +++ b/SnapmaticWidget.ui @@ -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> diff --git a/UserInterface.cpp b/UserInterface.cpp index 4b568b5..c1becde 100755 --- a/UserInterface.cpp +++ b/UserInterface.cpp @@ -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); diff --git a/UserInterface.h b/UserInterface.h index 6e7718c..508dee2 100755 --- a/UserInterface.h +++ b/UserInterface.h @@ -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 diff --git a/UserInterface.ui b/UserInterface.ui index 39b7912..1ed7b34 100755 --- a/UserInterface.ui +++ b/UserInterface.ui @@ -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"> diff --git a/gta5sync.pro b/gta5sync.pro index 49d7662..d38c25b 100755 --- a/gta5sync.pro +++ b/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 diff --git a/main.cpp b/main.cpp index 45836f8..3408827 100755 --- a/main.cpp +++ b/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; } } } }