author | cniehaus <cniehaus> | 2002-12-29 14:15:31 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-12-29 14:15:31 (UTC) |
commit | 5a0893171cf82ebad8347ab9dbc1193f9fcabda3 (patch) (unidiff) | |
tree | c310a0a1d23087c3eba6d81eb07edc6437d90110 | |
parent | da7abab7d817a22b8b6680027b6162d68b28ae98 (diff) | |
download | opie-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
-rw-r--r-- | noncore/apps/odict/.cvsignore | 5 | ||||
-rw-r--r-- | noncore/apps/odict/configdlg.cpp | 70 | ||||
-rw-r--r-- | noncore/apps/odict/configdlg.h | 20 | ||||
-rw-r--r-- | noncore/apps/odict/odict.cpp | 44 | ||||
-rw-r--r-- | noncore/apps/odict/odict.h | 1 | ||||
-rw-r--r-- | noncore/apps/odict/odict.pro | 4 | ||||
-rw-r--r-- | noncore/apps/odict/searchmethoddlg.cpp | 36 | ||||
-rw-r--r-- | noncore/apps/odict/searchmethoddlg.h | 29 |
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 | *~ | ||
2 | Makefile* | ||
3 | *.moc | ||
4 | config.in | ||
5 | moc_* | ||
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 | |||
@@ -16,11 +16,77 @@ | |||
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 | ||
22 | ConfigDlg::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 | |||
32 | ConfigDlg::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 | |||
68 | void ConfigDlg::writeEntries() | ||
69 | { | ||
70 | qDebug( "richtig beendet" ); | ||
71 | } | ||
72 | |||
73 | void 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 | |||
85 | void ConfigDlg::slotChangeMethod(){} | ||
86 | |||
87 | void 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 | |||
@@ -8,4 +8,9 @@ | |||
8 | **************************************************************************/ | 8 | **************************************************************************/ |
9 | 9 | ||
10 | class QWidget; | ||
11 | class OTabWidget; | ||
12 | class QListView; | ||
13 | class QPushButton; | ||
14 | |||
10 | #include <qdialog.h> | 15 | #include <qdialog.h> |
11 | 16 | ||
@@ -16,4 +21,17 @@ class ConfigDlg : public QDialog | |||
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 | |||
@@ -59,4 +59,26 @@ void ODict::slotStartQuery() | |||
59 | } | 59 | } |
60 | 60 | ||
61 | |||
62 | void ODict::slotSetErrorcount( int count ) | ||
63 | { | ||
64 | count = 1; | ||
65 | } | ||
66 | |||
67 | void ODict::slotSettings() | ||
68 | { | ||
69 | ConfigDlg dlg( this, "Config" , true); | ||
70 | if ( dlg.exec() == QDialog::Accepted ) | ||
71 | dlg.writeEntries(); | ||
72 | else qDebug( "abgebrochen" ); | ||
73 | } | ||
74 | |||
75 | void 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 | |||
61 | void ODict::setupMenus() | 83 | void ODict::setupMenus() |
62 | { | 84 | { |
@@ -68,6 +90,4 @@ void ODict::setupMenus() | |||
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 ); |
@@ -96,22 +116,2 @@ void ODict::setupMenus() | |||
96 | menu->insertItem( tr( "Help" ) , help ); | 116 | menu->insertItem( tr( "Help" ) , help ); |
97 | } | 117 | } |
98 | |||
99 | void ODict::slotSetErrorcount( int count ) | ||
100 | { | ||
101 | } | ||
102 | |||
103 | void ODict::slotSettings() | ||
104 | { | ||
105 | ConfigDlg *dlg = new ConfigDlg( this, "Config" ); | ||
106 | } | ||
107 | |||
108 | void 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 | |||
116 | void 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 | |||
@@ -42,4 +42,3 @@ class ODict : public QMainWindow | |||
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 | |||
@@ -2,12 +2,14 @@ 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 |
9 | INCLUDEPATH += $(OPIEDIR)/include | 11 | INCLUDEPATH += $(OPIEDIR)/include |
10 | DEPENDPATH += $(OPIEDIR)/include | 12 | DEPENDPATH += $(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 |
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 | |||
29 | SearchMethodDlg::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 | |||
10 | class QWidget; | ||
11 | class OTabWidget; | ||
12 | class QListView; | ||
13 | class QPushButton; | ||
14 | class QLabel; | ||
15 | class QString; | ||
16 | |||
17 | #include <qdialog.h> | ||
18 | |||
19 | |||
20 | class 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 | }; | ||