void glade_gtk_widget_write_widget (GladeWidgetAdaptor * adaptor, GladeWidget * widget, GladeXmlContext * context, GladeXmlNode * node) { GladeProperty *prop; if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) || glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE))) return; /* Make sure use-action-appearance and related-action properties are * ordered in a sane way and are only saved if there is an action */ prop = glade_widget_get_property (widget, "use-action-appearance"); if (prop && glade_property_get_enabled (prop)) glade_property_write (prop, context, node); prop = glade_widget_get_property (widget, "related-action"); if (prop && glade_property_get_enabled (prop)) glade_property_write (prop, context, node); /* Finally chain up and read in all the normal properties.. */ GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node); }
void glade_gtk_button_write_widget (GladeWidgetAdaptor * adaptor, GladeWidget * widget, GladeXmlContext * context, GladeXmlNode * node) { GladeProperty *prop; gboolean use_stock; gchar *stock = NULL; if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) || glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE))) return; /* Do not save GtkColorButton GtkFontButton and GtkScaleButton label property */ if (!(GTK_IS_COLOR_BUTTON (glade_widget_get_object (widget)) || GTK_IS_FONT_BUTTON (glade_widget_get_object (widget)) || GTK_IS_SCALE_BUTTON (glade_widget_get_object (widget)))) { /* Make a copy of the GladeProperty, * override its value and ensure non-translatable if use-stock is TRUE */ prop = glade_widget_get_property (widget, "label"); prop = glade_property_dup (prop, widget); glade_widget_property_get (widget, "use-stock", &use_stock); if (use_stock) { glade_widget_property_get (widget, "stock", &stock); glade_property_i18n_set_translatable (prop, FALSE); glade_property_set (prop, stock); } glade_property_write (prop, context, node); g_object_unref (G_OBJECT (prop)); } /* Write out other normal properties and any other class derived custom properties after ... */ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->write_widget (adaptor, widget, context, node); }