-rw-r--r-- | noncore/apps/odict/odict.cpp | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp index 0745f53..c1de6ac 100644 --- a/noncore/apps/odict/odict.cpp +++ b/noncore/apps/odict/odict.cpp @@ -19,26 +19,25 @@ #include "dingwidget.h" #include <qlayout.h> #include <qpopupmenu.h> #include <qmenubar.h> #include <qmessagebox.h> -#include <qpe/config.h> #include <qhbox.h> #include <qvbox.h> #include <qlabel.h> #include <qpushbutton.h> #include <qlineedit.h> #include <qmainwindow.h> #include <qstring.h> #include <qaction.h> #include <qtextbrowser.h> #include <qcombobox.h> #include <qpe/resource.h> - +#include <qpe/config.h> ODict::ODict() : QMainWindow() { activated_name = QString::null; vbox = new QVBox( this ); @@ -76,13 +75,12 @@ void ODict::loadConfig() QString lastname; Config cfg ( "odict" ); cfg.setGroup( "generalsettings" ); casesens = cfg.readEntry( "casesens" ).toInt(); regexp = cfg.readEntry( "regexp" ).toInt(); - completewords = cfg.readEntry( "completewords" ).toInt(); QString lastDict = cfg.readEntry( "lastdict" ); int i = 0, e = 0; QStringList groupListCfg = cfg.groupList().grep( "Method_" ); query_co->clear(); @@ -106,12 +104,13 @@ void ODict::loadConfig() } /* * now set the two names of the dictionary and the correct QComboBox-Entry */ lookupLanguageNames( lastname ); + ding->loadDict( lastname ); query_co->setCurrentItem( e ); top_name->setText( top_name_content ); bottom_name->setText( bottom_name_content ); } @@ -126,33 +125,30 @@ void ODict::lookupLanguageNames( QString dictname ) void ODict::saveConfig() { Config cfg ( "odict" ); cfg.setGroup( "generalsettings" ); cfg.writeEntry( "casesens" , casesens ); cfg.writeEntry( "regexp" , regexp ); - cfg.writeEntry( "completewords" , completewords ); cfg.writeEntry( "lastdict" , query_co->currentText() ); } void ODict::slotStartQuery() { - qDebug( "bin in slotStartQuery()" ); - QString querystring = query_le->text(); if ( !querystring.isEmpty() ) { /* * if the user has not yet defined a dictionary */ if ( !query_co->currentText() ) { switch ( QMessageBox::information( this, tr( "OPIE-Dictionary" ), tr( "No dictionary defined" ), tr( "&Define one" ), tr( "&Cancel" ), - 0, // Define a dict choosen + 0, // Define a dict 1 ) ) // Cancel choosen { case 0: slotSettings(); break; case 1: // stop here @@ -161,29 +157,15 @@ void ODict::slotStartQuery() } /* * ok, the user has defined a dict */ ding->setCaseSensitive( casesens ); - ding->setCompleteWord( completewords ); - - qDebug( "activated_name ist:" ); - qDebug( activated_name ); - - ding->setDict( activated_name ); - -//X if ( activated_name != ding->loadedDict() ) - ding->loadDict(activated_name); BroswerContent test = ding->setText( querystring ); - qDebug( querystring ); - if ( ding->isCaseSensitive ) - qDebug( "ist CS"); - else qDebug( "kein CS" ); - browser_top->setText( test.top ); browser_bottom->setText( test.bottom ); } } void ODict::slotSettings() @@ -202,19 +184,12 @@ void ODict::slotSetParameter( int count ) else casesens = true; } if ( count == 1 ) { - if ( completewords ) - completewords = false; - else - completewords = true; - } - if ( count == 2 ) - { if ( regexp ) regexp = false; else regexp = true; } saveConfig(); @@ -223,14 +198,15 @@ void ODict::slotSetParameter( int count ) void ODict::slotMethodChanged( const QString& methodnumber ) { activated_name = methodnumber; qDebug( "activated_name in slotMethodChanged() ist:" ); qDebug( activated_name ); + qDebug( ding->loadedDict() ); -//X if ( activated_name != ding->loadedDict() ) + if ( activated_name != ding->loadedDict() ) { ding->loadDict(activated_name); lookupLanguageNames( activated_name ); top_name->setText( top_name_content ); bottom_name->setText( bottom_name_content ); @@ -247,13 +223,12 @@ void ODict::setupMenus() setting_a->addTo( settings ); setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 ); parameter = new QPopupMenu( menu ); connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); - parameter->insertItem( tr( "Only &complete Words" ), 1 , 1) ; parameter->insertItem( tr( "Allow ®. expressions" ), 2 ); parameter->insertSeparator(); menu->insertItem( tr( "Settings" ) , settings ); menu->insertItem( tr( "Parameter" ) , parameter ); } |