summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/TODO8
-rw-r--r--noncore/apps/odict/configdlg.cpp26
-rw-r--r--noncore/apps/odict/configdlg.h19
-rw-r--r--noncore/apps/odict/main.cpp29
-rw-r--r--noncore/apps/odict/odict.cpp117
-rw-r--r--noncore/apps/odict/odict.h45
-rw-r--r--noncore/apps/odict/odict.pro31
-rw-r--r--noncore/apps/odict/opie-odict.control9
8 files changed, 284 insertions, 0 deletions
diff --git a/noncore/apps/odict/TODO b/noncore/apps/odict/TODO
new file mode 100644
index 0000000..308a10b
--- a/dev/null
+++ b/noncore/apps/odict/TODO
@@ -0,0 +1,8 @@
1TODO:
2
3small things:
4
5big things:
6* almost all
7
8wishes:
diff --git a/noncore/apps/odict/configdlg.cpp b/noncore/apps/odict/configdlg.cpp
new file mode 100644
index 0000000..2680d7a
--- a/dev/null
+++ b/noncore/apps/odict/configdlg.cpp
@@ -0,0 +1,26 @@
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 "configdlg.h"
18
19#include <qdialog.h>
20#include <qpe/config.h>
21
22ConfigDlg::ConfigDlg(QWidget *parent, const char *name) : QDialog(parent, name)
23{
24 this->show();
25 setCaption( tr( "Options" ) );
26}
diff --git a/noncore/apps/odict/configdlg.h b/noncore/apps/odict/configdlg.h
new file mode 100644
index 0000000..47f66bd
--- a/dev/null
+++ b/noncore/apps/odict/configdlg.h
@@ -0,0 +1,19 @@
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#include <qdialog.h>
11
12
13class ConfigDlg : public QDialog
14{
15 Q_OBJECT
16
17 public:
18 ConfigDlg(QWidget *parent, const char *name);
19};
diff --git a/noncore/apps/odict/main.cpp b/noncore/apps/odict/main.cpp
new file mode 100644
index 0000000..c68253f
--- a/dev/null
+++ b/noncore/apps/odict/main.cpp
@@ -0,0 +1,29 @@
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
18
19#include <qpe/qpeapplication.h>
20#include "odict.h"
21
22int main(int argc, char **argv)
23{
24 QPEApplication app(argc, argv);
25 ODict *odict= new ODict();
26 app.setMainWidget(odict);
27 odict->showMaximized();
28 return app.exec();
29}
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
new file mode 100644
index 0000000..857daaa
--- a/dev/null
+++ b/noncore/apps/odict/odict.cpp
@@ -0,0 +1,117 @@
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 "odict.h"
18#include "configdlg.h"
19
20#include <opie/otabwidget.h>
21
22#include <qpopupmenu.h>
23#include <qmenubar.h>
24#include <qmessagebox.h>
25#include <qpe/config.h>
26#include <qhbox.h>
27#include <qlabel.h>
28#include <qpushbutton.h>
29#include <qlineedit.h>
30#include <qmainwindow.h>
31#include <qstring.h>
32#include <qaction.h>
33
34#include <qpe/resource.h>
35
36
37ODict::ODict() : QMainWindow()
38{
39 setCaption( tr( "OPIE-Dictionary" ) );
40 setupMenus();
41
42 QHBox *hbox = new QHBox( this );
43 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show();
44 query_le = new QLineEdit( hbox );
45 ok_button = new QPushButton( tr( "&Ok" ), hbox );
46 connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) );
47
48 setCentralWidget( hbox );
49}
50
51void ODict::slotDisplayAbout()
52{
53 QMessageBox::about( this, tr( "About ODict" ), tr( "OPIE-Dictionary ODict \n (c) 2002, 2003 Carsten Niehaus \n cniehaus@handhelds.org \n Version 0.1" ) );
54}
55
56void ODict::slotStartQuery()
57{
58 QString querystring = query_le->text();
59}
60
61void ODict::setupMenus()
62{
63 menu = new QMenuBar( this );
64
65 settings = new QPopupMenu( menu );
66 setting_a = new QAction(tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 );
67 connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) );
68 setting_a->addTo( settings );
69 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
73 parameter = new QPopupMenu( menu );
74 connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) );
75 parameter->insertItem( tr( "C&ase sensitive" ), 0 );
76 parameter->insertItem( tr( "Only &complete Words" ), 1 ) ;
77 parameter->insertItem( tr( "Allow &reg. expressions" ), 2 );
78 parameter->insertSeparator();
79 error_tol_menu = new QPopupMenu( menu );
80 error_tol_menu->setCheckable( TRUE );
81 connect( error_tol_menu, SIGNAL( activated( int ) ), this, SLOT( slotSetErrorcount( int ) ) );
82
83 error_tol_menu->insertItem( tr( "0 Errors" ), 0 );
84 error_tol_menu->insertItem( tr( "1 Errors" ), 1 );
85 error_tol_menu->insertItem( tr( "2 Errors" ), 2 );
86 error_tol_menu->insertItem( tr( "3 Errors" ), 3 );
87 error_tol_menu->insertItem( tr( "4 Errors" ), 4 );
88 error_tol_menu->insertItem( tr( "Until Hit" ), 5 );
89 parameter->insertItem( tr( "&Error tolerance" ), error_tol_menu );
90
91 help = new QPopupMenu( menu );
92 help->insertItem("&About",this,SLOT( slotDisplayAbout() ));
93
94 menu->insertItem( tr( "Settings" ) , settings );
95 menu->insertItem( tr( "Parameter" ) , parameter );
96 menu->insertItem( tr( "Help" ) , help );
97}
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
new file mode 100644
index 0000000..98db25e
--- a/dev/null
+++ b/noncore/apps/odict/odict.h
@@ -0,0 +1,45 @@
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#include <qmainwindow.h>
11
12class QPopupMenu;
13class QMenuBar;
14class QHBox;
15class QPushButton;
16class QLineEdit;
17class QAction;
18class QActionGroup;
19
20class ODict : public QMainWindow
21{
22 Q_OBJECT
23
24 public:
25 ODict();
26
27 private:
28 QPopupMenu *help, *settings, *parameter, *error_tol_menu;
29 QMenuBar *menu;
30 QHBox *hbox;
31 QLineEdit *query_le;
32 QPushButton *ok_button;
33
34 QAction *setting_a, *setting_b;
35
36 void setupMenus();
37
38 private slots:
39 void slotDisplayAbout();
40 void slotStartQuery();
41 void slotSetErrorcount( int );
42 void slotSettings();
43 void slotSetParameter( int );
44 void slotSearchMethods();
45};
diff --git a/noncore/apps/odict/odict.pro b/noncore/apps/odict/odict.pro
new file mode 100644
index 0000000..7f5f30c
--- a/dev/null
+++ b/noncore/apps/odict/odict.pro
@@ -0,0 +1,31 @@
1 TEMPLATE= app
2 CONFIG = qt warn_on release
3 HEADERS = odict.h \
4 configdlg.h
5
6 SOURCES = main.cpp \
7 odict.cpp \
8 configdlg.cpp
9INCLUDEPATH += $(OPIEDIR)/include
10DEPENDPATH += $(OPIEDIR)/include
11 LIBS += -lqpe -lstdc++
12 TARGET = odict
13 DESTDIR = $(OPIEDIR)/bin
14
15TRANSLATIONS = ../../../i18n/de/odict.ts \
16 ../../../i18n/xx/odict.ts \
17 ../../../i18n/en/odict.ts \
18 ../../../i18n/es/odict.ts \
19 ../../../i18n/fr/odict.ts \
20 ../../../i18n/hu/odict.ts \
21 ../../../i18n/ja/odict.ts \
22 ../../../i18n/ko/odict.ts \
23 ../../../i18n/no/odict.ts \
24 ../../../i18n/pl/odict.ts \
25 ../../../i18n/pt/odict.ts \
26 ../../../i18n/pt_BR/odict.ts \
27 ../../../i18n/sl/odict.ts \
28 ../../../i18n/zh_CN/odict.ts \
29 ../../../i18n/zh_TW/odict.ts \
30 ../../../i18n/it/odict.ts \
31 ../../../i18n/da/odict.ts
diff --git a/noncore/apps/odict/opie-odict.control b/noncore/apps/odict/opie-odict.control
new file mode 100644
index 0000000..d9d125f
--- a/dev/null
+++ b/noncore/apps/odict/opie-odict.control
@@ -0,0 +1,9 @@
1Files: bin/odict apps/Applications/odict.desktop pics/odict/odict.png
2Priority: optional
3Section: applications
4Maintainer: Carsten Niehaus <cniehaus@handhelds.org>
5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION)
8Description: Dictionarylookupprogram
9 Look up words :)