From 626e17a55de8bec54adf6dd474c56659801089a5 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 23 Nov 2009 14:03:19 +0000 Subject: [PATCH] Show only those spellers that are active. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32164 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LyXRC.cpp | 6 ++++++ src/frontends/qt4/GuiPrefs.cpp | 32 ++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index 896f84d415..ece84acc8e 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -277,7 +277,13 @@ void LyXRC::setDefaults() backupdir_path.erase(); display_graphics = true; // Spellchecker settings: +#if defined(USE_ASPELL) spellchecker = "aspell"; +#elif defined(USE_HUNSPELL) + spellchecker = "hunspell"; +#else + spellchecker = "aspell"; +#endif spellchecker_accept_compound = false; spellcheck_continuously = false; use_kbmap = false; diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 5d6968c426..cae0dbc812 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1293,19 +1293,31 @@ PrefSpellchecker::PrefSpellchecker(GuiPreferences * form) { setupUi(this); +#if defined(USE_ASPELL) spellcheckerCB->addItem("aspell"); +#endif +#if defined(USE_HUNSPELL) spellcheckerCB->addItem("hunspell"); +#endif - connect(spellcheckerCB, SIGNAL(currentIndexChanged(int)), - this, SIGNAL(changed())); - connect(altLanguageED, SIGNAL(textChanged(QString)), - this, SIGNAL(changed())); - connect(escapeCharactersED, SIGNAL(textChanged(QString)), - this, SIGNAL(changed())); - connect(compoundWordCB, SIGNAL(clicked()), - this, SIGNAL(changed())); - connect(spellcheckContinuouslyCB, SIGNAL(clicked()), - this, SIGNAL(changed())); + if (theSpellChecker()) { + connect(spellcheckerCB, SIGNAL(currentIndexChanged(int)), + this, SIGNAL(changed())); + connect(altLanguageED, SIGNAL(textChanged(QString)), + this, SIGNAL(changed())); + connect(escapeCharactersED, SIGNAL(textChanged(QString)), + this, SIGNAL(changed())); + connect(compoundWordCB, SIGNAL(clicked()), + this, SIGNAL(changed())); + connect(spellcheckContinuouslyCB, SIGNAL(clicked()), + this, SIGNAL(changed())); + } else { + spellcheckerCB->setEnabled(false); + altLanguageED->setEnabled(false); + escapeCharactersED->setEnabled(false); + compoundWordCB->setEnabled(false); + spellcheckContinuouslyCB->setEnabled(false); + } } -- 2.39.2