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