summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Washington <denisw@src.gnome.org>2011-06-25 00:32:47 +0200
committerDenis Washington <denisw@src.gnome.org>2011-12-13 07:57:46 +0100
commitb5ebf94b4515f1a0ae9c8d9d7b8a4323efc1f2de (patch)
tree588728adcd2ca31f6a4b9ef99f27a41c3925536b
parent310393e7f00d5278b4ca652b9f5ba1bcb1082488 (diff)
downloadglade-b5ebf94b4515f1a0ae9c8d9d7b8a4323efc1f2de.tar.gz
Add "Unbind" context menu item for properties and disable "Set default value" for properties which are bound
-rw-r--r--gladeui/glade-popup.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gladeui/glade-popup.c b/gladeui/glade-popup.c
index 5cc81139..4e79c184 100644
--- a/gladeui/glade-popup.c
+++ b/gladeui/glade-popup.c
@@ -641,6 +641,12 @@ glade_popup_bind_property_cb (GtkMenuItem * item, GladeProperty * property)
}
static void
+glade_popup_unbind_property_cb (GtkMenuItem * item, GladeProperty * property)
+{
+ glade_command_bind_property (property, NULL);
+}
+
+static void
glade_popup_clear_property_cb (GtkMenuItem * item, GladeProperty * property)
{
GValue value = { 0, };
@@ -693,11 +699,16 @@ glade_popup_property_pop (GladeProperty * property, GdkEventButton * event)
popup_menu = gtk_menu_new ();
- glade_popup_append_item (popup_menu, 0, _("Bind to source..."),
- NULL, TRUE, glade_popup_bind_property_cb, property);
+ if (glade_property_get_binding_source (property))
+ glade_popup_append_item (popup_menu, 0, _("Unbind"),
+ NULL, TRUE, glade_popup_unbind_property_cb, property);
+ else
+ glade_popup_append_item (popup_menu, 0, _("Bind to source..."),
+ NULL, TRUE, glade_popup_bind_property_cb, property);
glade_popup_append_item (popup_menu, GTK_STOCK_CLEAR, _("Set default value"),
- NULL, TRUE, glade_popup_clear_property_cb, property);
+ NULL, glade_property_get_binding_source (property) == NULL,
+ glade_popup_clear_property_cb, property);
g_object_get (adaptor, "book", &book, NULL);
if (!glade_property_class_get_virtual (pclass) &&