2011-04-08 00:04:09 +02:00
|
|
|
#ifndef DATAFILESPAGE_H
|
|
|
|
#define DATAFILESPAGE_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QModelIndex>
|
2012-02-28 17:19:44 +01:00
|
|
|
|
|
|
|
#include <components/files/collections.hpp>
|
|
|
|
|
2011-04-25 06:08:05 +02:00
|
|
|
#include "combobox.hpp"
|
2011-04-08 00:04:09 +02:00
|
|
|
|
|
|
|
class QTableWidget;
|
|
|
|
class QStandardItemModel;
|
|
|
|
class QItemSelection;
|
|
|
|
class QItemSelectionModel;
|
2011-05-11 20:04:25 +02:00
|
|
|
class QSortFilterProxyModel;
|
2011-04-08 00:04:09 +02:00
|
|
|
class QStringListModel;
|
2011-04-25 07:02:07 +02:00
|
|
|
class QSettings;
|
2011-06-07 20:21:01 +02:00
|
|
|
class QAction;
|
|
|
|
class QToolBar;
|
|
|
|
class QMenu;
|
2011-06-08 16:55:53 +02:00
|
|
|
class PluginsModel;
|
|
|
|
class PluginsView;
|
|
|
|
class ComboBox;
|
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
|
|
|
|
2011-04-25 07:47:11 +02:00
|
|
|
ComboBox *mProfilesComboBox;
|
2011-04-08 00:04:09 +02:00
|
|
|
|
2011-04-25 10:41:16 +02:00
|
|
|
void writeConfig(QString profile = QString());
|
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:
|
|
|
|
void masterSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
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);
|
2011-06-07 20:21:01 +02:00
|
|
|
|
|
|
|
// Action slots
|
2011-05-02 22:21:42 +02:00
|
|
|
void newProfile();
|
2011-05-03 01:13:40 +02:00
|
|
|
void copyProfile();
|
2011-05-02 23:06:11 +02:00
|
|
|
void deleteProfile();
|
2011-06-07 20:21:01 +02:00
|
|
|
void moveUp();
|
|
|
|
void moveDown();
|
|
|
|
void moveTop();
|
|
|
|
void moveBottom();
|
|
|
|
void check();
|
|
|
|
void uncheck();
|
2011-06-07 21:14:27 +02:00
|
|
|
void refresh();
|
2011-04-08 00:04:09 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
QTableWidget *mMastersWidget;
|
2011-06-08 16:55:53 +02:00
|
|
|
PluginsView *mPluginsTable;
|
2011-04-24 21:42:56 +02:00
|
|
|
|
2011-04-08 00:04:09 +02:00
|
|
|
QStandardItemModel *mDataFilesModel;
|
2011-06-08 16:55:53 +02:00
|
|
|
PluginsModel *mPluginsModel;
|
2011-04-24 21:42:56 +02:00
|
|
|
|
2011-05-11 20:04:25 +02:00
|
|
|
QSortFilterProxyModel *mPluginsProxyModel;
|
2011-04-08 00:04:09 +02:00
|
|
|
QItemSelectionModel *mPluginsSelectModel;
|
|
|
|
|
2011-06-07 20:21:01 +02:00
|
|
|
QToolBar *mProfileToolBar;
|
|
|
|
QMenu *mContextMenu;
|
|
|
|
|
|
|
|
QAction *mNewProfileAction;
|
|
|
|
QAction *mCopyProfileAction;
|
|
|
|
QAction *mDeleteProfileAction;
|
|
|
|
|
|
|
|
QAction *mMoveUpAction;
|
|
|
|
QAction *mMoveDownAction;
|
|
|
|
QAction *mMoveTopAction;
|
|
|
|
QAction *mMoveBottomAction;
|
|
|
|
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;
|
|
|
|
|
|
|
|
const QStringList checkedPlugins();
|
|
|
|
const QStringList selectedMasters();
|
2012-01-21 01:14:35 +01:00
|
|
|
|
2011-04-08 00:04:09 +02:00
|
|
|
void addPlugins(const QModelIndex &index);
|
|
|
|
void removePlugins(const QModelIndex &index);
|
2011-04-24 23:23:04 +02:00
|
|
|
void uncheckPlugins();
|
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
|
|
|
void scrollToSelection();
|
|
|
|
|
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
|