[totem/wip/hadess/remove-app-menu: 3/5] main: Remove Quit app menu item



commit f378c0375d59e652017d8e501e36f56f8217557b
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jan 31 16:46:52 2019 +0100

    main: Remove Quit app menu item
    
    See https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement

 data/totem.ui      | 5 -----
 src/totem-object.c | 8 ++++++++
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/data/totem.ui b/data/totem.ui
index 24042f4f5..f63dcc533 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -22,11 +22,6 @@
                        <attribute name="action">app.help</attribute>
                        <attribute name="accel">F1</attribute>
                </item>
-               <item>
-                       <attribute name="label" translatable="yes">_Quit</attribute>
-                       <attribute name="action">app.quit</attribute>
-                       <attribute name="accel">&lt;Ctrl&gt;Q</attribute>
-               </item>
        </section>
 </menu>
 
diff --git a/src/totem-object.c b/src/totem-object.c
index e9de92de1..b475dc026 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3491,6 +3491,14 @@ window_key_press_event_cb (GtkWidget *win, GdkEventKey *event, TotemObject *tote
        if (totem->disable_kbd_shortcuts != FALSE)
                return FALSE;
 
+       /* Handle Quit */
+       if (event->state & GDK_CONTROL_MASK &&
+           event->type == GDK_KEY_PRESS &&
+           (event->keyval == GDK_KEY_Q ||
+            event->keyval == GDK_KEY_q)) {
+               return totem_object_handle_key_press (totem, event);
+       }
+
        /* Check whether we're in the player panel */
        if (!g_str_equal (totem_object_get_main_page (totem), "player"))
                return FALSE;


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