X-Git-Url: http://git.code-monkey.de/?p=raktpdf.git;a=blobdiff_plain;f=src%2Frakt-window.c;h=1ada22c1534c51fbe0c9b31c1079253625c70ae6;hp=59dfca47a2aa9a44a028472359e405d8e0e71d3d;hb=4f8fb1d7ac832753d4beff7a8b175e61727a86b9;hpb=63bf23cdcb107e0ff61f0eda0ebfcc264877defe diff --git a/src/rakt-window.c b/src/rakt-window.c index 59dfca4..1ada22c 100644 --- a/src/rakt-window.c +++ b/src/rakt-window.c @@ -30,9 +30,7 @@ #include "rakt-window.h" -typedef struct RaktWindowPriv RaktWindowPriv; - -struct RaktWindowPriv { +typedef struct { GtkWidget *content_vbox; /* Menu & toolbar */ @@ -44,7 +42,7 @@ struct RaktWindowPriv { GdkPixbuf *pixbuf; PopplerDocument *document; gint page_no; -}; +} RaktWindowPriv; static void window_finalize (GObject *object); @@ -60,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) }, { @@ -79,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) } }; @@ -98,6 +99,10 @@ static const gchar *ui_layout = " " " " " " + " " + " " + " " + " " " " " " " " @@ -178,6 +183,7 @@ window_create_menu (RaktWindow *window) { RaktWindowPriv *priv; GtkActionGroup *action_group; + GtkAccelGroup *accel_group; GError *error = NULL; priv = GET_PRIV (window); @@ -193,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);