Diffstat (limited to 'noncore/settings/aqpkg/categoryfilterimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/categoryfilterimpl.cpp | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/noncore/settings/aqpkg/categoryfilterimpl.cpp b/noncore/settings/aqpkg/categoryfilterimpl.cpp index 0746da6..e8ce7e7 100644 --- a/noncore/settings/aqpkg/categoryfilterimpl.cpp +++ b/noncore/settings/aqpkg/categoryfilterimpl.cpp | |||
@@ -17,5 +17,7 @@ | |||
17 | #include <iostream> | 17 | #include <iostream> |
18 | using namespace std; | 18 | using namespace std; |
19 | 19 | ||
20 | #include <qgroupbox.h> | ||
21 | #include <qlayout.h> | ||
20 | #include <qlistbox.h> | 22 | #include <qlistbox.h> |
21 | #include <qstring.h> | 23 | #include <qstring.h> |
@@ -24,6 +26,23 @@ using namespace std; | |||
24 | 26 | ||
25 | CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) | 27 | CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) |
26 | : CategoryFilterDlg(parent,name, true) | 28 | : QDialog( parent, name, true ) |
27 | { | 29 | { |
30 | setCaption( tr( "Category Filter" ) ); | ||
31 | |||
32 | QVBoxLayout *layout = new QVBoxLayout( this ); | ||
33 | layout->setMargin( 2 ); | ||
34 | layout->setSpacing( 4 ); | ||
35 | |||
36 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Select one or more groups" ), this ); | ||
37 | grpbox->layout()->setSpacing( 2 ); | ||
38 | grpbox->layout()->setMargin( 4 ); | ||
39 | layout->addWidget( grpbox ); | ||
40 | |||
41 | QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); | ||
42 | |||
43 | lstCategories = new QListBox( grpbox ); | ||
44 | lstCategories->setSelectionMode( QListBox::Multi ); | ||
45 | grplayout->addWidget( lstCategories ); | ||
46 | |||
28 | // Split up categories and add them to the listbox | 47 | // Split up categories and add them to the listbox |
29 | int start = 1; | 48 | int start = 1; |
@@ -31,4 +50,5 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin | |||
31 | QString item; | 50 | QString item; |
32 | int end; | 51 | int end; |
52 | QString finditem; | ||
33 | do | 53 | do |
34 | { | 54 | { |
@@ -38,6 +58,6 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin | |||
38 | { | 58 | { |
39 | lstCategories->insertItem( item ); | 59 | lstCategories->insertItem( item ); |
40 | 60 | finditem = QString( "#%1#" ).arg( item ); | |
41 | if ( selectedCategories.find( "#" + item + "#" ) != -1 ) | 61 | if ( selectedCategories.find( finditem ) != -1 ) |
42 | lstCategories->setSelected( lstCategories->count()-1, true ); | 62 | lstCategories->setSelected( lstCategories->count()-1, true ); |
43 | } | 63 | } |
@@ -63,5 +83,8 @@ QString CategoryFilterImpl :: getSelectedFilter() | |||
63 | { | 83 | { |
64 | if ( lstCategories->isSelected( i ) ) | 84 | if ( lstCategories->isSelected( i ) ) |
65 | ret += lstCategories->text( i ) + "#"; | 85 | { |
86 | ret.append( lstCategories->text( i ) ); | ||
87 | ret.append( "#" ); | ||
88 | } | ||
66 | } | 89 | } |
67 | 90 | ||