You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.6 KiB
C++
69 lines
1.6 KiB
C++
#ifndef CONTENTSELECTOR_HPP
|
|
#define CONTENTSELECTOR_HPP
|
|
|
|
#include <QDialog>
|
|
|
|
#include "ui_contentselector.h"
|
|
#include "../model/contentmodel.hpp"
|
|
|
|
class QSortFilterProxyModel;
|
|
|
|
namespace ContentSelectorView
|
|
{
|
|
class ContentSelector : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
QStringList mFilePaths;
|
|
|
|
protected:
|
|
|
|
ContentSelectorModel::ContentModel *mContentModel;
|
|
QSortFilterProxyModel *mGameFileProxyModel;
|
|
QSortFilterProxyModel *mAddonProxyModel;
|
|
|
|
public:
|
|
|
|
explicit ContentSelector(QWidget *parent = 0);
|
|
|
|
QString currentFile() const;
|
|
|
|
void addFiles(const QString &path);
|
|
void setProfileContent (const QStringList &fileList);
|
|
|
|
void clearCheckStates();
|
|
void setCheckStates (const QStringList &list);
|
|
|
|
ContentSelectorModel::ContentFileList selectedFiles() const;
|
|
|
|
void setGameFile (const QString &filename = QString(""));
|
|
|
|
bool isGamefileSelected() const
|
|
{ return ui.gameFileView->currentIndex() != -1; }
|
|
|
|
QWidget *uiWidget() const
|
|
{ return ui.contentGroupBox; }
|
|
|
|
|
|
private:
|
|
|
|
Ui::ContentSelector ui;
|
|
|
|
void buildContentModel();
|
|
void buildGameFileView();
|
|
void buildAddonView();
|
|
|
|
signals:
|
|
void signalCurrentGamefileIndexChanged (int);
|
|
void signalAddonFileSelected (int);
|
|
void signalAddonFileUnselected (int);
|
|
|
|
private slots:
|
|
|
|
void slotCurrentGameFileIndexChanged(int index);
|
|
void slotAddonTableItemClicked(const QModelIndex &index);
|
|
};
|
|
}
|
|
|
|
#endif // CONTENTSELECTOR_HPP
|