summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2003-01-01 19:11:32 (UTC)
committer cniehaus <cniehaus>2003-01-01 19:11:32 (UTC)
commit2736ce30d565270495050cec2831d3f31b5c90a0 (patch) (side-by-side diff)
tree1e9d98a7da5928b2527e42a7339022a9dd7f59ea
parent19ea383f6c848848a53adbbf4e6a32ea978b81ce (diff)
downloadopie-2736ce30d565270495050cec2831d3f31b5c90a0.zip
opie-2736ce30d565270495050cec2831d3f31b5c90a0.tar.gz
opie-2736ce30d565270495050cec2831d3f31b5c90a0.tar.bz2
load the methods
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/odict/configdlg.cpp13
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
@@ -14,53 +14,54 @@
* ( at your option ) any later version. *
* *
**************************************************************************/
#include "configdlg.h"
#include "searchmethoddlg.h"
#include <qdialog.h>
#include <qpe/config.h>
#include <qlayout.h>
#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" ) );
QVBoxLayout *vbox_layout = new QVBoxLayout( this );
tab = new OTabWidget( this, "OTabWidget_tab", OTabWidget::Global, OTabWidget::Bottom );
vbox_layout->addWidget( tab );
/*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() ) );
connect( change_button, SIGNAL( clicked() ), this, SLOT( slotChangeMethod() ));
connect( delete_button, SIGNAL( clicked() ), this, SLOT( slotDeleteMethod() ));
vbox_layout_searchtab->addWidget( hbox );
/*add the tabs and maximize*/
tab->addTab( settings_tab, "pass", tr( "General Settings" ) );
tab->addTab( search_tab, "zoom", tr( "Searchmethods" ) );
showMaximized();
}
@@ -94,21 +95,25 @@ void ConfigDlg::slotChangeMethod()
item->setText( 0 , dlg.nameLE->text() );
}
else qDebug( "SearchMethodDlg abgebrochen" );
}
else qDebug( "kein item angewählt" );
}
void ConfigDlg::slotDeleteMethod()
{
if ( list->selectedItem() )
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" ) );
+ }
}