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