-rw-r--r-- | noncore/apps/odict/configdlg.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/odict/odict.cpp | 40 |
3 files changed, 18 insertions, 30 deletions
diff --git a/noncore/apps/odict/configdlg.cpp b/noncore/apps/odict/configdlg.cpp index 89bc6f6..eba7dec 100644 --- a/noncore/apps/odict/configdlg.cpp +++ b/noncore/apps/odict/configdlg.cpp | |||
@@ -76,6 +76,7 @@ void ConfigDlg::slotNewMethod() | |||
76 | SearchMethodDlg dlg( this, "SearchMethodDlg", true ); | 76 | SearchMethodDlg dlg( this, "SearchMethodDlg", true ); |
77 | if ( dlg.exec() == QDialog::Accepted ) | 77 | if ( dlg.exec() == QDialog::Accepted ) |
78 | { | 78 | { |
79 | //if ( !dlg.nameLE->text() ) return; //XXX | ||
79 | dlg.saveItem(); | 80 | dlg.saveItem(); |
80 | QListViewItem *item = new QListViewItem( list ); | 81 | QListViewItem *item = new QListViewItem( list ); |
81 | item->setText( 0 , dlg.nameLE->text() ); | 82 | item->setText( 0 , dlg.nameLE->text() ); |
@@ -90,6 +91,7 @@ void ConfigDlg::slotChangeMethod() | |||
90 | SearchMethodDlg dlg( this, "SearchMethodDlg", true, list->selectedItem()->text( 0 ) ); | 91 | SearchMethodDlg dlg( this, "SearchMethodDlg", true, list->selectedItem()->text( 0 ) ); |
91 | if ( dlg.exec() == QDialog::Accepted ) | 92 | if ( dlg.exec() == QDialog::Accepted ) |
92 | { | 93 | { |
94 | //if ( !dlg.nameLE->text() ) return; //XXX geht vielleich nicht | ||
93 | dlg.saveItem(); | 95 | dlg.saveItem(); |
94 | QListViewItem *item = list->selectedItem(); | 96 | QListViewItem *item = list->selectedItem(); |
95 | item->setText( 0 , dlg.nameLE->text() ); | 97 | item->setText( 0 , dlg.nameLE->text() ); |
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp index 5c4b13b..abb5e75 100644 --- a/noncore/apps/odict/dingwidget.cpp +++ b/noncore/apps/odict/dingwidget.cpp | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | #include <qregexp.h> | 29 | #include <qregexp.h> |
30 | #include <qtextbrowser.h> | 30 | #include <qtextbrowser.h> |
31 | #include <stdlib.h> // for getenv | 31 | //#include <stdlib.h> // for getenv |
32 | 32 | ||
33 | DingWidget::DingWidget( ) | 33 | DingWidget::DingWidget( ) |
34 | { | 34 | { |
@@ -40,9 +40,8 @@ DingWidget::DingWidget( ) | |||
40 | void DingWidget::loadDict( QString name ) | 40 | void DingWidget::loadDict( QString name ) |
41 | { | 41 | { |
42 | dictName = name; | 42 | dictName = name; |
43 | QString opie_dir = getenv("OPIEDIR"); | ||
44 | |||
45 | Config cfg( "odict" ); | 43 | Config cfg( "odict" ); |
44 | if ( !methodname ) return; | ||
46 | cfg.setGroup( "Method_" + methodname ); | 45 | cfg.setGroup( "Method_" + methodname ); |
47 | QFile file( cfg.readEntry( "file" ) ); | 46 | QFile file( cfg.readEntry( "file" ) ); |
48 | 47 | ||
@@ -86,6 +85,7 @@ void DingWidget::setQueryWord( QString qword ) | |||
86 | 85 | ||
87 | void DingWidget::loadValues() | 86 | void DingWidget::loadValues() |
88 | { | 87 | { |
88 | if ( !methodname ) return; | ||
89 | Config cfg( "odict" ); | 89 | Config cfg( "odict" ); |
90 | cfg.setGroup( "Method_" + methodname ); | 90 | cfg.setGroup( "Method_" + methodname ); |
91 | trenner = cfg.readEntry( "Seperator" ); | 91 | trenner = cfg.readEntry( "Seperator" ); |
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp index a404e89..cc3148a 100644 --- a/noncore/apps/odict/odict.cpp +++ b/noncore/apps/odict/odict.cpp | |||
@@ -44,7 +44,6 @@ ODict::ODict() : QMainWindow() | |||
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 | |||
48 | 47 | ||
49 | QHBox *hbox = new QHBox( vbox ); | 48 | QHBox *hbox = new QHBox( vbox ); |
50 | QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show(); | 49 | QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); query_label->show(); |
@@ -96,30 +95,17 @@ void ODict::saveConfig() | |||
96 | void ODict::slotStartQuery() | 95 | void ODict::slotStartQuery() |
97 | { | 96 | { |
98 | QString querystring = query_le->text(); | 97 | QString querystring = query_le->text(); |
99 | //X qDebug("opening dict >%s< for >%s<", activated_name.latin1(),querystring.latin1()); | 98 | ding->setCaseSensitive( casesens ); |
100 | //X if (querystring.isEmpty()){ | 99 | ding->setCompleteWord( completewords ); |
101 | //X qWarning("empty querystring"); | 100 | ding->setDict( activated_name ); |
102 | //X return; | 101 | |
103 | //X } | 102 | if ( activated_name != ding->loadedDict() ) |
104 | //X if (!activated_name || activated_name.isEmpty()) | 103 | ding->loadDict(activated_name); |
105 | //X QMessageBox::warning(this,tr("No Dictionary"),tr("Please choose a dictonary") ); | 104 | |
106 | //X else | 105 | BroswerContent test = ding->setText( querystring ); |
107 | //X { | 106 | |
108 | 107 | browser_top->setText( test.top ); | |
109 | ding->setCaseSensitive( casesens ); | 108 | browser_bottom->setText( test.bottom ); |
110 | ding->setCompleteWord( completewords ); | ||
111 | ding->setDict( activated_name ); | ||
112 | |||
113 | if ( activated_name != ding->loadedDict() ) | ||
114 | ding->loadDict(activated_name); | ||
115 | |||
116 | BroswerContent test = ding->setText( querystring ); | ||
117 | |||
118 | browser_top->setText( test.top ); | ||
119 | browser_bottom->setText( test.bottom ); | ||
120 | |||
121 | qDebug( "Text sollte gesetzt sein..." ); | ||
122 | //X } | ||
123 | } | 109 | } |
124 | 110 | ||
125 | 111 | ||
@@ -176,10 +162,10 @@ void ODict::setupMenus() | |||
176 | menu = new QMenuBar( this ); | 162 | menu = new QMenuBar( this ); |
177 | 163 | ||
178 | settings = new QPopupMenu( menu ); | 164 | settings = new QPopupMenu( menu ); |
179 | setting_a = new QAction(tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 ); | 165 | setting_a = new QAction(tr( "Configuration" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); |
180 | connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); | 166 | connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); |
181 | setting_a->addTo( settings ); | 167 | setting_a->addTo( settings ); |
182 | setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "today/config" ), QString::null, 0, this, 0 ); | 168 | setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 ); |
183 | 169 | ||
184 | parameter = new QPopupMenu( menu ); | 170 | parameter = new QPopupMenu( menu ); |
185 | connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); | 171 | connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); |