author | cniehaus <cniehaus> | 2003-01-03 19:26:23 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2003-01-03 19:26:23 (UTC) |
commit | d9818c21de144d42e5626bf8b9545bc592ce8ea1 (patch) (unidiff) | |
tree | 968995bb9b2144c41312bea39c857bb42520ca04 /noncore/apps/odict/odict.cpp | |
parent | 474cb6bb91c63618e5c4a2babeba36e01082667e (diff) | |
download | opie-d9818c21de144d42e5626bf8b9545bc592ce8ea1.zip opie-d9818c21de144d42e5626bf8b9545bc592ce8ea1.tar.gz opie-d9818c21de144d42e5626bf8b9545bc592ce8ea1.tar.bz2 |
tille
Diffstat (limited to 'noncore/apps/odict/odict.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/odict/odict.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp index 6c03ce3..166f6b9 100644 --- a/noncore/apps/odict/odict.cpp +++ b/noncore/apps/odict/odict.cpp | |||
@@ -26,84 +26,85 @@ | |||
26 | #include <qhbox.h> | 26 | #include <qhbox.h> |
27 | #include <qvbox.h> | 27 | #include <qvbox.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qlineedit.h> | 30 | #include <qlineedit.h> |
31 | #include <qmainwindow.h> | 31 | #include <qmainwindow.h> |
32 | #include <qstring.h> | 32 | #include <qstring.h> |
33 | #include <qaction.h> | 33 | #include <qaction.h> |
34 | #include <qtextbrowser.h> | 34 | #include <qtextbrowser.h> |
35 | 35 | ||
36 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
37 | 37 | ||
38 | 38 | ||
39 | ODict::ODict() : QMainWindow() | 39 | ODict::ODict() : QMainWindow() |
40 | { | 40 | { |
41 | vbox = new QVBox( this ); | 41 | vbox = new QVBox( this ); |
42 | setCaption( tr( "OPIE-Dictionary" ) ); | 42 | setCaption( tr( "OPIE-Dictionary" ) ); |
43 | setupMenus(); | 43 | setupMenus(); |
44 | 44 | ||
45 | QHBox *hbox = new QHBox( vbox ); | 45 | QHBox *hbox = new QHBox( vbox ); |
46 | QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show(); | 46 | QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show(); |
47 | query_le = new QLineEdit( hbox ); | 47 | query_le = new QLineEdit( hbox ); |
48 | ok_button = new QPushButton( tr( "&Ok" ), hbox ); | 48 | ok_button = new QPushButton( tr( "&Ok" ), hbox ); |
49 | connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) ); | 49 | connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) ); |
50 | browser = new QTextBrowser( vbox ); | 50 | browser_top = new QTextBrowser( vbox ); |
51 | browser_bottom = new QTextBrowser( vbox ); | ||
51 | 52 | ||
52 | loadConfig(); | 53 | loadConfig(); |
53 | setCentralWidget( vbox ); | 54 | setCentralWidget( vbox ); |
54 | } | 55 | } |
55 | 56 | ||
56 | void ODict::loadConfig() | 57 | void ODict::loadConfig() |
57 | { | 58 | { |
58 | Config cfg ( "odict" ); | 59 | Config cfg ( "odict" ); |
59 | cfg.setGroup( "generalsettings" ); | 60 | cfg.setGroup( "generalsettings" ); |
60 | errorTol = cfg.readEntry( "errtol" ).toInt(); | 61 | errorTol = cfg.readEntry( "errtol" ).toInt(); |
61 | casesens = cfg.readEntry( "casesens" ).toInt(); | 62 | casesens = cfg.readEntry( "casesens" ).toInt(); |
62 | regexp = cfg.readEntry( "regexp" ).toInt(); | 63 | regexp = cfg.readEntry( "regexp" ).toInt(); |
63 | completewords = cfg.readEntry( "completewords" ).toInt(); | 64 | completewords = cfg.readEntry( "completewords" ).toInt(); |
64 | } | 65 | } |
65 | 66 | ||
66 | 67 | ||
67 | void ODict::saveConfig() | 68 | void ODict::saveConfig() |
68 | { | 69 | { |
69 | Config cfg ( "odict" ); | 70 | Config cfg ( "odict" ); |
70 | cfg.setGroup( "generalsettings" ); | 71 | cfg.setGroup( "generalsettings" ); |
71 | cfg.writeEntry( "errtol" , errorTol ); | 72 | cfg.writeEntry( "errtol" , errorTol ); |
72 | cfg.writeEntry( "casesens" , casesens ); | 73 | cfg.writeEntry( "casesens" , casesens ); |
73 | cfg.writeEntry( "regexp" , regexp ); | 74 | cfg.writeEntry( "regexp" , regexp ); |
74 | cfg.writeEntry( "completewords" , completewords ); | 75 | cfg.writeEntry( "completewords" , completewords ); |
75 | } | 76 | } |
76 | 77 | ||
77 | void ODict::slotDisplayAbout() | 78 | void ODict::slotDisplayAbout() |
78 | { | 79 | { |
79 | QMessageBox::about( this, tr( "About ODict" ), tr( "OPIE-Dictionary ODict \n (c) 2002, 2003 Carsten Niehaus \n cniehaus@handhelds.org \n Version 20030103" ) ); | 80 | QMessageBox::about( this, tr( "About ODict" ), tr( "OPIE-Dictionary ODict \n (c) 2002, 2003 Carsten Niehaus \n cniehaus@handhelds.org \n Version 20030103" ) ); |
80 | } | 81 | } |
81 | 82 | ||
82 | void ODict::slotStartQuery() | 83 | void ODict::slotStartQuery() |
83 | { | 84 | { |
84 | QString querystring = query_le->text(); | 85 | QString querystring = query_le->text(); |
85 | DingWidget *ding = new DingWidget( vbox , querystring , browser); | 86 | DingWidget *ding = new DingWidget( vbox , querystring , browser_top, browser_bottom); |
86 | } | 87 | } |
87 | 88 | ||
88 | 89 | ||
89 | void ODict::slotSetErrorcount( int count ) | 90 | void ODict::slotSetErrorcount( int count ) |
90 | { | 91 | { |
91 | errorTol = count; | 92 | errorTol = count; |
92 | } | 93 | } |
93 | 94 | ||
94 | void ODict::slotSettings() | 95 | void ODict::slotSettings() |
95 | { | 96 | { |
96 | ConfigDlg dlg( this, "Config" , true); | 97 | ConfigDlg dlg( this, "Config" , true); |
97 | if ( dlg.exec() == QDialog::Accepted ) | 98 | if ( dlg.exec() == QDialog::Accepted ) |
98 | dlg.writeEntries(); | 99 | dlg.writeEntries(); |
99 | else qDebug( "abgebrochen" ); | 100 | else qDebug( "abgebrochen" ); |
100 | } | 101 | } |
101 | 102 | ||
102 | void ODict::slotSetParameter( int count ) | 103 | void ODict::slotSetParameter( int count ) |
103 | { | 104 | { |
104 | if ( count == 0 ) | 105 | if ( count == 0 ) |
105 | { | 106 | { |
106 | if ( casesens ) | 107 | if ( casesens ) |
107 | casesens = false; | 108 | casesens = false; |
108 | else | 109 | else |
109 | casesens = true; | 110 | casesens = true; |