project restart
This commit is contained in:
parent
38a8065016
commit
527a85ac23
11 changed files with 112 additions and 369 deletions
14
PictureDialog.cpp
Executable file
14
PictureDialog.cpp
Executable file
|
@ -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;
|
||||
}
|
22
PictureDialog.h
Executable file
22
PictureDialog.h
Executable file
|
@ -0,0 +1,22 @@
|
|||
#ifndef PICTUREDIALOG_H
|
||||
#define PICTUREDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class PictureDialog;
|
||||
}
|
||||
|
||||
class PictureDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PictureDialog(QWidget *parent = 0);
|
||||
~PictureDialog();
|
||||
|
||||
private:
|
||||
Ui::PictureDialog *ui;
|
||||
};
|
||||
|
||||
#endif // PICTUREDIALOG_H
|
18
PictureDialog.ui
Executable file
18
PictureDialog.ui
Executable file
|
@ -0,0 +1,18 @@
|
|||
<ui version="4.0">
|
||||
<class>PictureDialog</class>
|
||||
<widget class="QDialog" name="PictureDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -15,27 +15,9 @@
|
|||
* limitations under the License.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef FRMGTA5SYNC_H
|
||||
#define FRMGTA5SYNC_H
|
||||
#include "SnapmaticPicture.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
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
|
||||
}
|
44
SnapmaticPicture.h
Executable file
44
SnapmaticPicture.h
Executable file
|
@ -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 <QObject>
|
||||
#include <QPixmap>
|
||||
|
||||
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
|
|
@ -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 <QDesktopServices>
|
||||
#include <QSettings>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#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;
|
||||
}
|
260
frmGTA5Sync.ui
260
frmGTA5Sync.ui
|
@ -1,260 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>frmGTA5Sync</class>
|
||||
<widget class="QMainWindow" name="frmGTA5Sync">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1211</width>
|
||||
<height>650</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>gta5sync</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="cwSync">
|
||||
<layout class="QVBoxLayout" name="vlSync">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="hlProfile">
|
||||
<item>
|
||||
<widget class="QLabel" name="labProfile">
|
||||
<property name="text">
|
||||
<string>Profile:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="cbProfile"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="hsProfile">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="swLists">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pageSavegames">
|
||||
<layout class="QVBoxLayout" name="vlSavegames">
|
||||
<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="QLabel" name="labSavegames">
|
||||
<property name="text">
|
||||
<string>Savegames</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="lvSavegames"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cmdViewSnapmatic">
|
||||
<property name="text">
|
||||
<string>View Snapmatic pictures</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="pageSnapmatic">
|
||||
<layout class="QVBoxLayout" name="vlSnapmatic">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="labSnapmatic">
|
||||
<property name="text">
|
||||
<string>Snapmatic</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="hlSnapmatic">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="vlPictureList">
|
||||
<item>
|
||||
<widget class="QListView" name="lvPicutres">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>225</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>275</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="hlBackToSG">
|
||||
<item>
|
||||
<widget class="QPushButton" name="cmdBackToSG">
|
||||
<property name="text">
|
||||
<string><- Back to Savegames</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="vlPicture">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="hlPicRender">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="labPicture">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="res.qrc">:/img/gta5sync.jpg</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labEmptyRender">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labPicInfo">
|
||||
<property name="text">
|
||||
<string>Filename: %1
|
||||
Title: %2
|
||||
Date: %3</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="vsPicture">
|
||||
<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>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1211</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuSync">
|
||||
<property name="title">
|
||||
<string>Sync</string>
|
||||
</property>
|
||||
<addaction name="actionSetup_sync"/>
|
||||
<addaction name="actionSync_log"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionExit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
<addaction name="actionAbout_gta5sync"/>
|
||||
</widget>
|
||||
<addaction name="menuSync"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<action name="actionAbout_gta5sync">
|
||||
<property name="text">
|
||||
<string>About gta5sync</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSetup_sync">
|
||||
<property name="text">
|
||||
<string>Setup sync</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExit">
|
||||
<property name="text">
|
||||
<string>Exit</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSync_log">
|
||||
<property name="text">
|
||||
<string>Sync log</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
<include location="res.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
BIN
gta5sync.jpg
BIN
gta5sync.jpg
Binary file not shown.
Before Width: | Height: | Size: 173 KiB |
15
gta5sync.pro
15
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 +=
|
||||
|
|
1
main.cpp
1
main.cpp
|
@ -21,6 +21,7 @@
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
frmGTA5Sync w;
|
||||
w.show();
|
||||
|
||||
|
|
5
res.qrc
5
res.qrc
|
@ -1,5 +0,0 @@
|
|||
<RCC>
|
||||
<qresource prefix="/img">
|
||||
<file>gta5sync.jpg</file>
|
||||
</qresource>
|
||||
</RCC>
|
Loading…
Reference in a new issue