summaryrefslogtreecommitdiff
path: root/noncore/apps/odict/odict.cpp
Unidiff
Diffstat (limited to 'noncore/apps/odict/odict.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/odict/odict.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
index 7de9169..2857c65 100644
--- a/noncore/apps/odict/odict.cpp
+++ b/noncore/apps/odict/odict.cpp
@@ -36,20 +36,23 @@
36 36
37#include <qpe/resource.h> 37#include <qpe/resource.h>
38 38
39 39
40ODict::ODict() : QMainWindow() 40ODict::ODict() : QMainWindow()
41{ 41{
42
43 activated_name = QString::null;
42 vbox = new QVBox( this ); 44 vbox = new QVBox( this );
43 setCaption( tr( "OPIE-Dictionary" ) ); 45 setCaption( tr( "OPIE-Dictionary" ) );
44 setupMenus(); 46 setupMenus();
45 47
46 QHBox *hbox = new QHBox( vbox ); 48 QHBox *hbox = new QHBox( vbox );
47 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show(); 49 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show();
48 query_le = new QLineEdit( hbox ); 50 query_le = new QLineEdit( hbox );
49 query_co = new QComboBox( hbox ); 51 query_co = new QComboBox( hbox );
52 connect( query_co , SIGNAL( activated(int) ), this, SLOT( slotMethodChanged(int) ) );
50 ok_button = new QPushButton( tr( "&Ok" ), hbox ); 53 ok_button = new QPushButton( tr( "&Ok" ), hbox );
51 connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) ); 54 connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) );
52 browser_top = new QTextBrowser( vbox ); 55 browser_top = new QTextBrowser( vbox );
53 browser_bottom = new QTextBrowser( vbox ); 56 browser_bottom = new QTextBrowser( vbox );
54 57
55 loadConfig(); 58 loadConfig();
@@ -89,13 +92,13 @@ void ODict::slotDisplayAbout()
89 QMessageBox::about( this, tr( "About ODict" ), tr( "OPIE-Dictionary ODict \n (c) 2002, 2003 Carsten Niehaus \n cniehaus@handhelds.org \n Version 20030103" ) ); 92 QMessageBox::about( this, tr( "About ODict" ), tr( "OPIE-Dictionary ODict \n (c) 2002, 2003 Carsten Niehaus \n cniehaus@handhelds.org \n Version 20030103" ) );
90} 93}
91 94
92void ODict::slotStartQuery() 95void ODict::slotStartQuery()
93{ 96{
94 QString querystring = query_le->text(); 97 QString querystring = query_le->text();
95 DingWidget *ding = new DingWidget( vbox , querystring , browser_top, browser_bottom); 98 DingWidget *ding = new DingWidget( vbox , querystring , browser_top, browser_bottom, activated_name);
96} 99}
97 100
98 101
99void ODict::slotSetErrorcount( int count ) 102void ODict::slotSetErrorcount( int count )
100{ 103{
101 errorTol = count; 104 errorTol = count;
@@ -133,12 +136,17 @@ void ODict::slotSetParameter( int count )
133 else 136 else
134 regexp = true; 137 regexp = true;
135 } 138 }
136 else qWarning( "ERROR" ); 139 else qWarning( "ERROR" );
137} 140}
138 141
142void ODict::slotMethodChanged( int methodnumber )
143{
144 activated_name = query_co->currentText();
145}
146
139void ODict::setupMenus() 147void ODict::setupMenus()
140{ 148{
141 menu = new QMenuBar( this ); 149 menu = new QMenuBar( this );
142 150
143 settings = new QPopupMenu( menu ); 151 settings = new QPopupMenu( menu );
144 setting_a = new QAction(tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 ); 152 setting_a = new QAction(tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 );