Commit f99c4bd0 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

* gladeui/glade-project.[ch]:

	  - Added glade_project_widget_changed() to manually notify a "row-change"
	  - Add property references to the MISC_COLUMN (i.e. "Image Widget of button1" texts).

	* gladeui/glade-widget.c: Notify widget row changes when parentless widget references
	  are added/removed from a widget.
parent 861ce243
......@@ -3,6 +3,13 @@
* plugins/gtk+/glade-gtk.c: Fixed warnings from glade_gtk_box_get_first_blank() when
project closes.
* gladeui/glade-project.[ch]:
- Added glade_project_widget_changed() to manually notify a "row-change"
- Add property references to the MISC_COLUMN (i.e. "Image Widget of button1" texts).
* gladeui/glade-widget.c: Notify widget row changes when parentless widget references
are added/removed from a widget.
2011-01-15 Emilio Pozuelo Monfort <pochu27@gmail.com>
* plugins/gtk+/Makefile.am: Don't install .in files.
......
......@@ -3035,6 +3035,26 @@ glade_project_has_object (GladeProject * project, GObject * object)
glade_widget_in_project (gwidget));
}
void
glade_project_widget_changed (GladeProject *project,
GladeWidget *gwidget)
{
GObject *object;
GtkTreeIter iter;
GtkTreePath *path;
g_return_if_fail (GLADE_IS_PROJECT (project));
g_return_if_fail (GLADE_IS_WIDGET (gwidget));
object = glade_widget_get_object (gwidget);
g_return_if_fail (glade_project_has_object (project, object));
glade_project_model_get_iter_for_object (project, object, &iter);
path = gtk_tree_model_get_path (GTK_TREE_MODEL (project), &iter);
gtk_tree_model_row_changed (GTK_TREE_MODEL (project), path, &iter);
gtk_tree_path_free (path);
}
/**
* glade_project_remove_object:
* @project: a #GladeProject
......@@ -4678,6 +4698,7 @@ glade_project_model_get_value (GtkTreeModel * model,
{
GObject *object;
GladeWidget *widget;
GladeProperty *ref_prop;
gchar *str = NULL, *child_type;
g_return_if_fail (VALID_ITER (model, iter));
......@@ -4712,6 +4733,17 @@ glade_project_model_get_value (GtkTreeModel * model,
g_object_get_data (glade_widget_get_object (widget),
"special-child-type")) != NULL)
str = g_strdup_printf (_("(%s child)"), child_type);
else if ((ref_prop =
glade_widget_get_parentless_widget_ref (widget)) != NULL)
{
GladePropertyClass *pclass = glade_property_get_class (ref_prop);
GladeWidget *ref_widget = glade_property_get_widget (ref_prop);
/* translators: reffers to a property named '%s' of widget '%s' */
str = g_strdup_printf (_("(%s of %s)"),
glade_property_class_get_name (pclass),
glade_widget_get_name (ref_widget));
}
g_value_take_string (value, str);
break;
......
......@@ -128,6 +128,8 @@ void glade_project_cancel_load (GladeProject *proj
void glade_project_preview (GladeProject *project,
GladeWidget *gwidget);
void glade_project_preferences (GladeProject *project);
gchar *glade_project_resource_fullpath (GladeProject *project,
const gchar *resource);
/* Commands */
void glade_project_undo (GladeProject *project);
......@@ -147,8 +149,8 @@ void glade_project_remove_object (GladeProject *proj
GObject *object);
gboolean glade_project_has_object (GladeProject *project,
GObject *object);
gchar *glade_project_resource_fullpath (GladeProject *project,
const gchar *resource);
void glade_project_widget_changed (GladeProject *project,
GladeWidget *gwidget);
/* Widget names */
GladeWidget *glade_project_get_widget_by_name (GladeProject *project,
......@@ -164,7 +166,6 @@ gboolean glade_project_available_widget_name(GladeProject *proj
GladeWidget *widget,
const gchar *name);
/* Selection */
gboolean glade_project_is_selected (GladeProject *project,
GObject *object);
......
......@@ -2141,7 +2141,14 @@ glade_widget_add_prop_ref (GladeWidget * widget, GladeProperty * property)
*/
pclass = glade_property_get_class (property);
if (glade_property_class_parentless_widget (pclass))
glade_widget_hide (widget);
{
GladeProject *project = glade_widget_get_project (widget);
if (project)
glade_project_widget_changed (project, widget);
glade_widget_hide (widget);
}
}
/**
......@@ -2157,10 +2164,21 @@ glade_widget_add_prop_ref (GladeWidget * widget, GladeProperty * property)
void
glade_widget_remove_prop_ref (GladeWidget * widget, GladeProperty * property)
{
GladePropertyClass *pclass;
g_return_if_fail (GLADE_IS_WIDGET (widget));
g_return_if_fail (GLADE_IS_PROPERTY (property));
widget->priv->prop_refs = g_list_remove (widget->priv->prop_refs, property);
pclass = glade_property_get_class (property);
if (glade_property_class_parentless_widget (pclass))
{
GladeProject *project = glade_widget_get_project (widget);
if (project)
glade_project_widget_changed (project, widget);
}
}
GList *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment