Finally enable global accelerators in all docks:

2004-05-05  Michael Natterer  <mitch@gimp.org>

	Finally enable global accelerators in all docks:

	* app/widgets/gimpimagedock.c (gimp_image_dock_constructor):
	iterate all of the UI manager's actions and enable their
	accelerators manually. Fixes bug #119878.
This commit is contained in:
Michael Natterer 2004-05-05 01:06:14 +00:00 committed by Michael Natterer
parent 58bcea08cc
commit cd8243e19f
3 changed files with 64 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2004-05-05 Michael Natterer <mitch@gimp.org>
Finally enable global accelerators in all docks:
* app/widgets/gimpimagedock.c (gimp_image_dock_constructor):
iterate all of the UI manager's actions and enable their
accelerators manually. Fixes bug #119878.
2004-05-05 Sven Neumann <sven@gimp.org>
* app/widgets/gimpviewabledialog.c: added construct properties to

View File

@ -224,6 +224,9 @@ gimp_image_dock_constructor (GType type,
GObject *object;
GimpImageDock *dock;
GimpMenuFactory *menu_factory;
GtkUIManager *ui_manager;
GtkAccelGroup *accel_group;
GList *groups;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
@ -234,8 +237,31 @@ gimp_image_dock_constructor (GType type,
dock->ui_manager = gimp_menu_factory_manager_new (menu_factory, "<Dock>",
dock, FALSE);
gtk_window_add_accel_group (GTK_WINDOW (object),
gtk_ui_manager_get_accel_group (GTK_UI_MANAGER (dock->ui_manager)));
ui_manager = GTK_UI_MANAGER (dock->ui_manager);
accel_group = gtk_ui_manager_get_accel_group (ui_manager);
for (groups = gtk_ui_manager_get_action_groups (ui_manager);
groups;
groups = g_list_next (groups))
{
GList *actions;
GList *list;
actions = gtk_action_group_list_actions (groups->data);
for (list = actions; list; list = g_list_next (list))
{
GtkAction *action = list->data;
gtk_action_set_accel_group (action, accel_group);
gtk_action_connect_accelerator (action);
}
g_list_free (actions);
}
gtk_window_add_accel_group (GTK_WINDOW (object), accel_group);
return object;
}

View File

@ -224,6 +224,9 @@ gimp_image_dock_constructor (GType type,
GObject *object;
GimpImageDock *dock;
GimpMenuFactory *menu_factory;
GtkUIManager *ui_manager;
GtkAccelGroup *accel_group;
GList *groups;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
@ -234,8 +237,31 @@ gimp_image_dock_constructor (GType type,
dock->ui_manager = gimp_menu_factory_manager_new (menu_factory, "<Dock>",
dock, FALSE);
gtk_window_add_accel_group (GTK_WINDOW (object),
gtk_ui_manager_get_accel_group (GTK_UI_MANAGER (dock->ui_manager)));
ui_manager = GTK_UI_MANAGER (dock->ui_manager);
accel_group = gtk_ui_manager_get_accel_group (ui_manager);
for (groups = gtk_ui_manager_get_action_groups (ui_manager);
groups;
groups = g_list_next (groups))
{
GList *actions;
GList *list;
actions = gtk_action_group_list_actions (groups->data);
for (list = actions; list; list = g_list_next (list))
{
GtkAction *action = list->data;
gtk_action_set_accel_group (action, accel_group);
gtk_action_connect_accelerator (action);
}
g_list_free (actions);
}
gtk_window_add_accel_group (GTK_WINDOW (object), accel_group);
return object;
}