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