OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
contentselector.hpp
Go to the documentation of this file.
1 #ifndef CONTENTSELECTOR_HPP
2 #define CONTENTSELECTOR_HPP
3 
4 #include <QDialog>
5 
6 #include "ui_contentselector.h"
8 
10 
11 namespace ContentSelectorView
12 {
13  class ContentSelector : public QObject
14  {
15  Q_OBJECT
16 
18  QStringList mFilePaths;
19 
20  protected:
21 
24 
25  public:
26 
27  explicit ContentSelector(QWidget *parent = 0);
28 
29  QString currentFile() const;
30 
31  void addFiles(const QString &path);
32  void clearFiles();
33  void setProfileContent (const QStringList &fileList);
34 
35  void clearCheckStates();
36  void setContentList(const QStringList &list);
37 
39 
40  void setGameFile (const QString &filename = QString(""));
41 
42  bool isGamefileSelected() const
43  { return ui.gameFileView->currentIndex() != -1; }
44 
45  QWidget *uiWidget() const
46  { return ui.contentGroupBox; }
47 
48 
49  private:
50 
51  Ui::ContentSelector ui;
52 
53  void buildContentModel();
54  void buildGameFileView();
55  void buildAddonView();
56  void buildContextMenu();
57  void setGameFileSelected(int index, bool selected);
58  void setCheckStateForMultiSelectedItems(bool checked);
59 
60  signals:
62 
63  void signalAddonDataChanged (const QModelIndex& topleft, const QModelIndex& bottomright);
64 
65  private slots:
66 
67  void slotCurrentGameFileIndexChanged(int index);
68  void slotAddonTableItemActivated(const QModelIndex& index);
69  void slotShowContextMenu(const QPoint& pos);
72  };
73 }
74 
75 #endif // CONTENTSELECTOR_HPP
bool isGamefileSelected() const
Definition: contentselector.hpp:42
static const struct @2 signals[]
Definition: contentselector.hpp:13
QSortFilterProxyModel * mAddonProxyModel
Definition: contentselector.hpp:23
void buildAddonView()
Definition: contentselector.cpp:46
void buildContextMenu()
Definition: contentselector.cpp:63
QStringList mFilePaths
Definition: contentselector.hpp:18
QMenu * mContextMenu
Definition: contentselector.hpp:17
void slotAddonTableItemActivated(const QModelIndex &index)
Definition: contentselector.cpp:200
void signalAddonDataChanged(const QModelIndex &topleft, const QModelIndex &bottomright)
int list(Bsa::BSAFile &bsa, Arguments &info)
Definition: bsatool.cpp:183
void buildContentModel()
Definition: contentselector.cpp:27
void setContentList(const QStringList &list)
Definition: contentselector.cpp:115
ContentSelector(QWidget *parent=0)
Definition: contentselector.cpp:16
void clearCheckStates()
Definition: contentselector.cpp:110
void setGameFileSelected(int index, bool selected)
Definition: contentselector.cpp:189
ContentSelectorModel::ContentFileList selectedFiles() const
Definition: contentselector.cpp:126
Ui::ContentSelector ui
Definition: contentselector.hpp:51
QList< EsmFile * > ContentFileList
Definition: contentmodel.hpp:12
Definition: contentmodel.hpp:22
void addFiles(const QString &path)
Definition: contentselector.cpp:134
void slotShowContextMenu(const QPoint &pos)
Definition: contentselector.cpp:216
void setGameFile(const QString &filename=QString(""))
Definition: contentselector.cpp:90
void setCheckStateForMultiSelectedItems(bool checked)
Definition: contentselector.cpp:222
void buildGameFileView()
Definition: contentselector.cpp:33
void slotCheckMultiSelectedItems()
Definition: contentselector.cpp:240
QString currentFile() const
Definition: contentselector.cpp:158
void slotCurrentGameFileIndexChanged(int index)
Definition: contentselector.cpp:169
QWidget * uiWidget() const
Definition: contentselector.hpp:45
ContentSelectorModel::ContentModel * mContentModel
Definition: contentselector.hpp:22
void clearFiles()
Definition: contentselector.cpp:153
void setProfileContent(const QStringList &fileList)
Definition: contentselector.cpp:73
void slotUncheckMultiSelectedItems()
Definition: contentselector.cpp:235