From f0b3896983e1f2c10d3fb3dde3fa08997221cdce Mon Sep 17 00:00:00 2001 From: cniehaus Date: Fri, 02 May 2003 15:36:57 +0000 Subject: warn the user if there is no dict defines --- 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 @@ -78,7 +78,7 @@ void ODict::loadConfig() 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 } @@ -94,6 +94,30 @@ void ODict::saveConfig() 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 ); -- cgit v0.9.0.2