diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-27 19:14:37 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-27 19:14:37 -0500 |
| commit | 4bbdbb000fd5051fe80b5dca21dda60910284333 (patch) | |
| tree | 7e1068a2ef8df08e5340a943b9b85da52ca953f2 /src/filterlist.h | |
| parent | 8ea346183fa432e4a16e604ae2fa03366c01c6af (diff) | |
split filter list
Diffstat (limited to 'src/filterlist.h')
| -rw-r--r-- | src/filterlist.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/filterlist.h b/src/filterlist.h new file mode 100644 index 00000000..ca74021a --- /dev/null +++ b/src/filterlist.h @@ -0,0 +1,42 @@ +#ifndef MODORGANIZER_CATEGORIESLIST_INCLUDED +#define MODORGANIZER_CATEGORIESLIST_INCLUDED + +#include "modlistsortproxy.h" +#include <QTreeWidgetItem> + +namespace Ui { class MainWindow; }; +class CategoryFactory; + +class FilterList : public QObject +{ + Q_OBJECT; + +public: + FilterList(Ui::MainWindow* ui, CategoryFactory& factory); + + void setSelection(std::vector<int> categories); + void clearSelection(); + void refresh(); + +signals: + void changed(std::vector<int> categories, std::vector<int> content); + +private: + Ui::MainWindow* ui; + CategoryFactory& m_factory; + + void onContextMenu(const QPoint &pos); + void onSelection(); + + void editCategories(); + + QTreeWidgetItem* addFilterItem( + QTreeWidgetItem *root, const QString &name, int categoryID, + ModListSortProxy::FilterType type); + + void addContentFilters(); + void addCategoryFilters( + QTreeWidgetItem *root, const std::set<int> &categoriesUsed, int targetID); +}; + +#endif // MODORGANIZER_CATEGORIESLIST_INCLUDED |
