[totem] main: Add shortcut for "Add web video"
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] main: Add shortcut for "Add web video"
- Date: Thu, 17 Feb 2022 16:07:49 +0000 (UTC)
commit 18c95d4184e2778a0bba6741795941c12e199ca3
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 17 16:31:20 2022 +0100
main: Add shortcut for "Add web video"
Co-authored: Sabri Ünal <libreajans gmail com>
data/shortcuts.ui | 8 ++++++++
src/totem-menu.c | 9 +++++++--
src/totem-object.c | 6 ------
3 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/data/shortcuts.ui b/data/shortcuts.ui
index 34658891e..a92e9af0f 100644
--- a/data/shortcuts.ui
+++ b/data/shortcuts.ui
@@ -28,6 +28,14 @@
<property name="title" translatable="yes" context="shortcut window">Keyboard
shortcuts</property>
</object>
</child>
+ <child>
+ <object class="GtkShortcutsShortcut" id="add-web-video">
+ <property name="visible">1</property>
+ <property name="accelerator"><Primary>L</property>
+ <property name="title" translatable="yes" context="shortcut window">Add web video</property>
+ </object>
+ </child>
+ <child>
<object class="GtkShortcutsShortcut" id="properties">
<property name="visible">1</property>
<property name="accelerator"><Primary>p</property>
diff --git a/src/totem-menu.c b/src/totem-menu.c
index 765e147e8..e950b0014 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -50,7 +50,9 @@ open_location_action_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- totem_object_open_location (TOTEM_OBJECT (user_data));
+ TotemObject *totem = user_data;
+ totem_object_set_fullscreen (totem, FALSE);
+ totem_object_open_location (totem);
}
static void
@@ -341,7 +343,7 @@ totem_app_actions_setup (Totem *totem)
void
totem_app_menu_setup (Totem *totem)
{
- char *accels[] = { NULL, NULL };
+ char *accels[] = { NULL, NULL, NULL };
const char * const shortcuts_accels[] = {
"<Ctrl>H",
"<Ctrl>question",
@@ -359,6 +361,9 @@ totem_app_menu_setup (Totem *totem)
gtk_application_set_accels_for_action (GTK_APPLICATION (totem), "app.shortcuts", shortcuts_accels);
accels[0] = "F1";
gtk_application_set_accels_for_action (GTK_APPLICATION (totem), "app.help", (const char * const *)
accels);
+ accels[0] = "<Primary>l";
+ accels[1] = "OpenURL";
+ gtk_application_set_accels_for_action (GTK_APPLICATION (totem), "app.open-location", (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 37a56bb1c..5b8e00940 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3480,10 +3480,6 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event)
totem_object_seek_next (totem);
show_popup (totem);
break;
- case GDK_KEY_OpenURL:
- totem_object_set_fullscreen (totem, FALSE);
- totem_object_open_location (totem);
- break;
case GDK_KEY_O:
case GDK_KEY_o:
case GDK_KEY_Open:
@@ -3759,8 +3755,6 @@ window_key_press_event_cb (GtkWidget *win, GdkEventKey *event, TotemObject *tote
case GDK_KEY_F:
case GDK_KEY_O:
case GDK_KEY_o:
- case GDK_KEY_L:
- case GDK_KEY_l:
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]