[evince] libview: Save contents of FormTextFields when they loss focus.



commit c8104d3426a7bd7ce6570a87363e4edeea472fce
Author: José Aliste <jaliste src gnome org>
Date:   Tue Feb 22 13:02:04 2011 -0300

    libview: Save contents of FormTextFields when they loss focus.
    
    Fixes bug #624921.

 libview/ev-view.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 1b404dc..c2e888d 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -2151,6 +2151,16 @@ ev_view_form_field_text_changed (GtkWidget   *widget,
 	}
 }
 
+static gboolean
+ev_view_form_field_text_focus_out (GtkWidget     *widget,
+				   GdkEventFocus *event,
+				   EvView        *view)
+{
+	ev_view_form_field_text_save (view, widget);
+
+	return FALSE;
+}
+
 static GtkWidget *
 ev_view_form_field_text_create_widget (EvView      *view,
 				       EvFormField *field)
@@ -2176,6 +2186,9 @@ ev_view_form_field_text_create_widget (EvView      *view,
 				g_free (txt);
 			}
 
+			g_signal_connect (text, "focus-out-event",
+					  G_CALLBACK (ev_view_form_field_text_focus_out),
+					  view);
 			g_signal_connect (text, "changed",
 					  G_CALLBACK (ev_view_form_field_text_changed),
 					  field);
@@ -2193,7 +2206,10 @@ ev_view_form_field_text_create_widget (EvView      *view,
 				gtk_text_buffer_set_text (buffer, txt, -1);
 				g_free (txt);
 			}
-			
+
+			g_signal_connect( buffer, "focus-out-event",
+					  G_CALLBACK (ev_view_form_field_text_focus_out),
+					  view);
 			g_signal_connect (buffer, "changed",
 					  G_CALLBACK (ev_view_form_field_text_changed),
 					  field);



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