2011-04-07 22:04:09 +00:00
|
|
|
#ifndef DATAFILESPAGE_H
|
|
|
|
#define DATAFILESPAGE_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QModelIndex>
|
|
|
|
|
2013-03-05 02:13:39 +00:00
|
|
|
#include "ui_datafilespage.h"
|
|
|
|
|
2011-05-11 18:04:25 +00:00
|
|
|
class QSortFilterProxyModel;
|
2013-03-05 02:47:57 +00:00
|
|
|
class QAbstractItemModel;
|
2011-06-07 18:21:01 +00:00
|
|
|
class QAction;
|
|
|
|
class QMenu;
|
2013-02-11 14:01:00 +00:00
|
|
|
|
2012-10-10 20:58:04 +00:00
|
|
|
class DataFilesModel;
|
2012-10-22 23:47:07 +00:00
|
|
|
class TextInputDialog;
|
2013-01-27 15:39:51 +00:00
|
|
|
class GameSettings;
|
2013-02-11 14:01:00 +00:00
|
|
|
class LauncherSettings;
|
2013-02-19 14:58:01 +00:00
|
|
|
class PluginsProxyModel;
|
2011-04-07 22:04:09 +00:00
|
|
|
|
2012-01-21 00:14:35 +00:00
|
|
|
namespace Files { struct ConfigurationManager; }
|
|
|
|
|
2013-03-05 02:13:39 +00:00
|
|
|
class DataFilesPage : public QWidget, private Ui::DataFilesPage
|
2011-04-07 22:04:09 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-02-11 14:01:00 +00:00
|
|
|
DataFilesPage(Files::ConfigurationManager &cfg, GameSettings &gameSettings, LauncherSettings &launcherSettings, QWidget *parent = 0);
|
2011-04-07 22:04:09 +00:00
|
|
|
|
2013-03-05 02:47:57 +00:00
|
|
|
QAbstractItemModel* profilesComboBoxModel();
|
|
|
|
int profilesComboBoxIndex();
|
|
|
|
|
2011-04-25 08:41:16 +00:00
|
|
|
void writeConfig(QString profile = QString());
|
2013-02-11 14:01:00 +00:00
|
|
|
void saveSettings();
|
|
|
|
|
2013-03-05 02:47:57 +00:00
|
|
|
signals:
|
|
|
|
void profileChanged(int index);
|
2011-04-24 21:03:21 +00:00
|
|
|
|
2011-04-07 22:04:09 +00:00
|
|
|
public slots:
|
2011-06-07 18:21:01 +00:00
|
|
|
void setCheckState(QModelIndex index);
|
2013-03-05 02:47:57 +00:00
|
|
|
void setProfilesComboBoxIndex(int index);
|
|
|
|
|
2011-05-11 18:04:25 +00:00
|
|
|
void filterChanged(const QString filter);
|
2011-06-07 18:21:01 +00:00
|
|
|
void showContextMenu(const QPoint &point);
|
2011-04-25 08:41:16 +00:00
|
|
|
void profileChanged(const QString &previous, const QString ¤t);
|
2012-10-22 23:47:07 +00:00
|
|
|
void profileRenamed(const QString &previous, const QString ¤t);
|
|
|
|
void updateOkButton(const QString &text);
|
2013-02-11 14:01:00 +00:00
|
|
|
void updateSplitter();
|
2013-02-19 14:58:01 +00:00
|
|
|
void updateViews();
|
2011-06-07 18:21:01 +00:00
|
|
|
|
|
|
|
// Action slots
|
2013-03-11 00:48:01 +00:00
|
|
|
void on_newProfileAction_triggered();
|
|
|
|
void on_deleteProfileAction_triggered();
|
|
|
|
void on_checkAction_triggered();
|
|
|
|
void on_uncheckAction_triggered();
|
2011-04-07 22:04:09 +00:00
|
|
|
|
2013-03-05 02:47:57 +00:00
|
|
|
private slots:
|
|
|
|
void slotCurrentIndexChanged(int index);
|
|
|
|
|
2011-04-07 22:04:09 +00:00
|
|
|
private:
|
2013-02-18 16:59:08 +00:00
|
|
|
DataFilesModel *mDataFilesModel;
|
2011-04-24 19:42:56 +00:00
|
|
|
|
2013-02-19 14:58:01 +00:00
|
|
|
PluginsProxyModel *mPluginsProxyModel;
|
2013-02-18 16:59:08 +00:00
|
|
|
QSortFilterProxyModel *mMastersProxyModel;
|
|
|
|
|
|
|
|
QSortFilterProxyModel *mFilterProxyModel;
|
2012-10-10 20:58:04 +00:00
|
|
|
|
2011-06-07 18:21:01 +00:00
|
|
|
QMenu *mContextMenu;
|
2011-05-02 20:21:42 +00:00
|
|
|
|
2012-02-22 07:34:47 +00:00
|
|
|
Files::ConfigurationManager &mCfgMgr;
|
|
|
|
|
2013-01-27 15:39:51 +00:00
|
|
|
GameSettings &mGameSettings;
|
2013-02-11 14:01:00 +00:00
|
|
|
LauncherSettings &mLauncherSettings;
|
2012-02-22 07:34:47 +00:00
|
|
|
|
2012-10-22 23:47:07 +00:00
|
|
|
TextInputDialog *mNewProfileDialog;
|
|
|
|
|
2013-02-24 02:10:27 +00:00
|
|
|
void setMastersCheckstates(Qt::CheckState state);
|
|
|
|
void setPluginsCheckstates(Qt::CheckState state);
|
2012-01-21 00:14:35 +00:00
|
|
|
|
2011-06-07 18:21:01 +00:00
|
|
|
void createActions();
|
2013-01-27 15:39:51 +00:00
|
|
|
void setupDataFiles();
|
2012-02-22 07:34:47 +00:00
|
|
|
void setupConfig();
|
|
|
|
void readConfig();
|
2011-06-09 22:30:08 +00:00
|
|
|
|
2013-02-11 14:01:00 +00:00
|
|
|
void loadSettings();
|
|
|
|
|
2011-04-24 19:42:56 +00:00
|
|
|
};
|
2011-04-07 22:04:09 +00:00
|
|
|
|
2011-04-24 19:42:56 +00:00
|
|
|
#endif
|