Commit 2e91d2e9 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Update toolbar item sensitivity if menu item changes.

2008-01-14  Alexander Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-ui-utilities.c:
        (extension_action_sensitive_callback):
        (nautilus_toolbar_action_from_menu_item):
	Update toolbar item sensitivity if menu item changes.



svn path=/trunk/; revision=13595
parent 2761f4f9
2008-01-14 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-ui-utilities.c:
(extension_action_sensitive_callback):
(nautilus_toolbar_action_from_menu_item):
Update toolbar item sensitivity if menu item changes.
2008-01-14 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-operations.[ch]:
......
......@@ -114,6 +114,20 @@ extension_action_callback (GtkAction *action,
nautilus_menu_item_activate (NAUTILUS_MENU_ITEM (callback_data));
}
static void
extension_action_sensitive_callback (NautilusMenuItem *item,
GParamSpec *arg1,
gpointer user_data)
{
gboolean value;
g_object_get (G_OBJECT (item),
"sensitive", &value,
NULL);
gtk_action_set_sensitive (GTK_ACTION (user_data), value);
}
GtkAction *
nautilus_action_from_menu_item (NautilusMenuItem *item)
{
......@@ -206,6 +220,11 @@ nautilus_toolbar_action_from_menu_item (NautilusMenuItem *item)
g_object_ref (item),
(GClosureNotify)g_object_unref, 0);
g_signal_connect_object (item, "notify::sensitive",
G_CALLBACK (extension_action_sensitive_callback),
action,
0);
g_free (name);
g_free (label);
g_free (tip);
......
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