diff --git a/PictureDialog.cpp b/PictureDialog.cpp new file mode 100755 index 0000000..b588a48 --- /dev/null +++ b/PictureDialog.cpp @@ -0,0 +1,14 @@ +#include "PictureDialog.h" +#include "ui_PictureDialog.h" + +PictureDialog::PictureDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::PictureDialog) +{ + ui->setupUi(this); +} + +PictureDialog::~PictureDialog() +{ + delete ui; +} diff --git a/PictureDialog.h b/PictureDialog.h new file mode 100755 index 0000000..5363361 --- /dev/null +++ b/PictureDialog.h @@ -0,0 +1,22 @@ +#ifndef PICTUREDIALOG_H +#define PICTUREDIALOG_H + +#include + +namespace Ui { +class PictureDialog; +} + +class PictureDialog : public QDialog +{ + Q_OBJECT + +public: + explicit PictureDialog(QWidget *parent = 0); + ~PictureDialog(); + +private: + Ui::PictureDialog *ui; +}; + +#endif // PICTUREDIALOG_H diff --git a/PictureDialog.ui b/PictureDialog.ui new file mode 100755 index 0000000..22bd98e --- /dev/null +++ b/PictureDialog.ui @@ -0,0 +1,18 @@ + + PictureDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + diff --git a/frmGTA5Sync.h b/SnapmaticPicture.cpp similarity index 66% rename from frmGTA5Sync.h rename to SnapmaticPicture.cpp index b62be31..3f9001c 100755 --- a/frmGTA5Sync.h +++ b/SnapmaticPicture.cpp @@ -15,27 +15,9 @@ * limitations under the License. *****************************************************************************/ -#ifndef FRMGTA5SYNC_H -#define FRMGTA5SYNC_H +#include "SnapmaticPicture.h" -#include - -namespace Ui { -class frmGTA5Sync; -} - -class frmGTA5Sync : public QMainWindow +SnapmaticPicture::SnapmaticPicture(QObject *parent) : QObject(parent) { - Q_OBJECT -public: - explicit frmGTA5Sync(QWidget *parent = 0); - ~frmGTA5Sync(); - -private: - QString GTAV_Folder; - QString GTAV_ProfilesFolder; - Ui::frmGTA5Sync *ui; -}; - -#endif // FRMGTA5SYNC_H +} diff --git a/SnapmaticPicture.h b/SnapmaticPicture.h new file mode 100755 index 0000000..7bb0428 --- /dev/null +++ b/SnapmaticPicture.h @@ -0,0 +1,44 @@ +/***************************************************************************** +* gta5sync GRAND THEFT AUTO V SYNC +* Copyright (C) 2016 Syping Gaming Team +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*****************************************************************************/ + +#ifndef SNAPMATICPICTURE_H +#define SNAPMATICPICTURE_H + +#include +#include + +class SnapmaticPicture : public QObject +{ + Q_OBJECT +public: + explicit SnapmaticPicture(QObject *parent = 0); + bool readingPictureFromFile(QString fileName); + bool setPicture(QPixmap pixmap); + QPixmap getPixmap(); + +private: + QPixmap cachePicture; + QString picDate; + QString picTime; + QString jsonStr; + +signals: + +public slots: +}; + +#endif // SNAPMATICPICTURE_H diff --git a/frmGTA5Sync.cpp b/frmGTA5Sync.cpp deleted file mode 100755 index 5633eee..0000000 --- a/frmGTA5Sync.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/***************************************************************************** -* gta5sync GRAND THEFT AUTO V SYNC -* Copyright (C) 2016 Syping Gaming Team -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*****************************************************************************/ - -#include -#include -#include -#include -#include "frmGTA5Sync.h" -#include "ui_frmGTA5Sync.h" - -frmGTA5Sync::frmGTA5Sync(QWidget *parent) : - QMainWindow(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() -{ - delete ui; -} diff --git a/frmGTA5Sync.ui b/frmGTA5Sync.ui deleted file mode 100755 index d17697f..0000000 --- a/frmGTA5Sync.ui +++ /dev/null @@ -1,260 +0,0 @@ - - - frmGTA5Sync - - - - 0 - 0 - 1211 - 650 - - - - 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 deleted file mode 100755 index 5e85745..0000000 Binary files a/gta5sync.jpg and /dev/null differ diff --git a/gta5sync.pro b/gta5sync.pro index 39ac3ec..9049e46 100755 --- a/gta5sync.pro +++ b/gta5sync.pro @@ -24,11 +24,16 @@ TEMPLATE = app SOURCES += main.cpp\ - frmGTA5Sync.cpp + SnapmaticPicture.cpp \ + PictureDialog.cpp -HEADERS += frmGTA5Sync.h +HEADERS += \ + SnapmaticPicture.h \ + PictureDialog.h -FORMS += frmGTA5Sync.ui +FORMS += \ + PictureDialog.ui -RESOURCES += \ - res.qrc +RESOURCES += + +OTHER_FILES += diff --git a/main.cpp b/main.cpp index e05f337..8f0f55f 100755 --- a/main.cpp +++ b/main.cpp @@ -21,6 +21,7 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); + frmGTA5Sync w; w.show(); diff --git a/res.qrc b/res.qrc deleted file mode 100755 index 0e10ce1..0000000 --- a/res.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - gta5sync.jpg - -