summaryrefslogtreecommitdiff
path: root/noncore/apps/odict/odict.cpp
authortille <tille>2003-01-09 13:56:54 (UTC)
committer tille <tille>2003-01-09 13:56:54 (UTC)
commitda7a12b48efb1ff37d1316d77f52123778a403a4 (patch) (unidiff)
tree9122c888663a54e78c830410851289ceed0ea676 /noncore/apps/odict/odict.cpp
parentb83656c4faa3556a753b7b8642aef1264e8404f3 (diff)
downloadopie-da7a12b48efb1ff37d1316d77f52123778a403a4.zip
opie-da7a12b48efb1ff37d1316d77f52123778a403a4.tar.gz
opie-da7a12b48efb1ff37d1316d77f52123778a403a4.tar.bz2
commit for carsten
Diffstat (limited to 'noncore/apps/odict/odict.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/odict.cpp55
1 files changed, 42 insertions, 13 deletions
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
index 6f176f9..549c40a 100644
--- a/noncore/apps/odict/odict.cpp
+++ b/noncore/apps/odict/odict.cpp
@@ -39,11 +39,12 @@
39 39
40ODict::ODict() : QMainWindow() 40ODict::ODict() : QMainWindow()
41{ 41{
42
43 activated_name = QString::null; 42 activated_name = QString::null;
43
44 vbox = new QVBox( this ); 44 vbox = new QVBox( this );
45 setCaption( tr( "OPIE-Dictionary" ) ); 45 setCaption( tr( "OPIE-Dictionary" ) );
46 setupMenus(); 46 setupMenus();
47
47 48
48 QHBox *hbox = new QHBox( vbox ); 49 QHBox *hbox = new QHBox( vbox );
49 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show(); 50 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show();
@@ -55,6 +56,8 @@ ODict::ODict() : QMainWindow()
55 browser_top = new QTextBrowser( vbox ); 56 browser_top = new QTextBrowser( vbox );
56 browser_bottom = new QTextBrowser( vbox ); 57 browser_bottom = new QTextBrowser( vbox );
57 58
59 ding = new DingWidget();
60
58 loadConfig(); 61 loadConfig();
59 setCentralWidget( vbox ); 62 setCentralWidget( vbox );
60} 63}
@@ -75,6 +78,7 @@ void ODict::loadConfig()
75 cfg.setGroup( *it ); 78 cfg.setGroup( *it );
76 query_co->insertItem( cfg.readEntry( "Name" ) ); 79 query_co->insertItem( cfg.readEntry( "Name" ) );
77 } 80 }
81 slotMethodChanged(1 ); //FIXME: this line should not contain a integer
78} 82}
79 83
80 84
@@ -90,22 +94,47 @@ void ODict::saveConfig()
90 94
91void ODict::slotDisplayAbout() 95void ODict::slotDisplayAbout()
92{ 96{
93 QMessageBox::about( this, tr( "About ODict" ), tr( "OPIE-Dictionary ODict \n (c) 2002, 2003 Carsten Niehaus \n cniehaus@handhelds.org \n Version 20030104" ) ); 97 QMessageBox::about( this, tr( "About ODict" ), tr( "OPIE-Dictionary ODict \n (c) 2002, 2003 Carsten Niehaus \n cniehaus@handhelds.org \n Version 20030108" ) );
94} 98}
95 99
96void ODict::slotStartQuery() 100void ODict::slotStartQuery()
97{ 101{
98 QString querystring = query_le->text(); 102 QString querystring = query_le->text();
99 qDebug("opening dict >%s< for >%s<", activated_name.latin1(),querystring.latin1()); 103 //X qDebug("opening dict >%s< for >%s<", activated_name.latin1(),querystring.latin1());
100 if (querystring.isEmpty()){ 104 //X if (querystring.isEmpty()){
101 qWarning("empty querystring"); 105 //X qWarning("empty querystring");
102 return; 106 //X return;
103 } 107 //X }
104 if (!activated_name || activated_name.isEmpty()) 108 //X if (!activated_name || activated_name.isEmpty())
105 QMessageBox::warning(this,tr("No Dictionary"),tr("Please choose a dictonary") ); 109 //X QMessageBox::warning(this,tr("No Dictionary"),tr("Please choose a dictonary") );
106 else 110 //X else
107 DingWidget *ding = new DingWidget( querystring , browser_top, browser_bottom, activated_name ); 111 //X {
108 ding->setText(); 112
113 ding->setCaseSensitive( casesens );
114 ding->setCompleteWord( completewords );
115 ding->setDict( activated_name );
116
117 qDebug( " activated_name ist :" );
118 qDebug( activated_name );
119
120 qDebug( " loadedDict() ist :" );
121 qDebug( ding->loadedDict() );
122 if ( activated_name != ding->loadedDict() )
123 {
124 qDebug( "ComboBox geändert" );
125 ding->loadDict(activated_name);
126 }
127 else qDebug( "ComboBox war GLEICH" );
128
129 BroswerContent test = ding->setText( querystring );
130
131 browser_top->setText( test.top );
132 browser_bottom->setText( test.bottom );
133
134 qDebug( "Text sollte gesetzt sein..." );
135
136 //X }
137
109} 138}
110 139
111 140
@@ -152,7 +181,7 @@ void ODict::slotSetParameter( int count )
152 else qWarning( "ERROR" ); 181 else qWarning( "ERROR" );
153} 182}
154 183
155void ODict::slotMethodChanged( int methodnumber ) 184void ODict::slotMethodChanged( int /*methodnumber*/ )
156{ 185{
157 activated_name = query_co->currentText(); 186 activated_name = query_co->currentText();
158} 187}