From 0a79e5e3be3313a9e106322c7f7717901ba5bc4f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Sep 2003 22:13:20 +0000 Subject: [PATCH] Make disconnect work for toolitems. 2003-09-07 Matthias Clasen * gtk/gtkaction.c (disconnect_proxy): Make disconnect work for toolitems. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkaction.c | 13 +++++-------- 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03380a5970..eb42de9d55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-09-07 Matthias Clasen + + * gtk/gtkaction.c (disconnect_proxy): Make disconnect work + for toolitems. + 2003-09-06 Matthias Clasen * gtk/gtkaction.c (gtk_action_connect_proxy): Disconnect from diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 03380a5970..eb42de9d55 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2003-09-07 Matthias Clasen + + * gtk/gtkaction.c (disconnect_proxy): Make disconnect work + for toolitems. + 2003-09-06 Matthias Clasen * gtk/gtkaction.c (gtk_action_connect_proxy): Disconnect from diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 03380a5970..eb42de9d55 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +2003-09-07 Matthias Clasen + + * gtk/gtkaction.c (disconnect_proxy): Make disconnect work + for toolitems. + 2003-09-06 Matthias Clasen * gtk/gtkaction.c (gtk_action_connect_proxy): Disconnect from diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 03380a5970..eb42de9d55 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2003-09-07 Matthias Clasen + + * gtk/gtkaction.c (disconnect_proxy): Make disconnect work + for toolitems. + 2003-09-06 Matthias Clasen * gtk/gtkaction.c (gtk_action_connect_proxy): Disconnect from diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 03380a5970..eb42de9d55 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2003-09-07 Matthias Clasen + + * gtk/gtkaction.c (disconnect_proxy): Make disconnect work + for toolitems. + 2003-09-06 Matthias Clasen * gtk/gtkaction.c (gtk_action_connect_proxy): Disconnect from diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c index 926cc1b4ac..ff5a718036 100644 --- a/gtk/gtkaction.c +++ b/gtk/gtkaction.c @@ -599,7 +599,7 @@ connect_proxy (GtkAction *action, if (action->private_data->accel_quark) { gtk_menu_item_set_accel_path (GTK_MENU_ITEM (proxy), - g_quark_to_string (action->private_data->accel_quark)); + g_quark_to_string (action->private_data->accel_quark)); } g_signal_connect_object (proxy, "activate", @@ -657,11 +657,6 @@ static void disconnect_proxy (GtkAction *action, GtkWidget *proxy) { - static guint notify_id = 0; - - if (!notify_id) - notify_id = g_signal_lookup ("notify", G_TYPE_OBJECT); - g_object_set_data (G_OBJECT (proxy), "gtk-action", NULL); /* remove proxy from list of proxies */ @@ -687,13 +682,15 @@ disconnect_proxy (GtkAction *action, g_signal_handlers_disconnect_by_func (action, G_CALLBACK (gtk_action_sync_label), proxy); - - gtk_menu_item_set_accel_path (GTK_MENU_ITEM (proxy), NULL); + + if (GTK_IS_MENU_ITEM (widget)) + gtk_menu_item_set_accel_path (GTK_MENU_ITEM (widget), NULL); /* toolbar button specific synchronisers ... */ g_signal_handlers_disconnect_by_func (action, G_CALLBACK (gtk_action_sync_short_label), proxy); + g_signal_handlers_disconnect_by_func (proxy, G_CALLBACK (gtk_action_create_menu_proxy), action);