From 97b96e141fca844317e59ca5b99c1bf5fa52b1f0 Mon Sep 17 00:00:00 2001 From: drw Date: Tue, 04 Feb 2003 23:38:30 +0000 Subject: More dialog clean-up. Except for QWhatsThis, the UI changes are pretty much done now for AQPkg --- (limited to 'noncore/settings/aqpkg/categoryfilterimpl.cpp') 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 @@ -16,20 +16,40 @@ ***************************************************************************/ #include using namespace std; - + +#include +#include #include #include #include "categoryfilterimpl.h" CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) - : CategoryFilterDlg(parent,name, true) + : QDialog( parent, name, true ) { + setCaption( tr( "Category Filter" ) ); + + QVBoxLayout *layout = new QVBoxLayout( this ); + layout->setMargin( 2 ); + layout->setSpacing( 4 ); + + QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Select one or more groups" ), this ); + grpbox->layout()->setSpacing( 2 ); + grpbox->layout()->setMargin( 4 ); + layout->addWidget( grpbox ); + + QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); + + lstCategories = new QListBox( grpbox ); + lstCategories->setSelectionMode( QListBox::Multi ); + grplayout->addWidget( lstCategories ); + // Split up categories and add them to the listbox int start = 1; QString item; int end; + QString finditem; do { end = categories.find( "#", start ); @@ -37,8 +57,8 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin if ( item != "" ) { lstCategories->insertItem( item ); - - if ( selectedCategories.find( "#" + item + "#" ) != -1 ) + finditem = QString( "#%1#" ).arg( item ); + if ( selectedCategories.find( finditem ) != -1 ) lstCategories->setSelected( lstCategories->count()-1, true ); } @@ -62,7 +82,10 @@ QString CategoryFilterImpl :: getSelectedFilter() for ( int i = 0 ; i < (int)lstCategories->count() ; ++i ) { if ( lstCategories->isSelected( i ) ) - ret += lstCategories->text( i ) + "#"; + { + ret.append( lstCategories->text( i ) ); + ret.append( "#" ); + } } if ( ret == "#" ) -- cgit v0.9.0.2