[eog/wip/gaction-migration] EogApplication: add accelerators to GActions
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog/wip/gaction-migration] EogApplication: add accelerators to GActions
- Date: Sun, 21 Dec 2014 14:50:33 +0000 (UTC)
commit 1d0bc8471bdc53db0c5d84f6859d3b5596795271
Author: Jente Hidskes <hjdskes gmail com>
Date: Sat Dec 20 02:09:30 2014 +0100
EogApplication: add accelerators to GActions
This patch adds accelerators to those GActions whose GtkActions
used to have accelerators.
https://bugzilla.gnome.org/show_bug.cgi?id=741050
src/eog-application.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/src/eog-application.c b/src/eog-application.c
index 4dcb839..5eedfe9 100644
--- a/src/eog-application.c
+++ b/src/eog-application.c
@@ -222,6 +222,39 @@ eog_application_init_app_menu (EogApplication *application)
}
static void
+eog_application_init_accelerators (GtkApplication *application)
+{
+ gtk_application_set_accels_for_action (application, "win.open", (const gchar*[]) {"<Ctrl>o", NULL});
+ gtk_application_set_accels_for_action (application, "win.save", (const gchar*[]) {"<Ctrl>s", NULL});
+ gtk_application_set_accels_for_action (application, "win.save-as", (const gchar*[])
{"<Ctrl><shift>s", NULL});
+ gtk_application_set_accels_for_action (application, "win.close", (const gchar*[]) {"<Ctrl>w", NULL});
+ gtk_application_set_accels_for_action (application, "win.print", (const gchar*[]) {"<Ctrl>p", NULL});
+ gtk_application_set_accels_for_action (application, "win.properties", (const gchar*[])
{"<Alt>Return", NULL});
+ gtk_application_set_accels_for_action (application, "win.set-wallpaper", (const gchar*[])
{"<Ctrl>F8", NULL});
+ gtk_application_set_accels_for_action (application, "win.manual", (const gchar*[]) {"F1", NULL});
+
+ gtk_application_set_accels_for_action (application, "win.go-previous", (const gchar*[]) {"Left",
"BackSpace", NULL});
+ gtk_application_set_accels_for_action (application, "win.go-next", (const gchar*[]) {"Right", NULL});
+ gtk_application_set_accels_for_action (application, "win.go-first", (const gchar*[]) {"<Alt>Home",
"Home", NULL});
+ gtk_application_set_accels_for_action (application, "win.go-last", (const gchar*[]) {"<Alt>End",
"End", NULL});
+ gtk_application_set_accels_for_action (application, "win.go-random", (const gchar*[]) {"<Ctrl>m",
NULL});
+ gtk_application_set_accels_for_action (application, "win.rotate-90", (const gchar*[]) {"<Ctrl>r",
NULL});
+ gtk_application_set_accels_for_action (application, "win.rotate-270", (const gchar*[])
{"<Ctrl><Shift>r", NULL});
+ gtk_application_set_accels_for_action (application, "win.move-trash", (const gchar*[]) {"Delete",
NULL});
+ gtk_application_set_accels_for_action (application, "win.delete", (const gchar*[]) {"<Shift>Delete",
NULL});
+ gtk_application_set_accels_for_action (application, "win.copy", (const gchar*[]) {"<Ctrl>c", NULL});
+ gtk_application_set_accels_for_action (application, "win.undo", (const gchar*[]) {"<Ctrl>z", NULL});
+ gtk_application_set_accels_for_action (application, "win.zoom-in", (const gchar*[]) {"<Ctrl>equal",
"<Ctrl>KP_Add", "<Ctrl>plus", NULL});
+ gtk_application_set_accels_for_action (application, "win.zoom-out", (const gchar*[]) {"<Ctrl>minus",
"<Ctrl>KP_Subtract", NULL});
+ gtk_application_set_accels_for_action (application, "win.zoom-normal", (const gchar*[]) {"<Ctrl>0",
NULL});
+
+ gtk_application_set_accels_for_action (application, "win.view-gallery", (const gchar*[]) {"F9",
NULL});
+ gtk_application_set_accels_for_action (application, "win.view-sidebar", (const gchar*[]) {"<Ctrl>F9",
NULL});
+ gtk_application_set_accels_for_action (application, "win.view-fullscreen", (const gchar*[]) {"F11",
NULL});
+ gtk_application_set_accels_for_action (application, "win.toggle-zoom-fit", (const gchar*[]) {"F",
NULL});
+}
+
+static void
on_extension_added (PeasExtensionSet *set,
PeasPluginInfo *info,
PeasExtension *exten,
@@ -287,6 +320,7 @@ eog_application_startup (GApplication *application)
NULL);
eog_application_init_app_menu (app);
+ eog_application_init_accelerators (GTK_APPLICATION (app));
app->priv->extensions = peas_extension_set_new (
PEAS_ENGINE (app->priv->plugin_engine),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]