summaryrefslogtreecommitdiff
path: root/noncore/apps/odict/configdlg.cpp
Unidiff
Diffstat (limited to 'noncore/apps/odict/configdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/configdlg.cpp70
1 files changed, 68 insertions, 2 deletions
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 @@
15 * * 15 * *
16 **************************************************************************/ 16 **************************************************************************/
17#include "configdlg.h" 17#include "configdlg.h"
18#include "searchmethoddlg.h"
18 19
19#include <qdialog.h> 20#include <qdialog.h>
20#include <qpe/config.h> 21#include <qpe/config.h>
22#include <qlayout.h>
21 23
22ConfigDlg::ConfigDlg(QWidget *parent, const char *name) : QDialog(parent, name) 24#include <qhbox.h>
25#include <qvbox.h>
26#include <qlabel.h>
27#include <qlistview.h>
28#include <qpushbutton.h>
29
30#include <opie/otabwidget.h>
31
32ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal)
23{ 33{
24 this->show();
25 setCaption( tr( "Options" ) ); 34 setCaption( tr( "Options" ) );
35 QVBoxLayout *vbox_layout = new QVBoxLayout( this );
36 tab = new OTabWidget( this, "OTabWidget_tab", OTabWidget::Global, OTabWidget::Bottom );
37 vbox_layout->addWidget( tab );
38
39 /*general settings*/
40 settings_tab = new QWidget( tab , "settings_tab" );
41
42 /*searchmethods*/
43 search_tab = new QWidget( tab , "search_tab" );
44 QVBoxLayout *vbox_layout_searchtab = new QVBoxLayout( search_tab, 4 , 4 ,"blah" );
45
46 QHBox *hbox = new QHBox( search_tab );
47 list = new QListView( hbox );
48 list->addColumn( tr( "Searchmethod" ) );
49 QListViewItem *item = new QListViewItem( list );
50 item->setText( 0, "foofooofoofoof" );
51
52 QVBox *vbox = new QVBox( hbox );
53 new_button = new QPushButton( "New" , vbox );
54 change_button = new QPushButton( "Change" , vbox );
55 delete_button = new QPushButton( "Delete" , vbox );
56 connect( new_button, SIGNAL( clicked() ), this, SLOT( slotNewMethod() ) );
57 connect( change_button, SIGNAL( clicked() ), this, SLOT( slotChangeMethod() ));
58 connect( delete_button, SIGNAL( clicked() ), this, SLOT( slotDeleteMethod() ));
59
60 vbox_layout_searchtab->addWidget( hbox );
61
62 /*add the tabs and maximize*/
63 tab->addTab( settings_tab, "pass", tr( "General Settings" ) );
64 tab->addTab( search_tab, "zoom", tr( "Searchmethods" ) );
65 showMaximized();
66}
67
68void ConfigDlg::writeEntries()
69{
70 qDebug( "richtig beendet" );
71}
72
73void ConfigDlg::slotNewMethod()
74{
75 SearchMethodDlg dlg( this, "SearchMethodDlg", true );
76 if ( dlg.exec() == QDialog::Accepted )
77 {
78 //dlg.saveItem();
79 QListViewItem *item = new QListViewItem( list );
80 item->setText( 0 , dlg.itemName );
81 }
82 else qDebug( "SearchMethodDlg abgebrochen" );
83}
84
85void ConfigDlg::slotChangeMethod(){}
86
87void ConfigDlg::slotDeleteMethod()
88{
89 if ( list->selectedItem() )
90 list->takeItem( list->selectedItem() );
91 else qDebug("no item selected");
26} 92}