[gnome-music/wip/jfelder/quit-app-shortcut] window: Restore keyboard shortcut to quit



commit 193c7dac35980ca9059c730abcdb9690f9ddbcd3
Author: Jean Felder <jfelder src gnome org>
Date:   Thu Oct 4 22:42:19 2018 +0200

    window: Restore keyboard shortcut to quit
    
    This is a follow-up of commit 9aa739a9
    With the removal of the application menu, it is no more possible to
    quit the application via Ctrl + q shortcut. The associated action has
    been removed.
    
    Restore this shortcut by adding it to the window key-press-event.

 gnomemusic/application.py | 3 +--
 gnomemusic/window.py      | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index b0316c00..17b871b6 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -72,8 +72,7 @@ class Application(Gtk.Application):
     def _build_app_menu(self):
         action_entries = [
             ('about', self._about),
-            ('help', self._help),
-            ('quit', self.quit),
+            ('help', self._help)
         ]
 
         for action, callback in action_entries:
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 41fea737..707a13f8 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -294,6 +294,8 @@ class Window(Gtk.ApplicationWindow):
 
         # Ctrl+<KEY>
         if control_mask == modifiers:
+            if keyval == Gdk.KEY_q:
+                self.props.application.quit()
             if keyval == Gdk.KEY_a:
                 self._select_all()
             # Open search bar on Ctrl + F


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]