diff options
author | Bastien Nocera <hadess@hadess.net> | 2014-10-20 17:16:36 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2014-10-20 18:55:34 +0200 |
commit | 187158d2fc7e0a3c2d11e0032aa431f9e7d21916 (patch) | |
tree | 18bbe684efea434de1c07d695e96f9522ccd5f9e /src/totem-menu.c | |
parent | d67c0d16bc1ff1406a08090e1f1ad73c6f5a9b46 (diff) | |
download | totem-187158d2fc7e0a3c2d11e0032aa431f9e7d21916.tar.gz |
main: Add "remote-command" GAction
Which will be available on the bus for us to use.
Diffstat (limited to 'src/totem-menu.c')
-rw-r--r-- | src/totem-menu.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/totem-menu.c b/src/totem-menu.c index d17a6d07e..7ac40bfbf 100644 --- a/src/totem-menu.c +++ b/src/totem-menu.c @@ -267,6 +267,24 @@ previous_chapter_action_cb (GSimpleAction *action, TOTEM_PROFILE (totem_object_seek_previous (TOTEM_OBJECT (user_data))); } +static void +remote_command_cb (GSimpleAction *action, + GVariant *parameter, + gpointer user_data) +{ + TotemObject *totem; + TotemRemoteCommand cmd; + const char *url; + + totem = TOTEM_OBJECT (user_data); + g_variant_get (parameter, "(i&s)", &cmd, &url); + + if (url && *url == '\0') + totem_object_remote_command (totem, cmd, NULL); + else + totem_object_remote_command (totem, cmd, url); +} + static GActionEntry app_entries[] = { /* Main app menu */ { "open", open_action_cb, NULL, NULL, NULL }, @@ -297,6 +315,9 @@ static GActionEntry app_entries[] = { { "play", play_action_cb, NULL, NULL, NULL }, { "next-chapter", next_chapter_action_cb, NULL, NULL, NULL }, { "previous-chapter", previous_chapter_action_cb, NULL, NULL, NULL }, + + /* Remote command handling */ + { "remote-command", remote_command_cb, "(is)", NULL, NULL }, }; void |