From 9de5fab0589664f86beeaffda81129269f365fbf Mon Sep 17 00:00:00 2001 From: John Levon Date: Fri, 28 Mar 2003 20:50:04 +0000 Subject: [PATCH] fix bug 978, ui bug git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6617 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 5 ++ src/frontends/qt2/QPrefs.C | 46 +++++++++++++++---- .../qt2/ui/QPrefSpellcheckerModule.ui | 34 ++++++-------- 3 files changed, 57 insertions(+), 28 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 8bf27c6d7e..7dee5da01e 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2003-03-28 John Levon + + * QPrefs.C: + * ui/QPrefSpellcheckerModule.ui: fix bug 978 + 2003-03-28 John Levon * ui/QCharacterDialogBase.ui: re-org, fix bug 999 diff --git a/src/frontends/qt2/QPrefs.C b/src/frontends/qt2/QPrefs.C index e774d34a3b..4c436b1e9b 100644 --- a/src/frontends/qt2/QPrefs.C +++ b/src/frontends/qt2/QPrefs.C @@ -10,7 +10,6 @@ #include - #include "support/lstrings.h" #include "Lsstream.h" #include @@ -88,6 +87,18 @@ void QPrefs::build_dialog() for (; lit != lend; ++lit) { langmod->defaultLanguageCO->insertItem(toqstr(lit->first)); } + + QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule); + spellmod->spellCommandCO->insertItem(qt_("ispell")); + spellmod->spellCommandCO->insertItem(qt_("aspell")); + spellmod->spellCommandCO->insertItem(qt_("hspell")); +#ifdef USE_PSPELL + spellmod->spellCommandCO->insertItem(qt_("pspell (library)")); +#else +#ifdef USE_ASPELL + spellmod->spellCommandCO->insertItem(qt_("aspell (library)")); +#endif +#endif } @@ -186,7 +197,17 @@ void QPrefs::apply() QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule); - rc.isp_command = fromqstr(spellmod->spellCommandCO->currentText()); + switch (spellmod->spellCommandCO->currentItem()) { + case 0: + case 1: + case 2: + rc.use_spell_lib = false; + rc.isp_command = fromqstr(spellmod->spellCommandCO->currentText()); + break; + case 3: + rc.use_spell_lib = true; + break; + } // FIXME: remove isp_use_alt_lang rc.isp_alt_lang = fromqstr(spellmod->altLanguageED->text()); @@ -445,13 +466,22 @@ void QPrefs::update_contents() QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule); - QString const tmp = qt_(rc.isp_command); - for (int i = 0; i < spellmod->spellCommandCO->count(); ++i) { - if (spellmod->spellCommandCO->text(i) == tmp) { - spellmod->spellCommandCO->setCurrentItem(i); - break; - } + spellmod->spellCommandCO->setCurrentItem(0); + + if (rc.isp_command == "ispell") { + spellmod->spellCommandCO->setCurrentItem(0); + } else if (rc.isp_command == "aspell") { + spellmod->spellCommandCO->setCurrentItem(1); + } else if (rc.isp_command == "hspell") { + spellmod->spellCommandCO->setCurrentItem(2); } + + if (rc.use_spell_lib) { +#if defined(USE_ASPELL) || defined(USE_PSPELL) + spellmod->spellCommandCO->setCurrentItem(3); +#endif + } + // FIXME: remove isp_use_alt_lang spellmod->altLanguageED->setText(toqstr(rc.isp_alt_lang)); // FIXME: remove isp_use_esc_chars diff --git a/src/frontends/qt2/ui/QPrefSpellcheckerModule.ui b/src/frontends/qt2/ui/QPrefSpellcheckerModule.ui index 0c22391cce..5d6b5fe0af 100644 --- a/src/frontends/qt2/ui/QPrefSpellcheckerModule.ui +++ b/src/frontends/qt2/ui/QPrefSpellcheckerModule.ui @@ -13,7 +13,7 @@ 0 0 - 390 + 386 268 @@ -53,7 +53,7 @@ text - Spell chec&ker program: + Spell chec&ker: buddy @@ -94,6 +94,10 @@ name altLanguageED + + toolTip + Override the language used for the spellchecker + QLabel @@ -163,6 +167,10 @@ name persDictionaryED + + toolTip + Specify a personal dictionary file other than the default + QLabel @@ -181,24 +189,6 @@ QComboBox - - - text - ispell - - - - - text - aspell - - - - - text - hspell - - name spellCommandCO @@ -237,6 +227,10 @@ text Accept compound &words + + toolTip + Accept words such as "diskdrive" + QCheckBox -- 2.39.2