diff options
author | Shaun McCance <shaunm@gnome.org> | 2014-06-17 12:35:27 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2014-06-17 12:35:27 -0400 |
commit | e30fd2a6de5c6790e4e94d7b96535cc266641c72 (patch) | |
tree | 55ba3745c963266e28808d1259bededad7a04d0b /src/yelp-application.c | |
parent | 82dafad24bd487d9bafcbfdaa94e44923705bc92 (diff) | |
download | yelp-e30fd2a6de5c6790e4e94d7b96535cc266641c72.tar.gz |
yelp-window: Added back Ctrl+L, better key press handling for search
Diffstat (limited to 'src/yelp-application.c')
-rw-r--r-- | src/yelp-application.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/yelp-application.c b/src/yelp-application.c index c1f995b7..2239cbb7 100644 --- a/src/yelp-application.c +++ b/src/yelp-application.c @@ -83,6 +83,7 @@ static gboolean yelp_application_cmdline (GApplication *a gchar ***arguments, gint *exit_status); static void yelp_application_startup (GApplication *app); +static void yelp_application_activate (GApplication *app); static int yelp_application_command_line (GApplication *app, GApplicationCommandLine *cmdline); static void application_uri_resolved (YelpUri *uri, @@ -154,6 +155,7 @@ yelp_application_class_init (YelpApplicationClass *klass) application_class->local_command_line = yelp_application_cmdline; application_class->startup = yelp_application_startup; + application_class->activate = yelp_application_activate; application_class->command_line = yelp_application_command_line; object_class->dispose = yelp_application_dispose; @@ -314,6 +316,18 @@ yelp_application_startup (GApplication *application) gtk_application_set_app_menu (GTK_APPLICATION (application), G_MENU_MODEL (menu)); } +static void +yelp_application_activate (GApplication *application) +{ + const gchar * const accels[] = {"<Control>L", NULL}; + + /* chain up */ + G_APPLICATION_CLASS (yelp_application_parent_class)->activate (application); + + gtk_application_set_accels_for_action (GTK_APPLICATION (application), + "win.yelp-window-ctrll", accels); +} + /******************************************************************************/ static void @@ -408,6 +422,8 @@ yelp_application_command_line (GApplication *application, g_strfreev (argv); + g_application_activate (application); + return 0; } |