From a608702e69ec7b985b76e6a3fc3cf605af9ccdc6 Mon Sep 17 00:00:00 2001 From: Rafael Date: Fri, 25 Mar 2016 07:07:58 +0100 Subject: [PATCH] added snapmatic + savegame widget --- ProfileInterface.cpp | 9 ++++ ProfileInterface.ui | 120 ++++++++++++++++++++++--------------------- SavegameWidget.cpp | 32 ++++++++++++ SavegameWidget.h | 40 +++++++++++++++ SavegameWidget.ui | 58 +++++++++++++++++++++ SnapmaticWidget.cpp | 32 ++++++++++++ SnapmaticWidget.h | 42 +++++++++++++++ SnapmaticWidget.ui | 83 ++++++++++++++++++++++++++++++ UserInterface.cpp | 52 +++++++++++++++++++ UserInterface.h | 5 ++ UserInterface.ui | 2 +- gta5sync.pro | 12 +++-- main.cpp | 7 ++- 13 files changed, 428 insertions(+), 66 deletions(-) create mode 100755 SavegameWidget.cpp create mode 100755 SavegameWidget.h create mode 100755 SavegameWidget.ui create mode 100755 SnapmaticWidget.cpp create mode 100755 SnapmaticWidget.h create mode 100755 SnapmaticWidget.ui 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 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 @@ Profile Interface - - - - 10 - 110 - 400 - 300 - + + + 0 - - - 6 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - <span style=" font-weight:600;">GTA V Snapmatic Picture:</span> PHOTO - 01/01/01 - 22:04:11 + + 0 + + + 0 + + + 0 + + + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + true + + + + + 0 + 0 + 400 + 300 + + + + + + Content of Profile %1 + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + - - - - - Qt::Horizontal - - - - 0 - 0 - - - - - - - - View - - - - - - - Close Profile - - - - - + + + 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 . +*****************************************************************************/ + +#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 . +*****************************************************************************/ + +#ifndef SAVEGAMEWIDGET_H +#define SAVEGAMEWIDGET_H + +#include + +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 @@ + + + SavegameWidget + + + + 0 + 0 + 405 + 45 + + + + Savegame Widget + + + + + + The Third Way (100%) - 00/00/00 00:00:00 + + + true + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + + + Copy + + + + + + + Delete + + + + + + + + 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 . +*****************************************************************************/ + +#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 . +*****************************************************************************/ + +#ifndef SNAPMATICWIDGET_H +#define SNAPMATICWIDGET_H + +#include +#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 @@ + + + SnapmaticWidget + + + + 0 + 0 + 385 + 45 + + + + Snapmatic Widget + + + + + + + 48 + 27 + + + + + 48 + 27 + + + + 0 + + + + + + true + + + + + + + PHOTO - 00/00/00 00:00:00 + + + true + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + + + View + + + + + + + Delete + + + + + + + + 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 +#include +#include +#include +#include +#include + +#ifdef QT5_MODE +#include +#else +#include +#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 +#include +#include namespace Ui { class UserInterface; @@ -37,6 +39,9 @@ private slots: private: Ui::UserInterface *ui; + QString GTAV_Folder; + QString GTAV_ProfilesFolder; + QMap 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 @@ - Grand Theft Auto V Sync + GTA V Sync 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; } } } }