-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 16 | ||||
-rw-r--r-- | noncore/apps/odict/dingwidget.h | 5 | ||||
-rw-r--r-- | noncore/apps/odict/odict.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/odict/odict.h | 5 |
4 files changed, 30 insertions, 6 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp index 8f5a7ae..b69a803 100644 --- a/noncore/apps/odict/dingwidget.cpp +++ b/noncore/apps/odict/dingwidget.cpp | |||
@@ -31,7 +31,10 @@ | |||
31 | #include <stdlib.h> // for getenv | 31 | #include <stdlib.h> // for getenv |
32 | 32 | ||
33 | DingWidget::DingWidget(QWidget *parent, QString word, QTextBrowser *browser_top, QTextBrowser *browser_bottom) : QWidget(parent) | 33 | DingWidget::DingWidget(QWidget *parent, QString word, QTextBrowser *browser_top, QTextBrowser *browser_bottom, QString activated_name) : QWidget(parent) |
34 | { | 34 | { |
35 | methodname = activated_name; | ||
35 | queryword = word; | 36 | queryword = word; |
37 | trenner = QString::null; | ||
38 | loadValues(); | ||
36 | QString opie_dir = getenv("OPIEDIR"); | 39 | QString opie_dir = getenv("OPIEDIR"); |
37 | QFile file( opie_dir+"/noncore/apps/odict/eng_ita.dic" ); | 40 | QFile file( opie_dir+"/noncore/apps/odict/eng_ita.dic" ); |
@@ -51,10 +54,16 @@ DingWidget::DingWidget(QWidget *parent, QString word, QTextBrowser *browser_top, | |||
51 | 54 | ||
52 | QString top, bottom; | 55 | QString top, bottom; |
53 | 56 | //parseInfo( lines, top , bottom ); | |
54 | parseInfo( lines, top , bottom ); | ||
55 | browser_top->setText( top ); | 57 | browser_top->setText( top ); |
56 | browser_bottom->setText( bottom ); | 58 | browser_bottom->setText( bottom ); |
57 | } | 59 | } |
58 | 60 | ||
61 | void DingWidget::loadValues() | ||
62 | { | ||
63 | Config cfg( "odict" ); | ||
64 | cfg.setGroup( "Method_"+methodname ); | ||
65 | trenner = cfg.readEntry( "Seperator" ); | ||
66 | } | ||
67 | |||
59 | void DingWidget::parseInfo( QStringList &lines, QString &top, QString &bottom ) | 68 | void DingWidget::parseInfo( QStringList &lines, QString &top, QString &bottom ) |
60 | { | 69 | { |
@@ -69,4 +78,5 @@ void DingWidget::parseInfo( QStringList &lines, QString &top, QString &bottom ) | |||
69 | QString html_table_right = "</td></tr>"; | 78 | QString html_table_right = "</td></tr>"; |
70 | QRegExp reg_div( "\\" ); | 79 | QRegExp reg_div( "\\" ); |
80 | //QRegExp reg_div( trenner ); | ||
71 | QRegExp reg_word( queryword ); | 81 | QRegExp reg_word( queryword ); |
72 | //QString substitute = "<font color=red>"+queryword+"</font>"; | 82 | //QString substitute = "<font color=red>"+queryword+"</font>"; |
diff --git a/noncore/apps/odict/dingwidget.h b/noncore/apps/odict/dingwidget.h index cba1edf..66379fe 100644 --- a/noncore/apps/odict/dingwidget.h +++ b/noncore/apps/odict/dingwidget.h | |||
@@ -20,5 +20,5 @@ class DingWidget : public QWidget | |||
20 | 20 | ||
21 | public: | 21 | public: |
22 | DingWidget(QWidget *parent = 0, QString word = 0, QTextBrowser* = 0, QTextBrowser* =0); | 22 | DingWidget(QWidget *parent = 0, QString word = 0, QTextBrowser* = 0, QTextBrowser* =0, QString activated_name=0); |
23 | 23 | ||
24 | private: | 24 | private: |
@@ -26,3 +26,6 @@ class DingWidget : public QWidget | |||
26 | void parseInfo( QStringList& , QString&, QString& ); | 26 | void parseInfo( QStringList& , QString&, QString& ); |
27 | QString queryword; | 27 | QString queryword; |
28 | void loadValues(); | ||
29 | QString methodname; | ||
30 | QString trenner; | ||
28 | }; | 31 | }; |
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 | |||
@@ -40,4 +40,6 @@ | |||
40 | ODict::ODict() : QMainWindow() | 40 | ODict::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" ) ); |
@@ -48,4 +50,5 @@ ODict::ODict() : QMainWindow() | |||
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() ) ); |
@@ -93,5 +96,5 @@ void 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 | ||
@@ -137,4 +140,9 @@ void ODict::slotSetParameter( int count ) | |||
137 | } | 140 | } |
138 | 141 | ||
142 | void ODict::slotMethodChanged( int methodnumber ) | ||
143 | { | ||
144 | activated_name = query_co->currentText(); | ||
145 | } | ||
146 | |||
139 | void ODict::setupMenus() | 147 | void ODict::setupMenus() |
140 | { | 148 | { |
diff --git a/noncore/apps/odict/odict.h b/noncore/apps/odict/odict.h index 7c1f32f..5096c5e 100644 --- a/noncore/apps/odict/odict.h +++ b/noncore/apps/odict/odict.h | |||
@@ -45,5 +45,5 @@ class ODict : public QMainWindow | |||
45 | QAction *setting_a, *setting_b; | 45 | QAction *setting_a, *setting_b; |
46 | 46 | ||
47 | //DingWidget *ding; | 47 | DingWidget *ding; |
48 | 48 | ||
49 | void setupMenus(); | 49 | void setupMenus(); |
@@ -54,4 +54,6 @@ class ODict : public QMainWindow | |||
54 | void loadConfig(); | 54 | void loadConfig(); |
55 | void saveConfig(); | 55 | void saveConfig(); |
56 | |||
57 | QString activated_name; | ||
56 | 58 | ||
57 | private slots: | 59 | private slots: |
@@ -61,3 +63,4 @@ class ODict : public QMainWindow | |||
61 | void slotSettings(); | 63 | void slotSettings(); |
62 | void slotSetParameter( int ); | 64 | void slotSetParameter( int ); |
65 | void slotMethodChanged( int ); | ||
63 | }; | 66 | }; |