author | cniehaus <cniehaus> | 2002-12-29 17:27:46 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-12-29 17:27:46 (UTC) |
commit | 8f6559d4be4e0b1857c4ae5cdbf1ad8b485b638b (patch) (side-by-side diff) | |
tree | a403e69a0778a02f326976a41de86e1ca176ecee | |
parent | f9308849c8257f3d2e4bec0d476f56f87935cdab (diff) | |
download | opie-8f6559d4be4e0b1857c4ae5cdbf1ad8b485b638b.zip opie-8f6559d4be4e0b1857c4ae5cdbf1ad8b485b638b.tar.gz opie-8f6559d4be4e0b1857c4ae5cdbf1ad8b485b638b.tar.bz2 |
probably the last commit for today
some more things working, still a lot missing
-rw-r--r-- | noncore/apps/odict/configdlg.cpp | 9 | ||||
-rw-r--r-- | noncore/apps/odict/configdlg.h | 2 | ||||
-rw-r--r-- | noncore/apps/odict/searchmethoddlg.cpp | 4 |
3 files changed, 13 insertions, 2 deletions
diff --git a/noncore/apps/odict/configdlg.cpp b/noncore/apps/odict/configdlg.cpp index 2056457..0f33ee8 100644 --- a/noncore/apps/odict/configdlg.cpp +++ b/noncore/apps/odict/configdlg.cpp @@ -37,16 +37,17 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(pa 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" ) ); QVBox *vbox = new QVBox( hbox ); new_button = new QPushButton( "New" , vbox ); @@ -98,8 +99,16 @@ void ConfigDlg::slotChangeMethod() } 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" ); +} diff --git a/noncore/apps/odict/configdlg.h b/noncore/apps/odict/configdlg.h index e59b875..2b7d0a1 100644 --- a/noncore/apps/odict/configdlg.h +++ b/noncore/apps/odict/configdlg.h @@ -25,13 +25,15 @@ class ConfigDlg : public QDialog void writeEntries(); private: OTabWidget *tab; QWidget *settings_tab, *search_tab; QListView *list; QPushButton *new_button, *change_button, *delete_button; + void loadSearchMethodNames(); + private slots: void slotNewMethod(); void slotChangeMethod(); void slotDeleteMethod(); }; diff --git a/noncore/apps/odict/searchmethoddlg.cpp b/noncore/apps/odict/searchmethoddlg.cpp index fcbdb8a..203c663 100644 --- a/noncore/apps/odict/searchmethoddlg.cpp +++ b/noncore/apps/odict/searchmethoddlg.cpp @@ -75,17 +75,17 @@ SearchMethodDlg::SearchMethodDlg(QWidget *parent, const char *name, bool modal, itemName = itemname; setupEntries(itemname); } } void SearchMethodDlg::setupEntries( QString item ) { Config cfg( "odict" ); - cfg.setGroup( itemName ); + cfg.setGroup( "Method_"+itemName ); trenner->setText( cfg.readEntry( "Seperator" ) ); lang1->setText( cfg.readEntry( "Lang1" ) ); lang2->setText( cfg.readEntry( "Lang2" ) ); nameLE->setText( itemName ); dictFileLE->setText( cfg.readEntry( "file" ) ); } void SearchMethodDlg::slotBrowse() @@ -93,15 +93,15 @@ void SearchMethodDlg::slotBrowse() itemName=OFileDialog::getOpenFileName( OFileSelector::EXTENDED,"/home/carsten" ); dictFileLE->setText( itemName ); } void SearchMethodDlg::saveItem() { QString name = nameLE->text(); Config cfg( "odict" ); - cfg.setGroup( name ); + cfg.setGroup( "Method_"+name ); cfg.writeEntry( "Name", name ); cfg.writeEntry( "Seperator", trenner->text() ); cfg.writeEntry( "Lang1", lang1->text() ); cfg.writeEntry( "Lang2", lang2->text() ); cfg.writeEntry( "file", dictFileLE->text() ); } |