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
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
#include "ui_contentselector.h"
|
2013-10-02 02:29:45 +00:00
|
|
|
#include "../model/contentmodel.hpp"
|
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-10-23 02:52:35 +00:00
|
|
|
class ContentSelector : public QObject
|
2013-08-17 03:23:21 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
QStringList mFilePaths;
|
2013-09-29 17:19:07 +00:00
|
|
|
|
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-10-07 02:13:47 +00:00
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
explicit ContentSelector(QWidget *parent = 0);
|
2013-09-22 04:06:29 +00:00
|
|
|
|
2013-10-24 22:33:28 +00:00
|
|
|
QString currentFile() const;
|
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
void addFiles(const QString &path);
|
2013-11-04 03:36:41 +00:00
|
|
|
void setProfileContent (const QStringList &fileList);
|
2013-08-17 03:23:21 +00:00
|
|
|
|
2013-10-07 02:13:47 +00:00
|
|
|
void clearCheckStates();
|
2014-12-31 06:19:54 +00:00
|
|
|
void setContentList(const QStringList &list);
|
2013-10-02 02:29:45 +00:00
|
|
|
|
|
|
|
ContentSelectorModel::ContentFileList selectedFiles() const;
|
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
void setGameFile (const QString &filename = QString(""));
|
|
|
|
|
|
|
|
bool isGamefileSelected() const
|
|
|
|
{ return ui.gameFileView->currentIndex() != -1; }
|
|
|
|
|
|
|
|
QWidget *uiWidget() const
|
|
|
|
{ return ui.contentGroupBox; }
|
2013-09-18 07:36:23 +00:00
|
|
|
|
2013-10-07 02:13:47 +00:00
|
|
|
|
2013-09-18 07:36:23 +00:00
|
|
|
private:
|
2013-09-22 04:06:29 +00:00
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
Ui::ContentSelector ui;
|
2013-09-29 17:19:07 +00:00
|
|
|
|
2013-09-22 04:06:29 +00:00
|
|
|
void buildContentModel();
|
|
|
|
void buildGameFileView();
|
|
|
|
void buildAddonView();
|
2013-08-17 03:23:21 +00:00
|
|
|
|
2013-08-18 00:40:28 +00:00
|
|
|
signals:
|
2013-10-23 02:52:35 +00:00
|
|
|
void signalCurrentGamefileIndexChanged (int);
|
2014-10-16 13:07:51 +00:00
|
|
|
|
|
|
|
void signalAddonDataChanged (const QModelIndex& topleft, const QModelIndex& bottomright);
|
2013-10-02 02:29:45 +00:00
|
|
|
|
2013-08-17 03:23:21 +00:00
|
|
|
private slots:
|
2013-09-29 17:19:07 +00:00
|
|
|
|
2013-09-22 04:06:29 +00:00
|
|
|
void slotCurrentGameFileIndexChanged(int index);
|
2014-10-16 13:07:51 +00:00
|
|
|
void slotAddonTableItemActivated(const QModelIndex& index);
|
2013-08-17 03:23:21 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CONTENTSELECTOR_HPP
|