summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/configdlg.cpp8
-rw-r--r--noncore/apps/odict/dingwidget.cpp2
-rw-r--r--noncore/apps/odict/dingwidget.h3
-rw-r--r--noncore/apps/odict/odict.cpp99
-rw-r--r--noncore/apps/odict/odict.h5
5 files changed, 67 insertions, 50 deletions
diff --git a/noncore/apps/odict/configdlg.cpp b/noncore/apps/odict/configdlg.cpp
index eba7dec..1608486 100644
--- a/noncore/apps/odict/configdlg.cpp
+++ b/noncore/apps/odict/configdlg.cpp
@@ -70,3 +70,3 @@ void ConfigDlg::writeEntries()
70{ 70{
71 qDebug( "richtig beendet" ); 71 //XXX wozu gibt es diese Methode?
72} 72}
@@ -78,3 +78,2 @@ void ConfigDlg::slotNewMethod()
78 { 78 {
79 //if ( !dlg.nameLE->text() ) return; //XXX
80 dlg.saveItem(); 79 dlg.saveItem();
@@ -83,3 +82,2 @@ void ConfigDlg::slotNewMethod()
83 } 82 }
84 else qDebug( "SearchMethodDlg abgebrochen" );
85} 83}
@@ -93,3 +91,2 @@ void ConfigDlg::slotChangeMethod()
93 { 91 {
94 //if ( !dlg.nameLE->text() ) return; //XXX geht vielleich nicht
95 dlg.saveItem(); 92 dlg.saveItem();
@@ -98,5 +95,3 @@ void ConfigDlg::slotChangeMethod()
98 } 95 }
99 else qDebug( "SearchMethodDlg abgebrochen" );
100 } 96 }
101 else qDebug( "kein item angewählt" );
102} 97}
@@ -114,3 +109,2 @@ void ConfigDlg::slotDeleteMethod()
114 } 109 }
115 else qDebug("no item selected");
116} 110}
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp
index abb5e75..0707bfb 100644
--- a/noncore/apps/odict/dingwidget.cpp
+++ b/noncore/apps/odict/dingwidget.cpp
@@ -91,2 +91,4 @@ void DingWidget::loadValues()
91 trenner = cfg.readEntry( "Seperator" ); 91 trenner = cfg.readEntry( "Seperator" );
92 lang1_name = cfg.readEntry( "Lang1" );
93 lang2_name = cfg.readEntry( "Lang2" );
92} 94}
diff --git a/noncore/apps/odict/dingwidget.h b/noncore/apps/odict/dingwidget.h
index 74f40c9..d8466cb 100644
--- a/noncore/apps/odict/dingwidget.h
+++ b/noncore/apps/odict/dingwidget.h
@@ -32,2 +32,5 @@ class DingWidget
32 void loadValues(); 32 void loadValues();
33
34 QString lang1_name,
35 lang2_name;
33 36
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
index 9f9a8d9..cb9c4e0 100644
--- a/noncore/apps/odict/odict.cpp
+++ b/noncore/apps/odict/odict.cpp
@@ -48,9 +48,12 @@ ODict::ODict() : QMainWindow()
48 QHBox *hbox = new QHBox( vbox ); 48 QHBox *hbox = new QHBox( vbox );
49 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show(); 49 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox );
50 query_label->show();
50 query_le = new QLineEdit( hbox ); 51 query_le = new QLineEdit( hbox );
51 query_co = new QComboBox( hbox ); 52 query_co = new QComboBox( hbox );
52 connect( query_co , SIGNAL( activated(int) ), this, SLOT( slotMethodChanged(int) ) ); 53 connect( query_co , SIGNAL( activated(const QString&) ), this, SLOT( slotMethodChanged(const QString&) ) );
53 ok_button = new QPushButton( tr( "&Ok" ), hbox ); 54 ok_button = new QPushButton( tr( "&Ok" ), hbox );
54 connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) ); 55 connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) );
56 top_name = new QLabel( vbox );
55 browser_top = new QTextBrowser( vbox ); 57 browser_top = new QTextBrowser( vbox );
58 bottom_name = new QLabel( vbox );
56 browser_bottom = new QTextBrowser( vbox ); 59 browser_bottom = new QTextBrowser( vbox );
@@ -59,3 +62,3 @@ ODict::ODict() : QMainWindow()
59 ding->loadValues(); 62 ding->loadValues();
60 63
61 loadConfig(); 64 loadConfig();
@@ -80,3 +83,3 @@ void ODict::loadConfig()
80 } 83 }
81 slotMethodChanged( 1 ); //FIXME: this line should not contain a integer 84 //XXXslotMethodChanged( "1" ); //FIXME: this line should not contain a integer
82} 85}
@@ -96,38 +99,43 @@ void ODict::slotStartQuery()
96{ 99{
97 /* 100 if ( !query_le->text( ).isEmpty() )
98 * if the user has not yet defined a dictionary
99 */
100 if ( !query_co->currentText() )
101 { 101 {
102 switch ( QMessageBox::information( this, tr( "OPIE-Dictionary" ), 102 /*
103 tr( "No dictionary defined" ), 103 * if the user has not yet defined a dictionary
104 tr( "&Define one" ), 104 */
105 tr( "&Cancel" ), 105 if ( !query_co->currentText() )
106 0, // Define a dict choosen 106 {
107 1 ) ) // Cancel choosen 107 switch ( QMessageBox::information( this, tr( "OPIE-Dictionary" ),
108 { 108 tr( "No dictionary defined" ),
109 109 tr( "&Define one" ),
110 case 0: 110 tr( "&Cancel" ),
111 slotSettings(); 111 0, // Define a dict choosen
112 break; 112 1 ) ) // Cancel choosen
113 case 1: // stop here 113 {
114 return; 114
115 } 115 case 0:
116 } 116 slotSettings();
117 117 break;
118 /* 118 case 1: // stop here
119 * ok, the user has defined a dict 119 return;
120 */ 120 }
121 QString querystring = query_le->text(); 121 }
122 ding->setCaseSensitive( casesens ); 122
123 ding->setCompleteWord( completewords ); 123 /*
124 ding->setDict( activated_name ); 124 * ok, the user has defined a dict
125 125 */
126 if ( activated_name != ding->loadedDict() ) 126 QString querystring = query_le->text();
127 ding->loadDict(activated_name); 127 ding->setCaseSensitive( casesens );
128 128 ding->setCompleteWord( completewords );
129 BroswerContent test = ding->setText( querystring ); 129 ding->setDict( activated_name );
130 130 top_name->setText( ding->lang1_name );
131 browser_top->setText( test.top ); 131 bottom_name->setText( ding->lang2_name );
132 browser_bottom->setText( test.bottom ); 132
133 if ( activated_name != ding->loadedDict() )
134 ding->loadDict(activated_name);
135
136 BroswerContent test = ding->setText( querystring );
137
138 browser_top->setText( test.top );
139 browser_bottom->setText( test.bottom );
140 }
133} 141}
@@ -148,3 +156,2 @@ void ODict::slotSettings()
148 } 156 }
149 else qDebug( "abgebrochen" );
150} 157}
@@ -178,5 +185,13 @@ void ODict::slotSetParameter( int count )
178 185
179void ODict::slotMethodChanged( int /*methodnumber*/ ) 186void ODict::slotMethodChanged( const QString& methodnumber )
180{ 187{
181 activated_name = query_co->currentText(); 188 activated_name = methodnumber;
189
190 if ( activated_name != ding->loadedDict() )
191 ding->loadDict(activated_name);
192
193 top_name->setText( ding->lang1_name );
194 top_name->setAlignment( AlignHCenter );
195 bottom_name->setText( ding->lang2_name );
196 bottom_name->setAlignment( AlignHCenter );
182} 197}
diff --git a/noncore/apps/odict/odict.h b/noncore/apps/odict/odict.h
index 3065feb..b9a0778 100644
--- a/noncore/apps/odict/odict.h
+++ b/noncore/apps/odict/odict.h
@@ -11,2 +11,3 @@
11 11
12class QLabel;
12class QVBox; 13class QVBox;
@@ -57,2 +58,4 @@ class ODict : public QMainWindow
57 QString activated_name; 58 QString activated_name;
59 QLabel *bottom_name,
60 *top_name;
58 61
@@ -63,3 +66,3 @@ class ODict : public QMainWindow
63 void slotSetParameter( int ); 66 void slotSetParameter( int );
64 void slotMethodChanged( int ); 67 void slotMethodChanged( const QString& );
65}; 68};