diff src/gtkprefs.c @ 12061:29dc8fc0dd6c

[gaim-migrate @ 14356] SF Patch #1351190 from Michael Hearn "This allows Linux binaries of Gaim to operate even when GTKspell is not available at runtime. Useful for the autopackages." I made a number of changes to this, so blame me first if it's busted. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sun, 13 Nov 2005 00:19:12 +0000
parents bfbb1798535e
children e859c1663a27
line wrap: on
line diff
--- a/src/gtkprefs.c	Sun Nov 13 00:05:44 2005 +0000
+++ b/src/gtkprefs.c	Sun Nov 13 00:19:12 2005 +0000
@@ -798,6 +798,7 @@
 	GtkWidget *vbox2;
 	GtkWidget *iconpref1;
 	GtkWidget *iconpref2;
+	GtkWidget *spellpref;
 
 	ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE);
 	gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER);
@@ -820,10 +821,21 @@
 
 	gaim_gtk_prefs_checkbox(_("_Notify buddies that you are typing to them"),
 			"/core/conversations/im/send_typing", vbox);
-#ifdef USE_GTKSPELL
-	gaim_gtk_prefs_checkbox(_("_Highlight misspelled words"),
-			"/gaim/gtk/conversations/spellcheck", vbox);
-#endif
+	
+	spellpref = gaim_gtk_prefs_checkbox(_("_Highlight misspelled words"),
+					    "/gaim/gtk/conversations/spellcheck", vbox);
+	
+	if (!gaim_gtk_gtkspell_is_available())
+	{
+		gboolean gtkspell_enabled = gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck");
+
+		gtk_widget_set_sensitive(spellpref, FALSE);
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(spellpref), FALSE);
+
+		/* Preserve the preference. If the user had it enabled, we want it to
+		 * stay enabled if they install gtkspell again. */
+		gaim_prefs_set_bool("/gaim/gtk/conversations/spellcheck", gtkspell_enabled);
+	}
 
 	frame = gaim_gtk_create_imhtml(TRUE, &imhtml, &toolbar);
 	gtk_widget_set_name(imhtml, "gaim_gtkprefs_font_imhtml");