Commit 7f29f4d8 authored by Bastien Nocera's avatar Bastien Nocera
Browse files

main: Add shortcuts help window

It doesn't include shortcuts from optional plugins, yet.

http://bugzilla.gnome.org/show_bug.cgi?id=757831
parent f283b9b0
......@@ -29,48 +29,12 @@ gromit 20041213, for the Telestrator mode:
Controls
========
P, Ctrl+Space:
Play/Pause
Escape (in full screen mode):
Switch to windowed mode
Ctrl+F:
Toggle full screen
Left arrow:
Go back 15 seconds
Right arrow:
Go forward 60 seconds
Shift+Left arrow:
Go back 5 seconds
Shift+Right arrow:
Go forward 15 seconds
Ctrl+Left arrow:
Go back 3 minutes
Ctrl+Right arrow:
Go forward 10 minutes
Up Arrow:
Increase the volume by 8%
Down Arrow:
Decrease the volume by 8%
Keypad Up / Keypad 8:
DVD Action Up
Keypad Down / Keypad 2:
DVD Action Down
Keypad Left / Keypad 4:
DVD Action Left
Keypad Right / Keypad 6:
DVD Action Right
B, Alt+Left arrow, Minus key:
Previous stream (Back)
N, Alt+Right arrow, Plus key:
Next stream (Next)
Ctrl+H:
Shortcut help
Undocumented shortcuts:
Ctrl+Q:
Quit
Ctrl+R, Ctrl+T:
Zoom in and zoom out, respectively
Ctrl+0:
Reset the zoom level
Ctrl+K:
Show the "Skip to" dialog
Ctrl+D:
Toggle drawing using Gromit
Ctrl+E:
......
......@@ -53,7 +53,7 @@ AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
# Requirements
GLIB_REQS=2.35.0
GIO_REQS=2.27.92
GTK_REQS=3.16.0
GTK_REQS=3.19.3
TOTEM_PLPARSER_REQS=3.10.1
VALA_REQS=0.14.1
PEAS_REQS=1.1.0
......
......@@ -19,7 +19,8 @@ stuff_DATA = \
preferences.ui \
properties.ui \
uri.ui \
controls.ui
controls.ui \
shortcuts.ui
EXTRA_DIST += $(stuff_DATA)
# Icons
......
......@@ -13,6 +13,11 @@
</section>
<section id="python-console-placeholder"/>
<section>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">app.shortcuts</attribute>
<attribute name="accel">&lt;Ctrl&gt;H</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Help</attribute>
<attribute name="action">app.help</attribute>
......
......@@ -8,6 +8,7 @@ data/org.gnome.Totem.desktop.in.in.in
[type: gettext/glade]data/playlist.ui
[type: gettext/glade]data/preferences.ui
[type: gettext/glade]data/properties.ui
[type: gettext/glade]data/shortcuts.ui
[type: gettext/glade]data/totem.ui
[type: gettext/glade]data/uri.ui
src/backend/bacon-time-label.c
......
......@@ -170,6 +170,14 @@ help_action_cb (GSimpleAction *action,
totem_object_show_help (TOTEM_OBJECT (user_data));
}
static void
keyboard_shortcuts_action_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
totem_object_show_keyboard_shortcuts (TOTEM_OBJECT (user_data));
}
static void
quit_action_cb (GSimpleAction *action,
GVariant *parameter,
......@@ -295,6 +303,7 @@ static GActionEntry app_entries[] = {
{ "fullscreen", toggle_action_cb, NULL, "false", fullscreen_change_state },
{ "preferences", preferences_action_cb, NULL, NULL, NULL },
{ "repeat", toggle_action_cb, NULL, "false", repeat_change_state },
{ "shortcuts", keyboard_shortcuts_action_cb, NULL, NULL, NULL },
{ "help", help_action_cb, NULL, NULL, NULL },
{ "quit", quit_action_cb, NULL, NULL, NULL },
......
......@@ -2190,6 +2190,27 @@ totem_object_show_help (TotemObject *totem)
}
}
void
totem_object_show_keyboard_shortcuts (TotemObject *totem)
{
GtkBuilder *builder;
if (totem->shortcuts_win) {
gtk_window_present (totem->shortcuts_win);
return;
}
builder = totem_interface_load ("shortcuts.ui", FALSE, NULL, NULL);
totem->shortcuts_win = GTK_WINDOW (gtk_builder_get_object (builder, "shortcuts-totem"));
gtk_window_set_transient_for (totem->shortcuts_win, GTK_WINDOW (totem->win));
g_signal_connect (totem->shortcuts_win, "destroy",
G_CALLBACK (gtk_widget_destroyed), &totem->shortcuts_win);
gtk_widget_show_all (GTK_WIDGET (totem->shortcuts_win));
g_object_unref (builder);
}
/* This is called in the main thread */
static void
totem_object_drop_files_finished (TotemPlaylist *playlist, GAsyncResult *result, TotemObject *totem)
......@@ -3252,6 +3273,13 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event)
case GDK_KEY_G:
totem_object_next_angle (totem);
break;
case GDK_KEY_H:
case GDK_KEY_h:
totem_object_show_keyboard_shortcuts (totem);
break;
case GDK_KEY_question:
totem_object_show_keyboard_shortcuts (totem);
break;
case GDK_KEY_M:
case GDK_KEY_m:
bacon_video_widget_dvd_event (totem->bvw, BVW_DVD_ROOT_MENU);
......
......@@ -77,6 +77,7 @@ struct _TotemObject {
BaconVideoWidget *bvw;
GtkWidget *prefs;
GtkBuilder *prefs_xml;
GtkWindow *shortcuts_win;
GtkWidget *grilo;
......@@ -171,6 +172,7 @@ void totem_object_open_location (Totem *totem);
void totem_object_eject (Totem *totem);
void totem_object_set_zoom (Totem *totem, gboolean zoom);
void totem_object_show_help (Totem *totem);
void totem_object_show_keyboard_shortcuts (Totem *totem);
void totem_object_show_properties (Totem *totem);
void totem_object_set_mrl (TotemObject *totem,
const char *mrl,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment