[totem] main: Move "Select Subtitles" to cogwheel menu



commit 1cedb723582a9984f03869c341bf0b1fb075b8a0
Author: Bastien Nocera <hadess hadess net>
Date:   Wed May 15 14:34:49 2013 +0200

    main: Move "Select Subtitles" to cogwheel menu

 data/totem.ui      |   19 +++++++++++--------
 src/totem-menu.c   |   18 ++++++++++--------
 src/totem-object.c |    4 ++--
 3 files changed, 23 insertions(+), 18 deletions(-)
---
diff --git a/data/totem.ui b/data/totem.ui
index 9fe1be9..a1e791c 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -108,6 +108,17 @@
                </item>
        </section>
        <section>
+               <submenu>
+                       <attribute name="label">S_ubtitles</attribute>
+                       <section>
+                               <item>
+                                       <attribute name="label" translatable="yes">_Select Text 
Subtitles...</attribute>
+                                       <attribute name="action">app.select-subtitle</attribute>
+                               </item>
+                       </section>
+               </submenu>
+       </section>
+       <section>
                <item>
                        <attribute name="label" translatable="yes">_Properties</attribute>
                        <attribute name="action">app.properties</attribute>
@@ -227,13 +238,6 @@
                <property name="hide-if-empty">False</property>
             </object>
          </child>
-         <child>
-            <object class="GtkAction" id="select-subtitle">
-               <property name="label" translatable="yes">_Select Text Subtitles...</property>
-               <property name="tooltip" translatable="yes">Select a file to use for text subtitles</property>
-               <signal name="activate" handler="select_subtitle_action_callback"/>
-            </object>
-         </child>
 
          <child>
             <object class="GtkAction" id="languages-menu">
@@ -252,7 +256,6 @@
          <menu name="view" action="view-menu">
             <separator/>
             <menu name="subtitles" action="subtitles-menu">
-               <menuitem name="select-subtitle" action="select-subtitle"/>
               <placeholder name="subtitle-download-placeholder"/>
               <separator/>
                <placeholder name="placeholder"/>
diff --git a/src/totem-menu.c b/src/totem-menu.c
index 571289e..045e857 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -43,7 +43,6 @@ G_MODULE_EXPORT void play_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void next_chapter_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void previous_chapter_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void show_sidebar_action_callback (GtkToggleAction *action, Totem *totem);
-G_MODULE_EXPORT void select_subtitle_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void clear_playlist_action_callback (GtkAction *action, Totem *totem);
 
 static void
@@ -236,6 +235,15 @@ eject_action_cb (GSimpleAction *action,
        totem_action_eject (TOTEM_OBJECT (user_data));
 }
 
+static void
+select_subtitle_action_cb (GSimpleAction *action,
+                          GVariant      *parameter,
+                          gpointer       user_data)
+{
+       totem_playlist_select_subtitle_dialog (TOTEM_OBJECT (user_data)->playlist,
+                                              TOTEM_PLAYLIST_DIALOG_PLAYING);
+}
+
 static GActionEntry app_entries[] = {
        /* Main app menu */
        { "open", open_action_cb, NULL, NULL, NULL },
@@ -255,6 +263,7 @@ static GActionEntry app_entries[] = {
        { "dvd-chapter-menu", dvd_chapter_menu_action_cb, NULL, NULL, NULL },
 
        /* Cogwheel menu */
+       { "select-subtitle", select_subtitle_action_cb, NULL, NULL, NULL },
        { "aspect-ratio", aspect_ratio_action_cb, "i", "0", aspect_ratio_change_state },
        { "zoom", toggle_action_cb, NULL, "false", zoom_action_change_state },
        { "next-angle", next_angle_action_cb, NULL, NULL, NULL },
@@ -555,13 +564,6 @@ play_action_callback (GtkAction *action, Totem *totem)
 }
 
 void
-select_subtitle_action_callback (GtkAction *action, Totem *totem)
-{
-       totem_playlist_select_subtitle_dialog (totem->playlist,
-                                              TOTEM_PLAYLIST_DIALOG_PLAYING);
-}
-
-void
 next_chapter_action_callback (GtkAction *action, Totem *totem)
 {
        TOTEM_PROFILE (totem_object_action_next (totem));
diff --git a/src/totem-object.c b/src/totem-object.c
index 9ae2905..edf9afa 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -1707,7 +1707,7 @@ totem_action_set_mrl (TotemObject *totem,
                totem_action_set_sensitivity ("clear-playlist", FALSE);
 
                /* Subtitle selection */
-               totem_action_set_sensitivity ("select-subtitle", FALSE);
+               totem_action_set_sensitivity2 ("app.select-subtitle", FALSE);
 
                /* Set the logo */
                bacon_video_widget_set_logo_mode (totem->bvw, TRUE);
@@ -1752,7 +1752,7 @@ totem_action_set_mrl (TotemObject *totem,
                totem_action_set_sensitivity ("clear-playlist", TRUE);
 
                /* Subtitle selection */
-               totem_action_set_sensitivity ("select-subtitle", !totem_is_special_mrl (mrl));
+               totem_action_set_sensitivity2 ("select-subtitle", !totem_is_special_mrl (mrl));
 
                /* Set the playlist */
                play_pause_set_label (totem, STATE_PAUSED);


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