-rw-r--r-- | noncore/apps/odict/odict.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp index cc3148a..9f9a8d9 100644 --- a/noncore/apps/odict/odict.cpp +++ b/noncore/apps/odict/odict.cpp @@ -75,13 +75,13 @@ void ODict::loadConfig() query_co->clear(); for ( QStringList::Iterator it = groupListCfg.begin() ; it != groupListCfg.end() ; ++it ) { cfg.setGroup( *it ); query_co->insertItem( cfg.readEntry( "Name" ) ); } - slotMethodChanged(1 ); //FIXME: this line should not contain a integer + slotMethodChanged( 1 ); //FIXME: this line should not contain a integer } void ODict::saveConfig() { Config cfg ( "odict" ); @@ -91,12 +91,36 @@ void ODict::saveConfig() cfg.writeEntry( "regexp" , regexp ); cfg.writeEntry( "completewords" , completewords ); } void ODict::slotStartQuery() { + /* + * 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 + 1 ) ) // Cancel choosen + { + + case 0: + slotSettings(); + break; + case 1: // stop here + return; + } + } + + /* + * ok, the user has defined a dict + */ QString querystring = query_le->text(); ding->setCaseSensitive( casesens ); ding->setCompleteWord( completewords ); ding->setDict( activated_name ); if ( activated_name != ding->loadedDict() ) |