[totem] main: Add shortcut for "Add local video"



commit 04e12907b6323489d6068bffee0d7fbe57e4ce6d
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 17 16:34:08 2022 +0100

    main: Add shortcut for "Add local video"
    
    Co-authored: Sabri Ünal <libreajans gmail com>

 data/shortcuts.ui  | 7 +++++++
 src/totem-menu.c   | 7 ++++++-
 src/totem-object.c | 8 --------
 3 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/data/shortcuts.ui b/data/shortcuts.ui
index a92e9af0f..f1f286a4e 100644
--- a/data/shortcuts.ui
+++ b/data/shortcuts.ui
@@ -28,6 +28,13 @@
                 <property name="title" translatable="yes" context="shortcut window">Keyboard 
shortcuts</property>
               </object>
             </child>
+            <child>
+              <object class="GtkShortcutsShortcut" id="add-local-video">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Primary&gt;O</property>
+                <property name="title" translatable="yes" context="shortcut window">Add local 
video</property>
+              </object>
+            </child>
             <child>
               <object class="GtkShortcutsShortcut" id="add-web-video">
                 <property name="visible">1</property>
diff --git a/src/totem-menu.c b/src/totem-menu.c
index e950b0014..4cb99b17f 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -42,7 +42,9 @@ open_action_cb (GSimpleAction *action,
                GVariant      *parameter,
                gpointer       user_data)
 {
-       totem_object_open (TOTEM_OBJECT (user_data));
+       TotemObject *totem = user_data;
+       totem_object_set_fullscreen (totem, FALSE);
+       totem_object_open (totem);
 }
 
 static void
@@ -364,6 +366,9 @@ totem_app_menu_setup (Totem *totem)
        accels[0] = "<Primary>l";
        accels[1] = "OpenURL";
        gtk_application_set_accels_for_action (GTK_APPLICATION (totem), "app.open-location", (const char * 
const *) accels);
+       accels[0] = "<Primary>o";
+       accels[1] = "Open";
+       gtk_application_set_accels_for_action (GTK_APPLICATION (totem), "app.open", (const char * const *) 
accels);
        gtk_window_set_application (GTK_WINDOW (totem->win), GTK_APPLICATION (totem));
 }
 
diff --git a/src/totem-object.c b/src/totem-object.c
index 5b8e00940..2169b6961 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3480,12 +3480,6 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event)
                totem_object_seek_next (totem);
                show_popup (totem);
                break;
-       case GDK_KEY_O:
-       case GDK_KEY_o:
-       case GDK_KEY_Open:
-               totem_object_set_fullscreen (totem, FALSE);
-               totem_object_open (totem);
-               break;
        case GDK_KEY_AudioPlay:
        case GDK_KEY_p:
        case GDK_KEY_P:
@@ -3753,8 +3747,6 @@ window_key_press_event_cb (GtkWidget *win, GdkEventKey *event, TotemObject *tote
                case GDK_KEY_e:
                case GDK_KEY_f:
                case GDK_KEY_F:
-               case GDK_KEY_O:
-               case GDK_KEY_o:
                case GDK_KEY_q:
                case GDK_KEY_Q:
                case GDK_KEY_space:


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