[glade] glade-gtk-info-bar.c: Ensure names of action widgets at save time



commit e85787ad98fbe566eb7d48b204ea6192e485d36d
Author: Tristan Van Berkom <tristan upstairslabs com>
Date:   Thu Jan 28 16:18:15 2016 +0100

    glade-gtk-info-bar.c: Ensure names of action widgets at save time
    
    Also fix a bug where action-widgets was being serialized twice.

 plugins/gtk+/glade-gtk-info-bar.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-info-bar.c b/plugins/gtk+/glade-gtk-info-bar.c
index ba45dc9..10a9792 100644
--- a/plugins/gtk+/glade-gtk-info-bar.c
+++ b/plugins/gtk+/glade-gtk-info-bar.c
@@ -46,8 +46,18 @@ glade_gtk_info_bar_write_child (GladeWidgetAdaptor *adaptor,
 {
   GladeWidget *parent = glade_widget_get_parent (widget);
 
+  /* Before writing out the children, force any response id carrying buttons
+   * to have a name.
+   *
+   * This is NOT correct, but is an exception, we force the buttons to have
+   * names in a non-undoable way at save time for the purpose of action widgets
+   * only.
+   */
+  if (g_strcmp0 (glade_widget_get_internal (widget), "action_area"))
+    glade_gtk_action_widgets_ensure_names (parent, "action_area");
+
   GWA_GET_CLASS (GTK_TYPE_BOX)->write_child (adaptor, widget, context, node);
 
-  if (parent && GTK_IS_INFO_BAR (glade_widget_get_object (parent)))
+  if (g_strcmp0 (glade_widget_get_internal (widget), "action_area"))
     glade_gtk_action_widgets_write_child (parent, context, node, "action_area");
 }


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