[evolution-patches] gtkhtml: spell check document fix (in case live spell checking is disabled)



Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/ChangeLog,v
retrieving revision 1.410.2.9
diff -u -p -r1.410.2.9 ChangeLog
--- ChangeLog	15 Sep 2003 16:19:12 -0000	1.410.2.9
+++ ChangeLog	24 Sep 2003 18:39:58 -0000
@@ -1,3 +1,9 @@
+2003-09-24  Radek Doulik  <rodo ximian com>
+
+	* spell.c (spell_check_dialog): added missing dialog, set
+	temporary inline spelling in case it's disabled and whole document
+	has to be checked
+
 2003-09-15  Larry Ewing  <lewing ximian com>
 
 	* editor-control-factory.c (set_frame_cb): activate the menu items
Index: spell.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/spell.c,v
retrieving revision 1.41.4.1
diff -u -p -r1.41.4.1 spell.c
--- spell.c	9 Sep 2003 19:04:18 -0000	1.41.4.1
+++ spell.c	24 Sep 2003 18:39:59 -0000
@@ -255,23 +255,31 @@ spell_check_dialog (GtkHTMLControlData *
 	GtkWidget *control;
 	GtkWidget *dialog;
 	guint position;
+	gboolean inline_spelling = gtk_html_get_inline_spelling (cd->html);
 
 	position = cd->html->engine->cursor->position;
 	cd->spell_check_next = whole_document;
 	if (whole_document) {
 		html_engine_disable_selection (cd->html->engine);
 		html_engine_beginning_of_document (cd->html->engine);
+		if (!inline_spelling)
+			gtk_html_set_inline_spelling (cd->html, TRUE);
 	}
 
 	if (html_engine_spell_word_is_valid (cd->html->engine))
 		if (next_word (cd, TRUE)) {
+			GtkWidget *info;
+
 			html_engine_hide_cursor (cd->html->engine);
 			html_cursor_jump_to_position (cd->html->engine->cursor, cd->html->engine, position);
 			html_engine_show_cursor (cd->html->engine);
 
-			/* FIX2 gnome_ok_dialog (_("No misspelled word found")); */
+			info = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO,
+						       GTK_BUTTONS_OK, _("No misspelled word found"));
+			gtk_dialog_run (GTK_DIALOG (info));
+			gtk_widget_destroy (info);
 
-			return;
+			goto end;
 		}
 
 	dialog  = gtk_dialog_new_with_buttons (_("Spell checker"), NULL, 0, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
@@ -280,7 +288,7 @@ spell_check_dialog (GtkHTMLControlData *
 	if (!control) {
 		g_warning ("Cannot create spell control");
 		gtk_widget_unref (dialog);
-		return;
+		goto end;
 	}
 
 	cd->spell_dialog = dialog;
@@ -302,6 +310,10 @@ spell_check_dialog (GtkHTMLControlData *
 	gtk_widget_destroy (dialog);
 	bonobo_object_release_unref (cd->spell_control_pb, NULL);
 	cd->spell_control_pb = CORBA_OBJECT_NIL;
+
+ end:
+	if (!inline_spelling)
+		gtk_html_set_inline_spelling (cd->html, inline_spelling);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]