Kouhei Sutou
kous****@users*****
Wed Apr 26 10:17:55 JST 2006
Index: kazehakase/src/kz-window.c diff -u kazehakase/src/kz-window.c:1.266 kazehakase/src/kz-window.c:1.267 --- kazehakase/src/kz-window.c:1.266 Tue Apr 25 11:45:41 2006 +++ kazehakase/src/kz-window.c Wed Apr 26 10:17:55 2006 @@ -391,6 +391,24 @@ g_type_class_add_private (gobject_class, sizeof(KzWindowPrivate)); } +void +kz_window_connect_action (KzWindow *kz, GtkAction *action) +{ + GtkAccelGroup *accel_group; + + accel_group = gtk_ui_manager_get_accel_group(kz->menu_merge); + + gtk_action_set_accel_group(action, accel_group); + gtk_action_connect_accelerator(action); +} + +void +kz_window_disconnect_action (KzWindow *kz, GtkAction *action) +{ + gtk_action_disconnect_accelerator(action); + gtk_action_set_accel_group(action, NULL); +} + static void kz_window_setup_action_group (GtkActionGroup *action_group, GtkAccelGroup *accel_group) @@ -401,9 +419,9 @@ 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)); + GtkAction *action = GTK_ACTION(node->data); + gtk_action_set_accel_group(action, accel_group); + gtk_action_connect_accelerator(action); } g_list_free(action_list); } @@ -427,7 +445,6 @@ GtkSettings *setting; GtkWidget *vseparator; GList *children, *node; - GtkAccelGroup *accel_group; GtkSettings *settings; KzWindowPrivate *priv = KZ_WINDOW_GET_PRIVATE (kz); Index: kazehakase/src/kz-window.h diff -u kazehakase/src/kz-window.h:1.66 kazehakase/src/kz-window.h:1.67 --- kazehakase/src/kz-window.h:1.66 Sun Feb 12 00:29:53 2006 +++ kazehakase/src/kz-window.h Wed Apr 26 10:17:55 2006 @@ -128,6 +128,10 @@ const gchar *url); void kz_window_store_state (KzWindow *kz); void kz_window_restore_state (KzWindow *kz); +void kz_window_connect_action (KzWindow *kz, + GtkAction *action); +void kz_window_disconnect_action (KzWindow *kz, + GtkAction *action); void kz_window_update_gesture_items (KzWindow *kz); const gchar *kz_window_get_title (KzWindow *kz); const gchar *kz_window_get_uri (KzWindow *kz);