2013-08-17 03:23:21 +00:00
|
|
|
#ifndef CONTENTSELECTOR_HPP
|
|
|
|
#define CONTENTSELECTOR_HPP
|
|
|
|
|
2013-08-20 17:34:39 +00:00
|
|
|
#include <QDialog>
|
2013-08-17 03:23:21 +00:00
|
|
|
|
|
|
|
#include "ui_datafilespage.h"
|
|
|
|
|
2013-09-22 04:06:29 +00:00
|
|
|
namespace ContentSelectorModel { class ContentModel; }
|
2013-08-17 03:23:21 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
class QSortFilterProxyModel;
|
|
|
|
|
2013-09-22 04:06:29 +00:00
|
|
|
namespace ContentSelectorView
|
2013-08-18 20:11:29 +00:00
|
|
|
{
|
2013-08-20 17:34:39 +00:00
|
|
|
class ContentSelector : public QDialog, protected Ui::DataFilesPage
|
2013-08-17 03:23:21 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2013-08-17 10:55:43 +00:00
|
|
|
protected:
|
|
|
|
|
2013-09-22 04:06:29 +00:00
|
|
|
ContentSelectorModel::ContentModel *mContentModel;
|
|
|
|
QSortFilterProxyModel *mGameFileProxyModel;
|
|
|
|
QSortFilterProxyModel *mAddonProxyModel;
|
2013-08-17 03:23:21 +00:00
|
|
|
|
|
|
|
public:
|
2013-09-22 04:06:29 +00:00
|
|
|
|
2013-08-17 03:23:21 +00:00
|
|
|
explicit ContentSelector(QWidget *parent = 0);
|
|
|
|
|
2013-09-22 04:06:29 +00:00
|
|
|
static ContentSelector &cast(QWidget *subject); //static constructor function for singleton performance.
|
2013-08-17 03:23:21 +00:00
|
|
|
|
|
|
|
void addFiles(const QString &path);
|
2013-08-18 00:40:28 +00:00
|
|
|
void setCheckState(QModelIndex index, QSortFilterProxyModel *model);
|
2013-08-17 03:23:21 +00:00
|
|
|
QStringList checkedItemsPaths();
|
2013-09-18 07:36:23 +00:00
|
|
|
|
|
|
|
private:
|
2013-09-22 04:06:29 +00:00
|
|
|
|
|
|
|
void buildContentModel();
|
|
|
|
void buildGameFileView();
|
|
|
|
void buildAddonView();
|
2013-09-18 07:36:23 +00:00
|
|
|
void buildProfilesView();
|
2013-08-17 03:23:21 +00:00
|
|
|
|
2013-08-18 00:40:28 +00:00
|
|
|
signals:
|
|
|
|
void profileChanged(int index);
|
|
|
|
|
2013-08-17 03:23:21 +00:00
|
|
|
private slots:
|
|
|
|
void updateViews();
|
2013-08-18 00:40:28 +00:00
|
|
|
void slotCurrentProfileIndexChanged(int index);
|
2013-09-22 04:06:29 +00:00
|
|
|
void slotCurrentGameFileIndexChanged(int index);
|
|
|
|
void slotAddonTableItemClicked(const QModelIndex &index);
|
2013-08-17 03:23:21 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CONTENTSELECTOR_HPP
|