summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2003-05-02 15:36:57 (UTC)
committer cniehaus <cniehaus>2003-05-02 15:36:57 (UTC)
commitf0b3896983e1f2c10d3fb3dde3fa08997221cdce (patch) (side-by-side diff)
tree81191da4f86b0d28727432b9fe621b98f689ed19
parentb40991b25dd22c55cc80a9a9c4ae0adec103d575 (diff)
downloadopie-f0b3896983e1f2c10d3fb3dde3fa08997221cdce.zip
opie-f0b3896983e1f2c10d3fb3dde3fa08997221cdce.tar.gz
opie-f0b3896983e1f2c10d3fb3dde3fa08997221cdce.tar.bz2
warn the user if there is no dict defines
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/odict/odict.cpp24
1 files changed, 24 insertions, 0 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
@@ -73,48 +73,72 @@ void ODict::loadConfig()
QStringList groupListCfg = cfg.groupList().grep( "Method_" );
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
}
void ODict::saveConfig()
{
Config cfg ( "odict" );
cfg.setGroup( "generalsettings" );
cfg.writeEntry( "errtol" , errorTol );
cfg.writeEntry( "casesens" , casesens );
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() )
ding->loadDict(activated_name);
BroswerContent test = ding->setText( querystring );
browser_top->setText( test.top );
browser_bottom->setText( test.bottom );
}
void ODict::slotSetErrorcount( int count )
{
errorTol = count;
}
void ODict::slotSettings()
{
ConfigDlg dlg( this, "Config" , true);
if ( dlg.exec() == QDialog::Accepted )