diff --git a/ChangeLog b/ChangeLog index b0ef0b19..1238e630 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-05-09 Joaquin Cuenca Abela + + * src/glade-property.c: don't save invisible properties. + + * src/glade-widget.c, glade-property-class.[ch]: little janitorial + work. + 2004-05-08 Damon Chaplin * src/glade-gtk.c (ask_for_number, glade_gtk_table_post_create): set diff --git a/src/glade-property-class.c b/src/glade-property-class.c index 61c1092e..e2fb7440 100644 --- a/src/glade-property-class.c +++ b/src/glade-property-class.c @@ -240,8 +240,7 @@ glade_property_class_get_type_from_spec (GParamSpec *spec) static GValue * glade_property_class_get_default_from_spec (GParamSpec *spec, - GladePropertyClass *class, - GladeXmlNode *node) + GladePropertyClass *class) { GValue *value; @@ -604,7 +603,7 @@ glade_property_class_new_from_spec (GParamSpec *spec) } property_class->tooltip = g_strdup (g_param_spec_get_blurb (spec)); - property_class->def = glade_property_class_get_default_from_spec (spec, property_class, NULL); + property_class->def = glade_property_class_get_default_from_spec (spec, property_class); switch (property_class->type) { @@ -773,7 +772,8 @@ glade_property_class_update_from_node (GladeXmlNode *node, #endif /* Get the default */ buff = glade_xml_get_property_string (node, GLADE_TAG_DEFAULT); - if (buff) { + if (buff) + { if (class->def) { if (G_VALUE_TYPE (class->def) != 0) @@ -791,7 +791,7 @@ glade_property_class_update_from_node (GladeXmlNode *node, if (class->optional) class->optional_default = glade_xml_get_property_boolean (node, GLADE_TAG_OPTIONAL_DEFAULT, FALSE); - /* If this property can't be set with g_object_set, get the workarround + /* If this property can't be set with g_object_set, get the work around * function */ /* I use here a g_warning to signal these errors instead of a dialog box, as if there is one @@ -799,7 +799,8 @@ glade_property_class_update_from_node (GladeXmlNode *node, * the user the pain of plenty of dialog boxes. Ideally, we should collect these errors, * and show all of them at the end of the load processus. */ child = glade_xml_search_child (node, GLADE_TAG_SET_FUNCTION); - if (child) { + if (child) + { gchar *symbol_name = glade_xml_get_content (child); if (!widget_class->module) @@ -813,11 +814,12 @@ glade_property_class_update_from_node (GladeXmlNode *node, g_free (symbol_name); } - /* If this property can't be get with g_object_get, get the workarround + /* If this property can't be get with g_object_get, get the work around * function */ child = glade_xml_search_child (node, GLADE_TAG_GET_FUNCTION); - if (child) { + if (child) + { gchar *symbol_name = glade_xml_get_content (child); if (!widget_class->module) @@ -836,4 +838,3 @@ glade_property_class_update_from_node (GladeXmlNode *node, return TRUE; } - diff --git a/src/glade-property-class.h b/src/glade-property-class.h index 03d3d08e..90043a51 100644 --- a/src/glade-property-class.h +++ b/src/glade-property-class.h @@ -144,11 +144,6 @@ struct _GladePropertyClass */ gboolean optional_default; /* For optional values, what the default is */ - GladePropertyQuery *query; /* Some widgets require us to query the user - * before creating the widget. Like a vbox will - * want to know the number of columns. - */ - GladeWidgetClass *child; /* A GladeWidgetClass pointer of objects * that we need to set for this widget * for example : GtkSpinButton has a Adjustment inside diff --git a/src/glade-property.c b/src/glade-property.c index 88ff9bf7..1a2ebdb6 100644 --- a/src/glade-property.c +++ b/src/glade-property.c @@ -178,6 +178,9 @@ glade_property_write (GladeXmlContext *context, GladeProperty *property) if (!property->enabled) return NULL; + if (!glade_property_class_is_visible (property->class, glade_widget_get_class (property->widget))) + return NULL; + node = glade_xml_node_new (context, GLADE_XML_TAG_PROPERTY); if (!node) return NULL; diff --git a/src/glade-widget.c b/src/glade-widget.c index 90cba7c8..b7bb975d 100644 --- a/src/glade-widget.c +++ b/src/glade-widget.c @@ -1063,7 +1063,8 @@ glade_widget_write (GladeWidget *widget, GladeXmlContext *context) /* Write the properties */ list = widget->properties; - for (; list; list = list->next) { + for (; list; list = list->next) + { GladeProperty *property = list->data; if (property->class->packing) continue; @@ -1087,9 +1088,9 @@ glade_widget_write (GladeWidget *widget, GladeXmlContext *context) GtkWidget *child_widget; child_widget = GTK_WIDGET (list->data); child = glade_widget_write_child (context, child_widget); - if (!child) { + if (!child) continue; - } + glade_xml_node_append_child (node, child); } }