diff options
author | Denis Washington <denisw@src.gnome.org> | 2011-06-25 00:32:47 +0200 |
---|---|---|
committer | Denis Washington <denisw@src.gnome.org> | 2011-06-25 00:32:47 +0200 |
commit | 92f36ec10cbdbc96a30f32320dc4b7154c1afadf (patch) | |
tree | 887532a00576ff4768a0418b9fdc0753e4113fc2 | |
parent | 710ea0d803f6df465ce1fdd03517934e8ba1e7b3 (diff) | |
download | glade-92f36ec10cbdbc96a30f32320dc4b7154c1afadf.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.c | 17 |
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) && |