[totem] main: Handle "Play DVD" key



commit e4f142f9d29a145e21dc6340f07b9b41c0fd02a2
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 6 15:00:59 2014 +0100

    main: Handle "Play DVD" key

 src/totem-grilo.c  |   18 ++++++++++++++++++
 src/totem-grilo.h  |    7 +++++++
 src/totem-object.c |    4 +++-
 3 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index c40dee5..d48a6bf 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -2223,6 +2223,24 @@ totem_grilo_get_show_back_button (TotemGrilo *self)
        return self->priv->show_back_button;
 }
 
+void
+totem_grilo_set_current_page (TotemGrilo     *self,
+                             TotemGriloPage  page)
+{
+       GtkWidget *button;
+
+       g_return_if_fail (TOTEM_IS_GRILO (self));
+
+       if (page == TOTEM_GRILO_PAGE_RECENT)
+               button = self->priv->recent;
+       else if (page == TOTEM_GRILO_PAGE_CHANNELS)
+               button = self->priv->channels;
+       else
+               g_assert_not_reached ();
+
+       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+}
+
 static void
 totem_grilo_set_property (GObject         *object,
                           guint            prop_id,
diff --git a/src/totem-grilo.h b/src/totem-grilo.h
index 893363c..33355db 100644
--- a/src/totem-grilo.h
+++ b/src/totem-grilo.h
@@ -57,11 +57,18 @@ struct _TotemGriloClass
   GtkBoxClass parent_class;
 };
 
+typedef enum{
+  TOTEM_GRILO_PAGE_RECENT,
+  TOTEM_GRILO_PAGE_CHANNELS
+} TotemGriloPage;
+
 GType           totem_grilo_get_type              (void) G_GNUC_CONST;
 GtkWidget*      totem_grilo_new                   (TotemObject *totem,
                                                    GtkWidget   *header);
 void            totem_grilo_back_button_clicked   (TotemGrilo  *self);
 gboolean        totem_grilo_get_show_back_button  (TotemGrilo  *self);
+void            totem_grilo_set_current_page      (TotemGrilo     *self,
+                                                   TotemGriloPage  page);
 
 G_END_DECLS
 
diff --git a/src/totem-object.c b/src/totem-object.c
index 10f79d1..ca37035 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -2842,7 +2842,9 @@ totem_object_remote_command (TotemObject *totem, TotemRemoteCommand cmd, const c
                totem_object_eject (totem);
                break;
        case TOTEM_REMOTE_COMMAND_PLAY_DVD:
-               /* FIXME - focus the "Optical Media" section in Grilo */
+               if (g_strcmp0 (totem_object_get_main_page (totem), "player") == 0)
+                       back_button_clicked_cb (NULL, totem);
+               totem_grilo_set_current_page (TOTEM_GRILO (totem->grilo), TOTEM_GRILO_PAGE_RECENT);
                break;
        case TOTEM_REMOTE_COMMAND_MUTE:
                totem_object_volume_toggle_mute (totem);


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