Make find_menu_position and find_toolbar_position void. (#338100)

2006-04-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkuimanager.c: Make find_menu_position and
	find_toolbar_position void.  (#338100)
This commit is contained in:
Matthias Clasen 2006-04-12 13:32:47 +00:00 committed by Matthias Clasen
parent 2ba96a7150
commit 5977f7f027
3 changed files with 126 additions and 132 deletions

View File

@ -1,3 +1,8 @@
2006-04-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkuimanager.c: Make find_menu_position and
find_toolbar_position void. (#338100)
2006-04-12 Anders Carlsson <andersca@imendio.com>
* gdk/quartz/gdkkeys-quartz.c:

View File

@ -1,3 +1,8 @@
2006-04-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkuimanager.c: Make find_menu_position and
find_toolbar_position void. (#338100)
2006-04-12 Anders Carlsson <andersca@imendio.com>
* gdk/quartz/gdkkeys-quartz.c:

View File

@ -1859,7 +1859,7 @@ find_menu_position (GNode *node,
break;
case NODE_TYPE_MENU_PLACEHOLDER:
menushell = gtk_widget_get_parent (NODE_INFO (parent)->proxy);
g_return_val_if_fail (GTK_IS_MENU_SHELL (menushell), FALSE);
g_return_if_fail (GTK_IS_MENU_SHELL (menushell));
pos = g_list_index (GTK_MENU_SHELL (menushell)->children,
NODE_INFO (parent)->proxy) + 1;
break;
@ -2243,13 +2243,6 @@ update_node (GtkUIManager *self,
}
/* create proxy if needed ... */
if (info->proxy == NULL)
{
GtkWidget *menushell;
gint pos;
if (!
if (NODE_INFO (node->parent)->type == NODE_TYPE_TOOLITEM ||
find_menu_position (node, &menushell, &pos))
{
GtkWidget *tearoff;
GtkWidget *filler;
@ -2276,6 +2269,10 @@ update_node (GtkUIManager *self,
}
else
{
GtkWidget *menushell;
gint pos;
find_menu_position (node, &menushell, &pos);
info->proxy = gtk_action_create_menu_item (action);
g_object_ref_sink (info->proxy);
g_signal_connect (info->proxy, "notify::visible",
@ -2286,7 +2283,6 @@ update_node (GtkUIManager *self,
gtk_menu_shell_insert (GTK_MENU_SHELL (menushell), info->proxy, pos);
}
}
}
else
gtk_action_connect_proxy (action, info->proxy);
@ -2352,8 +2348,7 @@ update_node (GtkUIManager *self,
GtkWidget *menushell;
gint pos;
if (find_menu_position (node, &menushell, &pos))
{
find_menu_position (node, &menushell, &pos);
info->proxy = gtk_separator_menu_item_new ();
g_object_ref_sink (info->proxy);
g_object_set_data (G_OBJECT (info->proxy),
@ -2372,7 +2367,6 @@ update_node (GtkUIManager *self,
gtk_menu_shell_insert (GTK_MENU_SHELL (menushell),
NODE_INFO (node)->extra, pos+1);
}
}
break;
case NODE_TYPE_TOOLBAR_PLACEHOLDER:
/* create toolbar items for placeholders if necessary ... */
@ -2398,11 +2392,9 @@ update_node (GtkUIManager *self,
{
GtkWidget *toolbar;
gint pos;
if (find_toolbar_position (node, &toolbar, &pos))
{
GtkToolItem *item;
find_toolbar_position (node, &toolbar, &pos);
item = gtk_separator_tool_item_new ();
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, pos);
info->proxy = GTK_WIDGET (item);
@ -2421,7 +2413,6 @@ update_node (GtkUIManager *self,
GINT_TO_POINTER (SEPARATOR_MODE_HIDDEN));
gtk_widget_set_no_show_all (info->extra, TRUE);
}
}
break;
case NODE_TYPE_MENUITEM:
/* remove the proxy if it is of the wrong type ... */
@ -2443,8 +2434,7 @@ update_node (GtkUIManager *self,
GtkWidget *menushell;
gint pos;
if (find_menu_position (node, &menushell, &pos))
{
find_menu_position (node, &menushell, &pos);
info->proxy = gtk_action_create_menu_item (action);
g_object_ref_sink (info->proxy);
gtk_widget_set_name (info->proxy, info->name);
@ -2452,7 +2442,6 @@ update_node (GtkUIManager *self,
gtk_menu_shell_insert (GTK_MENU_SHELL (menushell),
info->proxy, pos);
}
}
else
{
g_signal_handlers_disconnect_by_func (info->proxy,
@ -2493,8 +2482,7 @@ update_node (GtkUIManager *self,
GtkWidget *toolbar;
gint pos;
if (find_toolbar_position (node, &toolbar, &pos))
{
find_toolbar_position (node, &toolbar, &pos);
info->proxy = gtk_action_create_tool_item (action);
g_object_ref_sink (info->proxy);
gtk_widget_set_name (info->proxy, info->name);
@ -2502,7 +2490,6 @@ update_node (GtkUIManager *self,
gtk_toolbar_insert (GTK_TOOLBAR (toolbar),
GTK_TOOL_ITEM (info->proxy), pos);
}
}
else
{
g_signal_handlers_disconnect_by_func (info->proxy,
@ -2527,6 +2514,7 @@ update_node (GtkUIManager *self,
GtkWidget *toolbar;
gint pos;
gint separator_mode;
GtkToolItem *item;
if (GTK_IS_SEPARATOR_TOOL_ITEM (info->proxy))
{
@ -2536,9 +2524,8 @@ update_node (GtkUIManager *self,
info->proxy = NULL;
}
if (find_toolbar_position (node, &toolbar, &pos))
{
GtkToolItem *item = gtk_separator_tool_item_new ();
find_toolbar_position (node, &toolbar, &pos);
item = gtk_separator_tool_item_new ();
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, pos);
info->proxy = GTK_WIDGET (item);
g_object_ref_sink (info->proxy);
@ -2558,7 +2545,6 @@ update_node (GtkUIManager *self,
GINT_TO_POINTER (separator_mode));
gtk_widget_show (info->proxy);
}
}
else
{
GtkWidget *menushell;
@ -2572,8 +2558,7 @@ update_node (GtkUIManager *self,
info->proxy = NULL;
}
if (find_menu_position (node, &menushell, &pos))
{
find_menu_position (node, &menushell, &pos);
info->proxy = gtk_separator_menu_item_new ();
g_object_ref_sink (info->proxy);
gtk_widget_set_no_show_all (info->proxy, TRUE);
@ -2584,7 +2569,6 @@ update_node (GtkUIManager *self,
info->proxy, pos);
gtk_widget_show (info->proxy);
}
}
break;
case NODE_TYPE_ACCELERATOR:
gtk_action_connect_accelerator (action);