Diffstat (limited to 'noncore/apps/odict/configdlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/odict/configdlg.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/noncore/apps/odict/configdlg.cpp b/noncore/apps/odict/configdlg.cpp index 0f33ee8..33296e3 100644 --- a/noncore/apps/odict/configdlg.cpp +++ b/noncore/apps/odict/configdlg.cpp @@ -24,12 +24,13 @@ #include <qhbox.h> #include <qvbox.h> #include <qlabel.h> #include <qlistview.h> #include <qpushbutton.h> #include <qlineedit.h> +#include <qstringlist.h> #include <opie/otabwidget.h> ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) { setCaption( tr( "Options" ) ); @@ -39,18 +40,18 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(pa /*general settings*/ settings_tab = new QWidget( tab , "settings_tab" ); /*searchmethods*/ search_tab = new QWidget( tab , "search_tab" ); - loadSearchMethodNames(); QVBoxLayout *vbox_layout_searchtab = new QVBoxLayout( search_tab, 4 , 4 ,"blah" ); QHBox *hbox = new QHBox( search_tab ); list = new QListView( hbox ); list->addColumn( tr( "Searchmethod" ) ); + loadSearchMethodNames(); QVBox *vbox = new QVBox( hbox ); new_button = new QPushButton( "New" , vbox ); change_button = new QPushButton( "Change" , vbox ); delete_button = new QPushButton( "Delete" , vbox ); connect( new_button, SIGNAL( clicked() ), this, SLOT( slotNewMethod() ) ); @@ -104,11 +105,15 @@ void ConfigDlg::slotDeleteMethod() list->takeItem( list->selectedItem() ); else qDebug("no item selected"); } void ConfigDlg::loadSearchMethodNames() { - QListViewItem *item = new QListViewItem( list); Config cfg( "odict" ); -//X cfg.setGroup( itemName ); -//X QString temp = cfg.readEntry( "Seperator" ); + QStringList groupListCfg = cfg.groupList().grep( "Method_" ); + for ( QStringList::Iterator it = groupListCfg.begin() ; it != groupListCfg.end() ; ++it ) + { + QListViewItem *item = new QListViewItem( list ); + cfg.setGroup( *it ); + item->setText( 0 , cfg.readEntry( "Name" ) ); + } } |