X-Git-Url: http://git.code-monkey.de/?p=raktpdf.git;a=blobdiff_plain;f=src%2Frakt-window.c;h=1ada22c1534c51fbe0c9b31c1079253625c70ae6;hp=7cea82202828ca59208b9f1b1c394fdc9bc53009;hb=4f8fb1d7ac832753d4beff7a8b175e61727a86b9;hpb=7b2bc2306cc71d72f4416069c4551b69de8f3c5f diff --git a/src/rakt-window.c b/src/rakt-window.c index 7cea822..1ada22c 100644 --- a/src/rakt-window.c +++ b/src/rakt-window.c @@ -58,12 +58,15 @@ static const GtkActionEntry action_entries[] = { { "FileMenu", NULL, "_File", NULL, NULL, NULL }, + { + "GoMenu", NULL, "_Go", NULL, NULL, NULL + }, { "HelpMenu", NULL, "_Help", NULL, NULL, NULL }, { - "Open", GTK_STOCK_OPEN, - "_Open", "O", "Open a PDF file", + "Open", GTK_STOCK_OPEN, "_Open", + "O", "Open a PDF file", G_CALLBACK (on_action_open) }, { @@ -77,13 +80,13 @@ static const GtkActionEntry action_entries[] = { G_CALLBACK (on_action_go_previous) }, { - "Quit", GTK_STOCK_QUIT, - "_Quit", "Q", "Quit the application", + "Quit", GTK_STOCK_QUIT, "_Quit", + "Q", "Quit the application", G_CALLBACK (on_action_quit) }, { - "About", GTK_STOCK_ABOUT, - "_About", NULL, "About this application", + "About", GTK_STOCK_ABOUT, "_About", + NULL, "About this application", G_CALLBACK (on_action_about) } }; @@ -96,6 +99,10 @@ static const gchar *ui_layout = " " " " " " + " " + " " + " " + " " " " " " " " @@ -176,6 +183,7 @@ window_create_menu (RaktWindow *window) { RaktWindowPriv *priv; GtkActionGroup *action_group; + GtkAccelGroup *accel_group; GError *error = NULL; priv = GET_PRIV (window); @@ -191,6 +199,10 @@ window_create_menu (RaktWindow *window) gtk_action_group_add_actions (action_group, action_entries, G_N_ELEMENTS (action_entries), window); gtk_ui_manager_insert_action_group (priv->ui_manager, action_group, 0); + + accel_group = gtk_ui_manager_get_accel_group (priv->ui_manager); + gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); + g_object_unref (action_group); gtk_ui_manager_add_ui_from_string (priv->ui_manager, ui_layout, -1, &error);