summaryrefslogtreecommitdiff
path: root/src/totem-menu.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2014-10-20 17:16:36 +0200
committerBastien Nocera <hadess@hadess.net>2014-10-20 18:55:34 +0200
commit187158d2fc7e0a3c2d11e0032aa431f9e7d21916 (patch)
tree18bbe684efea434de1c07d695e96f9522ccd5f9e /src/totem-menu.c
parentd67c0d16bc1ff1406a08090e1f1ad73c6f5a9b46 (diff)
downloadtotem-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.c21
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