Kouhei Sutou
kous****@users*****
Tue Apr 25 11:45:41 JST 2006
Index: kazehakase/src/kz-window.c diff -u kazehakase/src/kz-window.c:1.265 kazehakase/src/kz-window.c:1.266 --- kazehakase/src/kz-window.c:1.265 Tue Mar 21 15:38:22 2006 +++ kazehakase/src/kz-window.c Tue Apr 25 11:45:41 2006 @@ -391,6 +391,34 @@ g_type_class_add_private (gobject_class, sizeof(KzWindowPrivate)); } +static void +kz_window_setup_action_group (GtkActionGroup *action_group, + GtkAccelGroup *accel_group) +{ + GList *node, *action_list; + + action_list = gtk_action_group_list_actions(action_group); + + for (node = action_list; node; node = g_list_next(node)) + { + gtk_action_set_accel_group(GTK_ACTION(node->data), + accel_group); + gtk_action_connect_accelerator(GTK_ACTION(node->data)); + } + g_list_free(action_list); +} + +static void +kz_window_setup_action_groups (KzWindow *kz) +{ + GtkAccelGroup *accel_group; + + accel_group = gtk_ui_manager_get_accel_group(kz->menu_merge); + + kz_window_setup_action_group (kz->actions, accel_group); + kz_window_setup_action_group (kz->popup_actions, accel_group); + kz_window_setup_action_group (kz->tabpop_actions, accel_group); +} static void kz_window_init (KzWindow *kz) @@ -431,11 +459,10 @@ kz->feed_info = g_object_ref(kz_feed_info_new(kz)); kz->menu_merge = gtk_ui_manager_new(); - accel_group = gtk_ui_manager_get_accel_group(kz->menu_merge); - kz->actions = kz_actions_create_group(kz, accel_group); - kz->popup_actions = kz_actions_popup_create_group(kz, accel_group); - kz->tabpop_actions = kz_actions_tab_popup_create_group(kz, accel_group); + kz->actions = kz_actions_create_group(kz); + kz->popup_actions = kz_actions_popup_create_group(kz); + kz->tabpop_actions = kz_actions_tab_popup_create_group(kz); kz->kzfav = kz_favicon_get_instance(); kz->popup = kz_popup_preview_get_instance(); @@ -481,6 +508,8 @@ kz_ext_setup(kz); + kz_window_setup_action_groups(kz); + /* gesture */ { kz_window_update_gesture_items(kz); @@ -504,6 +533,8 @@ /* menu & toolbar */ { + GtkAccelGroup *accel_group; + kz->menu_box = menu_box = gtk_vbox_new (FALSE, 0); gtk_box_pack_start(GTK_BOX(kz->top_vbox), menu_box, FALSE, FALSE, 0); @@ -519,9 +550,9 @@ g_signal_connect(kz->menu_merge, "add_widget", G_CALLBACK(cb_menu_merge_add_widget), menu_box); - gtk_window_add_accel_group(GTK_WINDOW(kz), - gtk_ui_manager_get_accel_group(kz->menu_merge)); - + accel_group = gtk_ui_manager_get_accel_group(kz->menu_merge); + gtk_window_add_accel_group(GTK_WINDOW(kz), accel_group); + kz_window_sync_ui_level(kz); gtk_ui_manager_ensure_update(kz->menu_merge); g_signal_connect(kz_global_profile,