gta5view/ProfileInterface.h

109 lines
3.6 KiB
C
Raw Normal View History

/*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping
*
* 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 PROFILEINTERFACE_H
#define PROFILEINTERFACE_H
#include "SnapmaticPicture.h"
#include "SnapmaticWidget.h"
2016-03-26 10:46:25 +01:00
#include "ProfileDatabase.h"
#include "DatabaseThread.h"
#include "SavegameWidget.h"
#include "ProfileLoader.h"
2016-04-03 01:18:48 +02:00
#include "ProfileWidget.h"
2016-04-03 12:27:40 +02:00
#include "ExportThread.h"
#include "SavegameData.h"
2016-03-26 10:46:25 +01:00
#include "CrewDatabase.h"
2016-04-03 12:27:40 +02:00
#include <QProgressDialog>
#include <QSpacerItem>
#include <QWidget>
#include <QList>
#include <QMap>
namespace Ui {
class ProfileInterface;
}
class ProfileInterface : public QWidget
{
Q_OBJECT
public:
explicit ProfileInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent = 0);
2016-03-26 08:53:37 +01:00
void setProfileFolder(QString folder, QString profile);
void settingsApplied(int contentMode, QString language);
2016-03-26 08:53:37 +01:00
void setupProfileInterface();
int selectedWidgets();
~ProfileInterface();
public slots:
void selectAllWidgets();
void deselectAllWidgets();
2016-04-03 10:17:01 +02:00
void exportSelected();
void deleteSelected();
2016-04-13 00:47:07 +02:00
void importFiles();
2016-03-26 10:46:25 +01:00
private slots:
void on_cmdCloseProfile_clicked();
void on_cmdImport_clicked();
void pictureLoaded(SnapmaticPicture *picture, QString picturePath);
void savegameLoaded(SavegameData *savegame, QString savegamePath);
void loadingProgress(int value, int maximum);
void pictureDeleted();
void savegameDeleted();
void profileLoaded_p();
void profileWidgetSelected();
void profileWidgetDeselected();
void dialogNextPictureRequested(QWidget *dialog);
void dialogPreviousPictureRequested(QWidget *dialog);
2016-03-26 10:46:25 +01:00
private:
2016-03-26 10:46:25 +01:00
ProfileDatabase *profileDB;
CrewDatabase *crewDB;
DatabaseThread *threadDB;
Ui::ProfileInterface *ui;
ProfileLoader *profileLoader;
QList<SavegameData*> savegames;
QList<SnapmaticPicture*> pictures;
2016-04-03 01:18:48 +02:00
QMap<ProfileWidget*,QString> widgets;
QSpacerItem *saSpacerItem;
2016-10-27 08:12:59 +02:00
QString enabledPicStr;
QString profileFolder;
2016-03-26 08:53:37 +01:00
QString profileName;
QString loadingStr;
2016-04-03 01:18:48 +02:00
int selectedWidgts;
int contentMode;
2016-04-13 00:11:20 +02:00
bool importFile(QString selectedFile, bool warn);
bool importSnapmaticPicture(SnapmaticPicture *picture, QString picPath, bool warn = true);
bool importSavegameData(SavegameData *savegame, QString sgdPath, bool warn = true);
2016-04-06 06:38:43 +02:00
void pictureLoaded_f(SnapmaticPicture *picture, QString picturePath, bool inserted);
void savegameLoaded_f(SavegameData *savegame, QString savegamePath, bool inserted);
void savegameDeleted_f(QWidget *sgdWidget);
void pictureDeleted_f(QWidget *picWidget);
2016-04-06 06:38:43 +02:00
void insertSnapmaticIPI(QWidget *widget);
void insertSavegameIPI(QWidget *widget);
void sortingProfileInterface();
signals:
void profileLoaded();
void profileClosed();
};
#endif // PROFILEINTERFACE_H