2011-04-08 00:04:09 +02:00
|
|
|
#ifndef DATAFILESPAGE_H
|
|
|
|
#define DATAFILESPAGE_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QModelIndex>
|
|
|
|
|
2013-03-05 03:13:39 +01:00
|
|
|
#include "ui_datafilespage.h"
|
2013-09-21 23:06:29 -05:00
|
|
|
#include "components/contentselector/view/contentselector.hpp"
|
2013-03-05 03:13:39 +01:00
|
|
|
|
2011-05-11 20:04:25 +02:00
|
|
|
class QSortFilterProxyModel;
|
2013-03-05 03:47:57 +01:00
|
|
|
class QAbstractItemModel;
|
2011-06-07 20:21:01 +02:00
|
|
|
class QAction;
|
|
|
|
class QMenu;
|
2013-02-11 15:01:00 +01:00
|
|
|
|
2012-10-23 01:47:07 +02:00
|
|
|
class TextInputDialog;
|
2013-01-27 16:39:51 +01:00
|
|
|
class GameSettings;
|
2013-02-11 15:01:00 +01:00
|
|
|
class LauncherSettings;
|
2013-09-21 23:06:29 -05:00
|
|
|
|
2011-04-08 00:04:09 +02:00
|
|
|
|
2012-01-21 01:14:35 +01:00
|
|
|
namespace Files { struct ConfigurationManager; }
|
|
|
|
|
2013-09-21 23:06:29 -05:00
|
|
|
class DataFilesPage : public QWidget, private Ui::DataFilesPage
|
2011-04-08 00:04:09 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-09-21 23:06:29 -05:00
|
|
|
|
2011-04-08 00:04:09 +02:00
|
|
|
public:
|
2013-02-11 15:01:00 +01:00
|
|
|
DataFilesPage(Files::ConfigurationManager &cfg, GameSettings &gameSettings, LauncherSettings &launcherSettings, QWidget *parent = 0);
|
2011-04-08 00:04:09 +02:00
|
|
|
|
2013-03-05 03:47:57 +01:00
|
|
|
QAbstractItemModel* profilesComboBoxModel();
|
|
|
|
int profilesComboBoxIndex();
|
|
|
|
|
2011-04-25 10:41:16 +02:00
|
|
|
void writeConfig(QString profile = QString());
|
2013-02-11 15:01:00 +01:00
|
|
|
void saveSettings();
|
|
|
|
|
2013-03-05 03:47:57 +01:00
|
|
|
signals:
|
|
|
|
void profileChanged(int index);
|
2011-04-24 23:03:21 +02:00
|
|
|
|
2011-04-08 00:04:09 +02:00
|
|
|
public slots:
|
2013-03-05 03:47:57 +01:00
|
|
|
void setProfilesComboBoxIndex(int index);
|
|
|
|
|
2013-08-17 19:40:28 -05:00
|
|
|
//void showContextMenu(const QPoint &point);
|
2011-04-25 10:41:16 +02:00
|
|
|
void profileChanged(const QString &previous, const QString ¤t);
|
2012-10-23 01:47:07 +02:00
|
|
|
void profileRenamed(const QString &previous, const QString ¤t);
|
|
|
|
void updateOkButton(const QString &text);
|
2013-09-21 23:06:29 -05:00
|
|
|
void updateViews();
|
2011-06-07 20:21:01 +02:00
|
|
|
// Action slots
|
2013-03-11 01:48:01 +01:00
|
|
|
void on_newProfileAction_triggered();
|
|
|
|
void on_deleteProfileAction_triggered();
|
2011-04-08 00:04:09 +02:00
|
|
|
|
2013-03-05 03:47:57 +01:00
|
|
|
private slots:
|
|
|
|
|
2011-04-08 00:04:09 +02:00
|
|
|
private:
|
2012-10-10 22:58:04 +02:00
|
|
|
|
2011-06-07 20:21:01 +02:00
|
|
|
QMenu *mContextMenu;
|
2013-09-21 23:06:29 -05:00
|
|
|
//ContentSelectorView::ContentSelector mContentSelector;
|
|
|
|
ContentSelectorModel::ContentModel *mContentModel;
|
2012-02-22 08:34:47 +01:00
|
|
|
Files::ConfigurationManager &mCfgMgr;
|
|
|
|
|
2013-01-27 16:39:51 +01:00
|
|
|
GameSettings &mGameSettings;
|
2013-02-11 15:01:00 +01:00
|
|
|
LauncherSettings &mLauncherSettings;
|
2012-02-22 08:34:47 +01:00
|
|
|
|
2012-10-23 01:47:07 +02:00
|
|
|
TextInputDialog *mNewProfileDialog;
|
2013-09-21 23:06:29 -05:00
|
|
|
QSortFilterProxyModel *mGameFileProxyModel;
|
|
|
|
QSortFilterProxyModel *mAddonProxyModel;
|
2012-10-23 01:47:07 +02:00
|
|
|
|
2013-02-24 03:10:27 +01:00
|
|
|
void setPluginsCheckstates(Qt::CheckState state);
|
2012-01-21 01:14:35 +01:00
|
|
|
|
2011-06-07 20:21:01 +02:00
|
|
|
void createActions();
|
2013-01-27 16:39:51 +01:00
|
|
|
void setupDataFiles();
|
2012-02-22 08:34:47 +01:00
|
|
|
void setupConfig();
|
|
|
|
void readConfig();
|
2011-06-10 00:30:08 +02:00
|
|
|
|
2013-02-11 15:01:00 +01:00
|
|
|
void loadSettings();
|
|
|
|
|
2013-09-21 23:06:29 -05:00
|
|
|
//////////////////////////////////////
|
|
|
|
void buildContentModel();
|
|
|
|
void buildGameFileView();
|
|
|
|
void buildAddonView();
|
|
|
|
void buildProfilesView();
|
|
|
|
|
|
|
|
//void addFiles(const QString &path);
|
|
|
|
|
|
|
|
QStringList checkedItemsPaths();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slotCurrentProfileIndexChanged(int index);
|
|
|
|
void slotCurrentGameFileIndexChanged(int index);
|
|
|
|
void slotAddonTableItemClicked(const QModelIndex &index);
|
|
|
|
|
|
|
|
|
2011-04-24 21:42:56 +02:00
|
|
|
};
|
2011-04-08 00:04:09 +02:00
|
|
|
|
2011-04-24 21:42:56 +02:00
|
|
|
#endif
|