From 5a0893171cf82ebad8347ab9dbc1193f9fcabda3 Mon Sep 17 00:00:00 2001 From: cniehaus Date: Sun, 29 Dec 2002 14:15:31 +0000 Subject: just in case my harddisk breaks ;) Still there is no real funktional code, only GUI-work --- (limited to 'noncore/apps/odict/configdlg.cpp') diff --git a/noncore/apps/odict/configdlg.cpp b/noncore/apps/odict/configdlg.cpp index 2680d7a..75dc735 100644 --- a/noncore/apps/odict/configdlg.cpp +++ b/noncore/apps/odict/configdlg.cpp @@ -15,12 +15,78 @@ * * **************************************************************************/ #include "configdlg.h" +#include "searchmethoddlg.h" #include #include +#include -ConfigDlg::ConfigDlg(QWidget *parent, const char *name) : QDialog(parent, name) +#include +#include +#include +#include +#include + +#include + +ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) { - this->show(); 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" ); + 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" ) ); + QListViewItem *item = new QListViewItem( list ); + item->setText( 0, "foofooofoofoof" ); + + 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(); +} + +void ConfigDlg::writeEntries() +{ + qDebug( "richtig beendet" ); +} + +void ConfigDlg::slotNewMethod() +{ + SearchMethodDlg dlg( this, "SearchMethodDlg", true ); + if ( dlg.exec() == QDialog::Accepted ) + { + //dlg.saveItem(); + QListViewItem *item = new QListViewItem( list ); + item->setText( 0 , dlg.itemName ); + } + else qDebug( "SearchMethodDlg abgebrochen" ); +} + +void ConfigDlg::slotChangeMethod(){} + +void ConfigDlg::slotDeleteMethod() +{ + if ( list->selectedItem() ) + list->takeItem( list->selectedItem() ); + else qDebug("no item selected"); } -- cgit v0.9.0.2