[gnome-music/wip/jfelder/quit-app-shortcut] window: Restore keyboard shortcut to quit
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/quit-app-shortcut] window: Restore keyboard shortcut to quit
- Date: Fri, 5 Oct 2018 09:59:21 +0000 (UTC)
commit 6e980d4264d626ee3f51d9e527a5c5fb03197923
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..a08397d0 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -310,6 +310,8 @@ class Window(Gtk.ApplicationWindow):
# Play next on Ctrl + N
if keyval == Gdk.KEY_n:
self._player.next()
+ if keyval == Gdk.KEY_q:
+ self.props.application.quit()
# Toggle repeat on Ctrl + R
if keyval == Gdk.KEY_r:
if self._player.props.repeat_mode == RepeatMode.SONG:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]