From: José Aliste Date: Tue, 22 Feb 2011 16:02:04 +0000 (-0300) Subject: libview: Save contents of FormTextFields when they loss focus. X-Git-Tag: EVINCE_2_91_92~8 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=c8104d3426a7bd7ce6570a87363e4edeea472fce;p=evince.git libview: Save contents of FormTextFields when they loss focus. Fixes bug #624921. --- diff --git a/libview/ev-view.c b/libview/ev-view.c index 1b404dce..c2e888d9 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);