summaryrefslogtreecommitdiff
path: root/noncore
authorcniehaus <cniehaus>2002-12-29 14:15:31 (UTC)
committer cniehaus <cniehaus>2002-12-29 14:15:31 (UTC)
commit5a0893171cf82ebad8347ab9dbc1193f9fcabda3 (patch) (unidiff)
treec310a0a1d23087c3eba6d81eb07edc6437d90110 /noncore
parentda7abab7d817a22b8b6680027b6162d68b28ae98 (diff)
downloadopie-5a0893171cf82ebad8347ab9dbc1193f9fcabda3.zip
opie-5a0893171cf82ebad8347ab9dbc1193f9fcabda3.tar.gz
opie-5a0893171cf82ebad8347ab9dbc1193f9fcabda3.tar.bz2
just in case my harddisk breaks ;) Still there is no real funktional code,
only GUI-work
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/.cvsignore5
-rw-r--r--noncore/apps/odict/configdlg.cpp70
-rw-r--r--noncore/apps/odict/configdlg.h20
-rw-r--r--noncore/apps/odict/odict.cpp44
-rw-r--r--noncore/apps/odict/odict.h1
-rw-r--r--noncore/apps/odict/odict.pro4
-rw-r--r--noncore/apps/odict/searchmethoddlg.cpp36
-rw-r--r--noncore/apps/odict/searchmethoddlg.h29
8 files changed, 182 insertions, 27 deletions
diff --git a/noncore/apps/odict/.cvsignore b/noncore/apps/odict/.cvsignore
new file mode 100644
index 0000000..12d2df2
--- a/dev/null
+++ b/noncore/apps/odict/.cvsignore
@@ -0,0 +1,5 @@
1*~
2Makefile*
3*.moc
4config.in
5moc_*
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}
diff --git a/noncore/apps/odict/configdlg.h b/noncore/apps/odict/configdlg.h
index 47f66bd..e59b875 100644
--- a/noncore/apps/odict/configdlg.h
+++ b/noncore/apps/odict/configdlg.h
@@ -7,6 +7,11 @@
7 * * 7 * *
8 **************************************************************************/ 8 **************************************************************************/
9 9
10class QWidget;
11class OTabWidget;
12class QListView;
13class QPushButton;
14
10#include <qdialog.h> 15#include <qdialog.h>
11 16
12 17
@@ -15,5 +20,18 @@ class ConfigDlg : public QDialog
15 Q_OBJECT 20 Q_OBJECT
16 21
17 public: 22 public:
18 ConfigDlg(QWidget *parent, const char *name); 23 ConfigDlg(QWidget *parent, const char *name, bool modal=FALSE );
24
25 void writeEntries();
26
27 private:
28 OTabWidget *tab;
29 QWidget *settings_tab, *search_tab;
30 QListView *list;
31 QPushButton *new_button, *change_button, *delete_button;
32
33 private slots:
34 void slotNewMethod();
35 void slotChangeMethod();
36 void slotDeleteMethod();
19}; 37};
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
index 857daaa..7f369d4 100644
--- a/noncore/apps/odict/odict.cpp
+++ b/noncore/apps/odict/odict.cpp
@@ -58,6 +58,28 @@ void ODict::slotStartQuery()
58 QString querystring = query_le->text(); 58 QString querystring = query_le->text();
59} 59}
60 60
61
62void ODict::slotSetErrorcount( int count )
63{
64 count = 1;
65}
66
67void ODict::slotSettings()
68{
69 ConfigDlg dlg( this, "Config" , true);
70 if ( dlg.exec() == QDialog::Accepted )
71 dlg.writeEntries();
72 else qDebug( "abgebrochen" );
73}
74
75void ODict::slotSetParameter( int /*count*/ )
76{
77 //X if ( int == 0 )
78 //X if ( int == 1 )
79 //X if ( int == 2 )
80 //X else qWarning( "ERROR" );
81}
82
61void ODict::setupMenus() 83void ODict::setupMenus()
62{ 84{
63 menu = new QMenuBar( this ); 85 menu = new QMenuBar( this );
@@ -67,8 +89,6 @@ void ODict::setupMenus()
67 connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); 89 connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) );
68 setting_a->addTo( settings ); 90 setting_a->addTo( settings );
69 setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 ); 91 setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 );
70 connect( setting_b, SIGNAL( activated() ), this, SLOT( slotSearchMethods() ) );
71 setting_b->addTo( settings );
72 92
73 parameter = new QPopupMenu( menu ); 93 parameter = new QPopupMenu( menu );
74 connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); 94 connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) );
@@ -95,23 +115,3 @@ void ODict::setupMenus()
95 menu->insertItem( tr( "Parameter" ) , parameter ); 115 menu->insertItem( tr( "Parameter" ) , parameter );
96 menu->insertItem( tr( "Help" ) , help ); 116 menu->insertItem( tr( "Help" ) , help );
97} 117}
98
99void ODict::slotSetErrorcount( int count )
100{
101}
102
103void ODict::slotSettings()
104{
105 ConfigDlg *dlg = new ConfigDlg( this, "Config" );
106}
107
108void ODict::slotSetParameter( int count )
109{
110 //X if ( int == 0 )
111 //X if ( int == 1 )
112 //X if ( int == 2 )
113 //X else qWarning( "ERROR" );
114}
115
116void ODict::slotSearchMethods(){}
117
diff --git a/noncore/apps/odict/odict.h b/noncore/apps/odict/odict.h
index 98db25e..30307c1 100644
--- a/noncore/apps/odict/odict.h
+++ b/noncore/apps/odict/odict.h
@@ -41,5 +41,4 @@ class ODict : public QMainWindow
41 void slotSetErrorcount( int ); 41 void slotSetErrorcount( int );
42 void slotSettings(); 42 void slotSettings();
43 void slotSetParameter( int ); 43 void slotSetParameter( int );
44 void slotSearchMethods();
45}; 44};
diff --git a/noncore/apps/odict/odict.pro b/noncore/apps/odict/odict.pro
index 7f5f30c..6257e5f 100644
--- a/noncore/apps/odict/odict.pro
+++ b/noncore/apps/odict/odict.pro
@@ -1,14 +1,16 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release
3 HEADERS = odict.h \ 3 HEADERS = odict.h \
4 searchmethoddlg.h \
4 configdlg.h 5 configdlg.h
5 6
6 SOURCES = main.cpp \ 7 SOURCES = main.cpp \
7 odict.cpp \ 8 odict.cpp \
9 searchmethoddlg.cpp \
8 configdlg.cpp 10 configdlg.cpp
9INCLUDEPATH += $(OPIEDIR)/include 11INCLUDEPATH += $(OPIEDIR)/include
10DEPENDPATH += $(OPIEDIR)/include 12DEPENDPATH += $(OPIEDIR)/include
11 LIBS += -lqpe -lstdc++ 13 LIBS += -lqpe -lstdc++ -lopie
12 TARGET = odict 14 TARGET = odict
13 DESTDIR = $(OPIEDIR)/bin 15 DESTDIR = $(OPIEDIR)/bin
14 16
diff --git a/noncore/apps/odict/searchmethoddlg.cpp b/noncore/apps/odict/searchmethoddlg.cpp
new file mode 100644
index 0000000..cd8a58a
--- a/dev/null
+++ b/noncore/apps/odict/searchmethoddlg.cpp
@@ -0,0 +1,36 @@
1/***************************************************************************
2 application: : ODict
3
4 begin : December 2002
5 copyright : ( C ) 2002, 2003 by Carsten Niehaus
6 email : cniehaus@handhelds.org
7 **************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * ( at your option ) any later version. *
15 * *
16 **************************************************************************/
17#include "searchmethoddlg.h"
18
19#include <qdialog.h>
20#include <qpe/config.h>
21#include <qlayout.h>
22
23#include <qhbox.h>
24#include <qvbox.h>
25#include <qlabel.h>
26#include <qpushbutton.h>
27#include <qstring.h>
28
29SearchMethodDlg::SearchMethodDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal)
30{
31 setCaption( tr( "New Searchmethod" ) );
32
33 itemName = "foo";
34 showMaximized();
35}
36
diff --git a/noncore/apps/odict/searchmethoddlg.h b/noncore/apps/odict/searchmethoddlg.h
new file mode 100644
index 0000000..e277cfb
--- a/dev/null
+++ b/noncore/apps/odict/searchmethoddlg.h
@@ -0,0 +1,29 @@
1/***************************************************************************
2 * *
3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or *
6 * ( at your option ) any later version. *
7 * *
8 **************************************************************************/
9
10class QWidget;
11class OTabWidget;
12class QListView;
13class QPushButton;
14class QLabel;
15class QString;
16
17#include <qdialog.h>
18
19
20class SearchMethodDlg : public QDialog
21{
22 Q_OBJECT
23
24 public:
25 SearchMethodDlg(QWidget *parent, const char *name, bool modal=FALSE );
26
27 QString itemName;
28
29};