2011-04-08 00:04:09 +02:00
|
|
|
#ifndef DATAFILESPAGE_H
|
|
|
|
#define DATAFILESPAGE_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QModelIndex>
|
2012-10-23 01:47:07 +02:00
|
|
|
#include "utils/profilescombobox.hpp"
|
2012-02-28 17:19:44 +01:00
|
|
|
#include <components/files/collections.hpp>
|
|
|
|
|
2011-04-08 00:04:09 +02:00
|
|
|
|
2012-10-10 22:58:04 +02:00
|
|
|
class QTableView;
|
2011-05-11 20:04:25 +02:00
|
|
|
class QSortFilterProxyModel;
|
2011-04-25 07:02:07 +02:00
|
|
|
class QSettings;
|
2011-06-07 20:21:01 +02:00
|
|
|
class QAction;
|
|
|
|
class QToolBar;
|
|
|
|
class QMenu;
|
2012-10-23 01:47:07 +02:00
|
|
|
class ProfilesComboBox;
|
2012-10-10 22:58:04 +02:00
|
|
|
class DataFilesModel;
|
|
|
|
|
2012-10-23 01:47:07 +02:00
|
|
|
class TextInputDialog;
|
2011-04-08 00:04:09 +02:00
|
|
|
|
2012-01-21 01:14:35 +01:00
|
|
|
namespace Files { struct ConfigurationManager; }
|
|
|
|
|
2011-04-08 00:04:09 +02:00
|
|
|
class DataFilesPage : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2012-01-21 01:14:35 +01:00
|
|
|
DataFilesPage(Files::ConfigurationManager& cfg, QWidget *parent = 0);
|
2011-04-08 00:04:09 +02:00
|
|
|
|
2012-10-23 01:47:07 +02:00
|
|
|
ProfilesComboBox *mProfilesComboBox;
|
2011-04-08 00:04:09 +02:00
|
|
|
|
2011-04-25 10:41:16 +02:00
|
|
|
void writeConfig(QString profile = QString());
|
2012-10-30 05:03:58 +01:00
|
|
|
bool showDataFilesWarning();
|
2012-06-20 20:43:51 +02:00
|
|
|
bool setupDataFiles();
|
2011-04-24 23:03:21 +02:00
|
|
|
|
2011-04-08 00:04:09 +02:00
|
|
|
public slots:
|
2011-06-07 20:21:01 +02:00
|
|
|
void setCheckState(QModelIndex index);
|
|
|
|
|
2011-05-11 20:04:25 +02:00
|
|
|
void filterChanged(const QString filter);
|
2011-06-07 20:21:01 +02: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);
|
2011-06-07 20:21:01 +02:00
|
|
|
|
|
|
|
// Action slots
|
2011-05-02 22:21:42 +02:00
|
|
|
void newProfile();
|
2011-05-02 23:06:11 +02:00
|
|
|
void deleteProfile();
|
2012-10-10 22:58:04 +02:00
|
|
|
// void moveUp();
|
|
|
|
// void moveDown();
|
|
|
|
// void moveTop();
|
|
|
|
// void moveBottom();
|
2011-06-07 20:21:01 +02:00
|
|
|
void check();
|
|
|
|
void uncheck();
|
2011-06-07 21:14:27 +02:00
|
|
|
void refresh();
|
2011-04-08 00:04:09 +02:00
|
|
|
|
|
|
|
private:
|
2012-10-10 22:58:04 +02:00
|
|
|
DataFilesModel *mMastersModel;
|
|
|
|
DataFilesModel *mPluginsModel;
|
2011-04-24 21:42:56 +02:00
|
|
|
|
2011-05-11 20:04:25 +02:00
|
|
|
QSortFilterProxyModel *mPluginsProxyModel;
|
2012-10-10 22:58:04 +02:00
|
|
|
|
|
|
|
QTableView *mMastersTable;
|
|
|
|
QTableView *mPluginsTable;
|
2011-04-08 00:04:09 +02:00
|
|
|
|
2011-06-07 20:21:01 +02:00
|
|
|
QToolBar *mProfileToolBar;
|
|
|
|
QMenu *mContextMenu;
|
|
|
|
|
|
|
|
QAction *mNewProfileAction;
|
|
|
|
QAction *mDeleteProfileAction;
|
|
|
|
|
2012-10-10 22:58:04 +02:00
|
|
|
// QAction *mMoveUpAction;
|
|
|
|
// QAction *mMoveDownAction;
|
|
|
|
// QAction *mMoveTopAction;
|
|
|
|
// QAction *mMoveBottomAction;
|
2011-06-07 20:21:01 +02:00
|
|
|
QAction *mCheckAction;
|
|
|
|
QAction *mUncheckAction;
|
2011-05-02 22:21:42 +02:00
|
|
|
|
2012-02-22 08:34:47 +01:00
|
|
|
Files::ConfigurationManager &mCfgMgr;
|
2012-02-28 17:19:44 +01:00
|
|
|
Files::PathContainer mDataDirs;
|
|
|
|
Files::PathContainer mDataLocal;
|
2012-02-22 08:34:47 +01:00
|
|
|
|
|
|
|
QSettings *mLauncherConfig;
|
|
|
|
|
2012-10-23 01:47:07 +02:00
|
|
|
TextInputDialog *mNewProfileDialog;
|
|
|
|
|
2012-10-10 22:58:04 +02:00
|
|
|
// const QStringList checkedPlugins();
|
|
|
|
// const QStringList selectedMasters();
|
2012-01-21 01:14:35 +01:00
|
|
|
|
2011-06-07 20:21:01 +02:00
|
|
|
void createActions();
|
2012-02-22 08:34:47 +01:00
|
|
|
void setupConfig();
|
|
|
|
void readConfig();
|
2011-06-10 00:30:08 +02:00
|
|
|
|
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
|