diff --git a/frmGTA5Sync.cpp b/frmGTA5Sync.cpp index 8fb8ec6..5633eee 100755 --- a/frmGTA5Sync.cpp +++ b/frmGTA5Sync.cpp @@ -15,6 +15,10 @@ * limitations under the License. *****************************************************************************/ +#include +#include +#include +#include #include "frmGTA5Sync.h" #include "ui_frmGTA5Sync.h" @@ -23,6 +27,49 @@ frmGTA5Sync::frmGTA5Sync(QWidget *parent) : ui(new Ui::frmGTA5Sync) { ui->setupUi(this); + + // init settings + QSettings SyncSettings("Syping Gaming Team", "gta5sync"); + SyncSettings.beginGroup("dir"); + bool forceDir = SyncSettings.value("force", false).toBool(); + + // init folder + QString GTAV_defaultFolder = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation) + "\\Rockstar Games\\GTA V"; + 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 + { + qDebug() << "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("."); + + foreach(QString GTAV_Profile, GTAV_Profiles) + { + ui->cbProfile->addItem(GTAV_Profile); + } + + + } frmGTA5Sync::~frmGTA5Sync() diff --git a/frmGTA5Sync.h b/frmGTA5Sync.h index 7f0d1d3..b62be31 100755 --- a/frmGTA5Sync.h +++ b/frmGTA5Sync.h @@ -33,6 +33,8 @@ public: ~frmGTA5Sync(); private: + QString GTAV_Folder; + QString GTAV_ProfilesFolder; Ui::frmGTA5Sync *ui; }; diff --git a/frmGTA5Sync.ui b/frmGTA5Sync.ui index 1908779..d17697f 100755 --- a/frmGTA5Sync.ui +++ b/frmGTA5Sync.ui @@ -1,24 +1,260 @@ + frmGTA5Sync - - + + 0 0 - 400 - 300 + 1211 + 650 - - frmGTA5Sync + + gta5sync - - - - + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + + Profile: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 1 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Savegames + + + + + + + + + + View Snapmatic pictures + + + + + + + + + 0 + + + 0 + + + 0 + + + + + Snapmatic + + + + + + + + + + + + 225 + 0 + + + + + 275 + 16777215 + + + + + + + + + + <- Back to Savegames + + + + + + + + + + + + + 0 + + + + + + + + :/img/gta5sync.jpg + + + true + + + + + + + + + + + + + + + + Filename: %1 +Title: %2 +Date: %3 + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + + + + + + + + + + 0 + 0 + 1211 + 21 + + + + + Sync + + + + + + + + + Help + + + + + + + + + About gta5sync + + + + + Setup sync + + + + + Exit + + + + + Sync log + + - - - + + + + diff --git a/gta5sync.jpg b/gta5sync.jpg new file mode 100755 index 0000000..5e85745 Binary files /dev/null and b/gta5sync.jpg differ diff --git a/gta5sync.pro b/gta5sync.pro index a0a4b2b..39ac3ec 100755 --- a/gta5sync.pro +++ b/gta5sync.pro @@ -29,3 +29,6 @@ SOURCES += main.cpp\ HEADERS += frmGTA5Sync.h FORMS += frmGTA5Sync.ui + +RESOURCES += \ + res.qrc diff --git a/res.qrc b/res.qrc new file mode 100755 index 0000000..0e10ce1 --- /dev/null +++ b/res.qrc @@ -0,0 +1,5 @@ + + + gta5sync.jpg + +