gtk2/polkit-action.patch

125 lines
4.6 KiB
Diff
Raw Normal View History

2009-02-07 03:27:44 +00:00
diff -up gtk+-2.15.3/gtk/gtkaction.c.polkit gtk+-2.15.3/gtk/gtkaction.c
--- gtk+-2.15.3/gtk/gtkaction.c.polkit 2009-02-06 22:24:40.000000000 -0500
+++ gtk+-2.15.3/gtk/gtkaction.c 2009-02-06 22:25:35.000000000 -0500
@@ -1509,8 +1509,6 @@ gtk_action_set_icon_name (GtkAction *a
g_return_if_fail (GTK_IS_ACTION (action));
- g_return_if_fail (GTK_IS_ACTION (action));
-
tmp = action->private_data->icon_name;
action->private_data->icon_name = g_strdup (icon_name);
g_free (tmp);
@@ -1604,6 +1602,8 @@ gtk_action_block_activate_from (GtkActio
g_signal_handlers_block_by_func (proxy, G_CALLBACK (gtk_action_activate),
action);
+
+ gtk_action_block_activate (action);
}
/**
@@ -1630,6 +1630,8 @@ gtk_action_unblock_activate_from (GtkAct
g_signal_handlers_unblock_by_func (proxy, G_CALLBACK (gtk_action_activate),
action);
+
+ gtk_action_unblock_activate (action);
}
static void
diff -up gtk+-2.15.3/gtk/gtkcheckmenuitem.c.polkit gtk+-2.15.3/gtk/gtkcheckmenuitem.c
--- gtk+-2.15.3/gtk/gtkcheckmenuitem.c.polkit 2009-02-06 22:24:48.000000000 -0500
+++ gtk+-2.15.3/gtk/gtkcheckmenuitem.c 2009-02-06 22:25:41.000000000 -0500
@@ -188,7 +188,7 @@ gtk_check_menu_item_activatable_reset (G
parent_activatable_iface->reset (activatable, action);
- if (!action)
+ if (!GTK_IS_TOGGLE_ACTION (action))
return;
gtk_action_block_activate (action);
diff -up gtk+-2.15.3/gtk/gtkimagemenuitem.c.polkit gtk+-2.15.3/gtk/gtkimagemenuitem.c
--- gtk+-2.15.3/gtk/gtkimagemenuitem.c.polkit 2009-02-06 22:24:55.000000000 -0500
+++ gtk+-2.15.3/gtk/gtkimagemenuitem.c 2009-02-06 22:25:47.000000000 -0500
@@ -601,7 +601,7 @@ activatable_update_icon_name (GtkImageMe
image = gtk_image_menu_item_get_image (image_menu_item);
- if (GTK_IS_IMAGE (image) && icon_name &&
+ if (GTK_IS_IMAGE (image) &&
(gtk_image_get_storage_type (GTK_IMAGE (image)) == GTK_IMAGE_EMPTY ||
gtk_image_get_storage_type (GTK_IMAGE (image)) == GTK_IMAGE_ICON_NAME))
{
diff -up gtk+-2.15.3/gtk/gtktogglebutton.c.polkit gtk+-2.15.3/gtk/gtktogglebutton.c
--- gtk+-2.15.3/gtk/gtktogglebutton.c.polkit 2009-02-06 22:25:06.000000000 -0500
+++ gtk+-2.15.3/gtk/gtktogglebutton.c 2009-02-06 22:25:53.000000000 -0500
@@ -188,7 +188,7 @@ gtk_toggle_button_activatable_reset (Gtk
parent_activatable_iface->reset (activatable, action);
- if (!action)
+ if (!GTK_IS_TOGGLE_ACTION (action))
return;
button = GTK_TOGGLE_BUTTON (activatable);
diff -up gtk+-2.15.3/gtk/gtktoggletoolbutton.c.polkit gtk+-2.15.3/gtk/gtktoggletoolbutton.c
--- gtk+-2.15.3/gtk/gtktoggletoolbutton.c.polkit 2009-02-06 22:25:16.000000000 -0500
+++ gtk+-2.15.3/gtk/gtktoggletoolbutton.c 2009-02-06 22:25:59.000000000 -0500
@@ -346,7 +346,7 @@ gtk_toggle_tool_button_activatable_reset
parent_activatable_iface->reset (activatable, action);
- if (!action)
+ if (!GTK_IS_TOGGLE_ACTION (action))
return;
button = GTK_TOGGLE_TOOL_BUTTON (activatable);
diff -up gtk+-2.15.3/gtk/gtktoolbutton.c.polkit gtk+-2.15.3/gtk/gtktoolbutton.c
--- gtk+-2.15.3/gtk/gtktoolbutton.c.polkit 2009-02-06 22:25:24.000000000 -0500
+++ gtk+-2.15.3/gtk/gtktoolbutton.c 2009-02-06 22:26:03.000000000 -0500
@@ -760,24 +760,9 @@ gtk_tool_button_activatable_update (GtkA
button = GTK_TOOL_BUTTON (activatable);
if (strcmp (property_name, "short-label") == 0)
- {
- if (!gtk_action_get_stock_id (action) &&
- !gtk_action_get_icon_name (action))
- {
- gtk_tool_button_set_use_underline (button, TRUE);
- gtk_tool_button_set_label (button, gtk_action_get_short_label (action));
- }
- }
+ gtk_tool_button_set_label (button, gtk_action_get_short_label (action));
else if (strcmp (property_name, "stock-id") == 0)
- {
- if (gtk_action_get_stock_id (action))
- {
- gtk_tool_button_set_label (button, NULL);
- gtk_tool_button_set_icon_name (button, NULL);
- }
- gtk_tool_button_set_icon_widget (button, NULL);
- gtk_tool_button_set_stock_id (button, gtk_action_get_stock_id (action));
- }
+ gtk_tool_button_set_stock_id (button, gtk_action_get_stock_id (action));
else if (strcmp (property_name, "gicon") == 0)
{
const gchar *stock_id = gtk_action_get_stock_id (action);
@@ -800,14 +785,7 @@ gtk_tool_button_activatable_update (GtkA
}
else if (strcmp (property_name, "icon-name") == 0)
- {
- if (gtk_action_get_icon_name (action))
- {
- gtk_tool_button_set_label (button, NULL);
- gtk_tool_button_set_stock_id (button, NULL);
- }
- gtk_tool_button_set_icon_name (button, gtk_action_get_icon_name (action));
- }
+ gtk_tool_button_set_icon_name (button, gtk_action_get_icon_name (action));
}
static void