summaryrefslogtreecommitdiff
path: root/noncore/apps/odict
authorcniehaus <cniehaus>2003-05-02 22:10:18 (UTC)
committer cniehaus <cniehaus>2003-05-02 22:10:18 (UTC)
commite83acc761bfe83ccd80b8ef6ab1275ee5c26e14f (patch) (unidiff)
tree6211385225d342dc9062615f080d5764d7251beb /noncore/apps/odict
parentadefcec2af37482266dbbd0e56b7e57f483c0540 (diff)
downloadopie-e83acc761bfe83ccd80b8ef6ab1275ee5c26e14f.zip
opie-e83acc761bfe83ccd80b8ef6ab1275ee5c26e14f.tar.gz
opie-e83acc761bfe83ccd80b8ef6ab1275ee5c26e14f.tar.bz2
265 lines diff :) mostly markupstuff. But also one bug less
Diffstat (limited to 'noncore/apps/odict') (more/less context) (show 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.cpp27
-rw-r--r--noncore/apps/odict/odict.h5
5 files changed, 31 insertions, 14 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
@@ -69,5 +69,5 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(pa
69void ConfigDlg::writeEntries() 69void ConfigDlg::writeEntries()
70{ 70{
71 qDebug( "richtig beendet" ); 71 //XXX wozu gibt es diese Methode?
72} 72}
73 73
@@ -77,10 +77,8 @@ void ConfigDlg::slotNewMethod()
77 if ( dlg.exec() == QDialog::Accepted ) 77 if ( dlg.exec() == QDialog::Accepted )
78 { 78 {
79 //if ( !dlg.nameLE->text() ) return; //XXX
80 dlg.saveItem(); 79 dlg.saveItem();
81 QListViewItem *item = new QListViewItem( list ); 80 QListViewItem *item = new QListViewItem( list );
82 item->setText( 0 , dlg.nameLE->text() ); 81 item->setText( 0 , dlg.nameLE->text() );
83 } 82 }
84 else qDebug( "SearchMethodDlg abgebrochen" );
85} 83}
86 84
@@ -92,12 +90,9 @@ void ConfigDlg::slotChangeMethod()
92 if ( dlg.exec() == QDialog::Accepted ) 90 if ( dlg.exec() == QDialog::Accepted )
93 { 91 {
94 //if ( !dlg.nameLE->text() ) return; //XXX geht vielleich nicht
95 dlg.saveItem(); 92 dlg.saveItem();
96 QListViewItem *item = list->selectedItem(); 93 QListViewItem *item = list->selectedItem();
97 item->setText( 0 , dlg.nameLE->text() ); 94 item->setText( 0 , dlg.nameLE->text() );
98 } 95 }
99 else qDebug( "SearchMethodDlg abgebrochen" );
100 } 96 }
101 else qDebug( "kein item angewählt" );
102} 97}
103 98
@@ -113,5 +108,4 @@ void ConfigDlg::slotDeleteMethod()
113 list->takeItem( list->selectedItem() ); 108 list->takeItem( list->selectedItem() );
114 } 109 }
115 else qDebug("no item selected");
116} 110}
117 111
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
@@ -90,4 +90,6 @@ void DingWidget::loadValues()
90 cfg.setGroup( "Method_" + methodname ); 90 cfg.setGroup( "Method_" + methodname );
91 trenner = cfg.readEntry( "Seperator" ); 91 trenner = cfg.readEntry( "Seperator" );
92 lang1_name = cfg.readEntry( "Lang1" );
93 lang2_name = cfg.readEntry( "Lang2" );
92} 94}
93 95
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,4 +32,7 @@ class DingWidget
32 void loadValues(); 32 void loadValues();
33 33
34 QString lang1_name,
35 lang2_name;
36
34 private: 37 private:
35 BroswerContent parseInfo(); 38 BroswerContent parseInfo();
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
@@ -47,11 +47,14 @@ ODict::ODict() : QMainWindow()
47 47
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 );
57 60
@@ -79,5 +82,5 @@ void ODict::loadConfig()
79 query_co->insertItem( cfg.readEntry( "Name" ) ); 82 query_co->insertItem( cfg.readEntry( "Name" ) );
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}
83 86
@@ -95,4 +98,6 @@ void ODict::saveConfig()
95void ODict::slotStartQuery() 98void ODict::slotStartQuery()
96{ 99{
100 if ( !query_le->text( ).isEmpty() )
101 {
97 /* 102 /*
98 * if the user has not yet defined a dictionary 103 * if the user has not yet defined a dictionary
@@ -123,4 +128,6 @@ void ODict::slotStartQuery()
123 ding->setCompleteWord( completewords ); 128 ding->setCompleteWord( completewords );
124 ding->setDict( activated_name ); 129 ding->setDict( activated_name );
130 top_name->setText( ding->lang1_name );
131 bottom_name->setText( ding->lang2_name );
125 132
126 if ( activated_name != ding->loadedDict() ) 133 if ( activated_name != ding->loadedDict() )
@@ -132,4 +139,5 @@ void ODict::slotStartQuery()
132 browser_bottom->setText( test.bottom ); 139 browser_bottom->setText( test.bottom );
133} 140}
141}
134 142
135 143
@@ -147,5 +155,4 @@ void ODict::slotSettings()
147 loadConfig(); 155 loadConfig();
148 } 156 }
149 else qDebug( "abgebrochen" );
150} 157}
151 158
@@ -177,7 +184,15 @@ void ODict::slotSetParameter( int count )
177} 184}
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}
183 198
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
@@ -10,4 +10,5 @@
10#include <qmainwindow.h> 10#include <qmainwindow.h>
11 11
12class QLabel;
12class QVBox; 13class QVBox;
13class QPopupMenu; 14class QPopupMenu;
@@ -56,4 +57,6 @@ class ODict : public QMainWindow
56 57
57 QString activated_name; 58 QString activated_name;
59 QLabel *bottom_name,
60 *top_name;
58 61
59 private slots: 62 private slots:
@@ -62,4 +65,4 @@ class ODict : public QMainWindow
62 void slotSettings(); 65 void slotSettings();
63 void slotSetParameter( int ); 66 void slotSetParameter( int );
64 void slotMethodChanged( int ); 67 void slotMethodChanged( const QString& );
65}; 68};