608942
From 446da7884914d471ce50f8b327edddbaf0d75ccb Mon Sep 17 00:00:00 2001
608942
From: esoleyman <emil@soleyman.com>
608942
Date: Fri, 24 May 2019 15:25:02 -0500
608942
Subject: [PATCH] Fix the accelerators
608942
608942
The thumbnail view did not allow users to execute commands such as open,
608942
save as, trash, or delete for one or more photo / video thumbnails using
608942
keyboard shortcuts such as ctrl+o, ctrl+s, etc...
608942
608942
https://gitlab.gnome.org/GNOME/cheese/issues/9
608942
---
608942
 src/cheese-application.vala | 2 +-
608942
 src/cheese-window.vala      | 7 +++++++
608942
 2 files changed, 8 insertions(+), 1 deletion(-)
608942
608942
diff --git a/src/cheese-application.vala b/src/cheese-application.vala
608942
index c4542be0..f46f3165 100644
608942
--- a/src/cheese-application.vala
608942
+++ b/src/cheese-application.vala
608942
@@ -116,7 +116,7 @@ public class Cheese.Application : Gtk.Application
608942
             Environment.set_application_name (_("Cheese"));
608942
             Window.set_default_icon_name ("org.gnome.Cheese");
608942
 
608942
-            this.add_accelerator ("space", "app.shoot", null);
608942
+            this.set_accels_for_action ("app.shoot", {"space"});
608942
 
608942
             // FIXME: Push these into the main window initialization.
608942
             main_window.setup_ui ();
608942
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
608942
index 09879fc5..25df09e7 100644
608942
--- a/src/cheese-window.vala
608942
+++ b/src/cheese-window.vala
608942
@@ -1312,6 +1312,13 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
608942
 
608942
         var menu = application.get_menu_by_id ("thumbview-menu");
608942
         thumbnail_popup = new Gtk.Menu.from_model (menu);
608942
+        
608942
+        application.set_accels_for_action ("app.quit", {"<Primary>q"});
608942
+        application.set_accels_for_action ("app.fullscreen", {"F11"});
608942
+        application.set_accels_for_action ("win.file-open", {"<Primary>o"});
608942
+        application.set_accels_for_action ("win.file-saveas", {"<Primary>s"});
608942
+        application.set_accels_for_action ("win.file-trash", {"Delete"});
608942
+        application.set_accels_for_action ("win.file-delete", {"<Shift>Delete"});
608942
 
608942
         this.add_action_entries (actions, this);
608942
 
608942
-- 
608942
GitLab
608942