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

* gladeui/glade-project.c: Export glade_project_verify_property() to allow verification of

	  a single property instead of the whole widget when a property changes.
parent 43db0e3a
......@@ -8,6 +8,9 @@
* gladeui/glade-editor-property.c: Avoid infinite recursion when committing properties more
aggressively (found that editing text properties now make some recursion for some reason).
* gladeui/glade-project.c: Export glade_project_verify_property() to allow verification of
a single property instead of the whole widget when a property changes.
2011-01-01 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-command.[ch], Added GladeProject member to base command structure, now
......
......@@ -2042,11 +2042,13 @@ glade_project_preview (GladeProject * project, GladeWidget * gwidget)
* and a project targeting toolkit version '%s %d.%d' */
#define SIGNAL_VERSION_CONFLICT_MSGFMT _("This signal was introduced in %s %d.%d while project targets %s %d.%d")
static void
glade_project_verify_property (GladeProject * project,
GladeProperty * property,
const gchar * path_name,
GString * string, gboolean forwidget)
glade_project_verify_property_internal (GladeProject * project,
GladeProperty * property,
const gchar * path_name,
GString * string, gboolean forwidget)
{
GladeWidgetAdaptor *adaptor, *prop_adaptor;
GladeWidget *widget;
......@@ -2107,8 +2109,9 @@ glade_project_verify_properties_internal (GladeWidget * widget,
for (list = glade_widget_get_properties (widget); list; list = list->next)
{
property = list->data;
glade_project_verify_property (glade_widget_get_project (widget), property, path_name,
string, forwidget);
glade_project_verify_property_internal (glade_widget_get_project (widget),
property, path_name,
string, forwidget);
}
/* Sometimes widgets on the clipboard have packing props with no parent */
......@@ -2117,17 +2120,17 @@ glade_project_verify_properties_internal (GladeWidget * widget,
for (list = glade_widget_get_packing_properties (widget); list; list = list->next)
{
property = list->data;
glade_project_verify_property (glade_widget_get_project (widget),
property, path_name, string, forwidget);
glade_project_verify_property_internal (glade_widget_get_project (widget),
property, path_name, string, forwidget);
}
}
}
static void
glade_project_verify_signal (GladeWidget * widget,
GladeSignal * signal,
const gchar * path_name,
GString * string, gboolean forwidget)
glade_project_verify_signal_internal (GladeWidget * widget,
GladeSignal * signal,
const gchar * path_name,
GString * string, gboolean forwidget)
{
GladeSignalClass *signal_class;
gint target_major, target_minor;
......@@ -2176,10 +2179,24 @@ glade_project_verify_signal (GladeWidget * widget,
}
void
glade_project_update_signal_support_warning (GladeWidget * widget,
GladeSignal * signal)
glade_project_verify_property (GladeProperty * property)
{
GladeWidget *widget;
GladeProject *project;
g_return_if_fail (GLADE_IS_PROPERTY (property));
widget = glade_property_get_widget (property);
project = glade_widget_get_project (widget);
glade_project_verify_property_internal (project, property, NULL, NULL, TRUE);
}
void
glade_project_verify_signal (GladeWidget * widget,
GladeSignal * signal)
{
glade_project_verify_signal (widget, signal, NULL, NULL, TRUE);
glade_project_verify_signal_internal (widget, signal, NULL, NULL, TRUE);
}
static void
......@@ -2195,8 +2212,8 @@ glade_project_verify_signals (GladeWidget * widget,
for (list = signals; list; list = list->next)
{
signal = list->data;
glade_project_verify_signal (widget, signal, path_name, string,
forwidget);
glade_project_verify_signal_internal (widget, signal, path_name, string,
forwidget);
}
g_list_free (signals);
}
......
......@@ -205,8 +205,9 @@ void glade_project_get_target_version (GladeProject *project,
gint *major,
gint *minor);
void glade_project_update_signal_support_warning (GladeWidget *widget,
GladeSignal *signal);
void glade_project_verify_property (GladeProperty *property);
void glade_project_verify_signal (GladeWidget *widget,
GladeSignal *signal);
gchar *glade_project_display_dependencies (GladeProject *project);
......
......@@ -363,8 +363,7 @@ glade_property_set_value_impl (GladeProperty * property, const GValue * value)
glade_property_signals[VALUE_CHANGED],
0, &old_value, property->priv->value);
glade_project_verify_properties (property->priv->widget);
glade_project_verify_property (property);
}
g_value_unset (&old_value);
......
......@@ -228,7 +228,7 @@ append_slot (GladeSignalEditor * self, GtkTreeIter * iter_signal,
GladeSignal *sig = glade_signal_new (signal_name, NULL, NULL, FALSE, FALSE);
/* Check versioning warning here with a virtual signal */
glade_project_update_signal_support_warning (priv->widget, sig);
glade_project_verify_signal (priv->widget, sig);
gtk_tree_store_append (GTK_TREE_STORE (model), &iter_new_slot, iter_signal);
gtk_tree_store_set (GTK_TREE_STORE (model), &iter_new_slot,
......@@ -1212,7 +1212,7 @@ glade_signal_editor_load_widget (GladeSignalEditor * editor,
glade_signal_new (signal->name, NULL, NULL, FALSE, FALSE);
/* Check versioning here with a virtual signal */
glade_project_update_signal_support_warning (priv->widget, sig);
glade_project_verify_signal (priv->widget, sig);
/* Add class name that this signal belongs to.
*/
......
......@@ -325,7 +325,7 @@ glade_widget_add_signal_handler_impl (GladeWidget * widget,
new_signal_handler = glade_signal_clone (signal_handler);
g_ptr_array_add (signals, new_signal_handler);
glade_project_update_signal_support_warning (widget, new_signal_handler);
glade_project_verify_signal (widget, new_signal_handler);
}
static void
......
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