From 9c85c8e441b5bc6bd9e6441a828599c137ea36be Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 7 Feb 2014 06:39:49 +0100 Subject: Implement ArchiveBrowser filtering Filter ArchiveBrowser by Quality and/or size: * Quality: only show series with a quality less or equal * Size: only show series still fitting onto the DVD * Both: only show series with a quality less or equal _and_ still fitting on the DVD Use QItemSelection instead of going through the selected items in the tree. Seems to work somehow... --- archivebrowser.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'archivebrowser.h') diff --git a/archivebrowser.h b/archivebrowser.h index 78bec23..6986b84 100644 --- a/archivebrowser.h +++ b/archivebrowser.h @@ -9,12 +9,17 @@ #define ARCHIVEBROWSER_H #include +#include +#include #include "smtreeview.h" class ArchiveBrowserModel; +class ArchiveBrowserModelProxy; class SmTreeView; class QSortFilterProxyModel; +class QComboBox; +class QCheckBox; class ArchiveBrowser : public QWidget { Q_OBJECT @@ -24,14 +29,22 @@ class ArchiveBrowser : public QWidget { public slots: void browserSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); + private slots: + void setupQualityFilter(); + signals: void sizeChanged(qint64 size); void itemCountChanged(int items); private: + QModelIndexList selectedRows(const QItemSelection &sel); SmTreeView *mTree; + QComboBox *mQualityFilter; + QCheckBox *mSizeFilter; ArchiveBrowserModel *mModel; - QSortFilterProxyModel *mProxy; + ArchiveBrowserModelProxy *mProxy; + qint64 mSelectedSize; + int mSelectedItems; }; #endif // ARCHIVEBROWSER_H -- cgit v1.2.3-70-g09d2