Since I know nothing about the spell checked, I'm posting this little patch. One of the problems I was seeing was that, not having aspell installed here, I was getting it as the default spellchecker anyway, in which case nothing was happening. So that's part of it. The other part is a simple check on whether we have a spellchecker. If not, the prefs get greyed out. Oh, and one more part is that we don't list aspell as an option if LyX has been compiled without aspell support.

rh

Index: frontends/qt4/GuiPrefs.cpp
===================================================================
--- frontends/qt4/GuiPrefs.cpp	(revision 32157)
+++ frontends/qt4/GuiPrefs.cpp	(working copy)
@@ -1282,19 +1282,31 @@
 {
 	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);
+	}
 }
 
 
Index: LyXRC.cpp
===================================================================
--- LyXRC.cpp	(revision 32157)
+++ LyXRC.cpp	(working copy)
@@ -277,7 +277,13 @@
 	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;

Reply via email to