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-25 04:08:05 +00:00
|
|
|
#include "combobox.hpp"
|
2011-04-07 22:04:09 +00:00
|
|
|
|
|
|
|
class QTableWidget;
|
|
|
|
class QStandardItemModel;
|
|
|
|
class QItemSelection;
|
|
|
|
class QItemSelectionModel;
|
2011-05-11 18:04:25 +00:00
|
|
|
class QSortFilterProxyModel;
|
2011-04-07 22:04:09 +00:00
|
|
|
class QStringListModel;
|
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 PluginsModel;
|
|
|
|
class PluginsView;
|
|
|
|
class ComboBox;
|
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());
|
2011-04-24 21:03:21 +00:00
|
|
|
|
2011-04-07 22:04:09 +00:00
|
|
|
public slots:
|
|
|
|
void masterSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
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 23:13:40 +00:00
|
|
|
void copyProfile();
|
2011-05-02 21:06:11 +00:00
|
|
|
void deleteProfile();
|
2011-06-07 18:21:01 +00:00
|
|
|
void moveUp();
|
|
|
|
void moveDown();
|
|
|
|
void moveTop();
|
|
|
|
void moveBottom();
|
|
|
|
void check();
|
|
|
|
void uncheck();
|
2011-06-07 19:14:27 +00:00
|
|
|
void refresh();
|
2011-04-07 22:04:09 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QTableWidget *mMastersWidget;
|
2011-06-08 14:55:53 +00:00
|
|
|
PluginsView *mPluginsTable;
|
2011-04-24 19:42:56 +00:00
|
|
|
|
2011-04-07 22:04:09 +00:00
|
|
|
QStandardItemModel *mDataFilesModel;
|
2011-06-08 14:55:53 +00:00
|
|
|
PluginsModel *mPluginsModel;
|
2011-04-24 19:42:56 +00:00
|
|
|
|
2011-05-11 18:04:25 +00:00
|
|
|
QSortFilterProxyModel *mPluginsProxyModel;
|
2011-04-07 22:04:09 +00:00
|
|
|
QItemSelectionModel *mPluginsSelectModel;
|
|
|
|
|
2011-06-07 18:21:01 +00: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 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;
|
|
|
|
|
|
|
|
const QStringList checkedPlugins();
|
|
|
|
const QStringList selectedMasters();
|
2012-01-21 00:14:35 +00:00
|
|
|
|
2011-04-07 22:04:09 +00:00
|
|
|
void addPlugins(const QModelIndex &index);
|
|
|
|
void removePlugins(const QModelIndex &index);
|
2011-04-24 21:23:04 +00:00
|
|
|
void uncheckPlugins();
|
2011-06-07 18:21:01 +00:00
|
|
|
void createActions();
|
2012-02-22 07:34:47 +00:00
|
|
|
void setupDataFiles();
|
|
|
|
void setupConfig();
|
|
|
|
void readConfig();
|
2011-06-09 22:30:08 +00:00
|
|
|
void scrollToSelection();
|
|
|
|
|
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
|