summaryrefslogtreecommitdiff
path: root/gladeui/glade-widget.c
diff options
context:
space:
mode:
authorDenis Washington <denisw@src.gnome.org>2011-11-15 17:56:03 +0100
committerDenis Washington <denisw@src.gnome.org>2011-11-15 17:56:03 +0100
commitaccb7534ce503a25070224c739d995486100d77b (patch)
tree275e75062f413179891a2c008c0082c68a2fbb82 /gladeui/glade-widget.c
parente90717a501d3e99509c0e6ade83e3876d4a84f68 (diff)
downloadglade-command-set-sensitive.tar.gz
Add glade_command_set_sensitive() and port a bit of the GTK+ plugin code to itcommand-set-sensitive
The aim of this is to let all changes to the sensitivity of properties through the command system so that the code in the "gbinding" branch can cleanly react to the source or target of a property binding becoming insensitive (e.g. by undoably removing the binding).
Diffstat (limited to 'gladeui/glade-widget.c')
-rw-r--r--gladeui/glade-widget.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 53226bda..b8eb1bac 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -3779,6 +3779,9 @@ glade_widget_read (GladeProject * project,
}
glade_widget_adaptor_read_widget (adaptor, widget, node);
+
+ /* Set initial property sensitivity */
+ glade_widget_adaptor_adjust_property_flags (adaptor, widget, FALSE);
}
else
{
@@ -3996,6 +3999,22 @@ glade_widget_is_ancestor (GladeWidget * widget, GladeWidget * ancestor)
return FALSE;
}
+/**
+ * glade_widget_adjust_property_flags:
+ * @widget: A #GladeWidget
+ * @use_command: whether to use the GladeCommand interface
+ *
+ * Adjusts the sensitive/enabled flags of all widget properties to match
+ * the widget's property values.
+ */
+void
+glade_widget_adjust_property_flags (GladeWidget * widget, gboolean use_command)
+{
+ g_return_if_fail (GLADE_IS_WIDGET (widget));
+
+ glade_widget_adaptor_adjust_property_flags (widget->priv->adaptor,
+ widget, use_command);
+}
static gint glade_widget_su_stack = 0;