[totem] main: Move "Next angle" menu item to cogwheel



commit 894aec1842a0117a45c7992237f0af46d21b7c2c
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 10 17:31:02 2013 +0200

    main: Move "Next angle" menu item to cogwheel

 data/totem.ui      |   14 +++++---------
 src/totem-menu.c   |   18 +++++++++++-------
 src/totem-object.c |    4 ++--
 3 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/data/totem.ui b/data/totem.ui
index 36c5c7b..4b9e760 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -100,6 +100,11 @@
                        <attribute name="action">app.zoom</attribute>
                </item>
                <section id="rotation-placeholder"/>
+               <item>
+                       <attribute name="label" translatable="yes">Switch An_gles</attribute>
+                       <attribute name="action">app.next-angle</attribute>
+                       <attribute name="accel">&lt;Ctrl&gt;G</attribute>
+               </item>
        </section>
 </menu>
 
@@ -197,14 +202,6 @@
                <property name="label" translatable="yes">_Aspect Ratio</property>
             </object>
          </child>
-         <child>
-            <object class="GtkAction" id="next-angle">
-               <property name="label" translatable="yes">Switch An_gles</property>
-               <property name="tooltip" translatable="yes">Switch camera angles</property>
-               <signal name="activate" handler="next_angle_action_callback"/>
-            </object>
-            <accelerator key="G" modifiers="GDK_CONTROL_MASK"/>
-         </child>
 
          <child>
             <object class="GtkAction" id="next-chapter">
@@ -278,7 +275,6 @@
             <menuitem name="clear-playlist" action="clear-playlist"/>
          </menu>
          <menu name="view" action="view-menu">
-            <menuitem name="next-angle" action="next-angle"/>
             <separator/>
             <menu name="subtitles" action="subtitles-menu">
                <menuitem name="select-subtitle" action="select-subtitle"/>
diff --git a/src/totem-menu.c b/src/totem-menu.c
index ac791fb..28bc93f 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -45,7 +45,6 @@ G_MODULE_EXPORT void eject_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void properties_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void play_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void quit_action_callback (GtkAction *action, Totem *totem);
-G_MODULE_EXPORT void next_angle_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 volume_up_action_callback (GtkAction *action, Totem *totem);
@@ -220,6 +219,14 @@ dvd_chapter_menu_action_cb (GSimpleAction *action,
         bacon_video_widget_dvd_event (TOTEM_OBJECT (user_data)->bvw, BVW_DVD_CHAPTER_MENU);
 }
 
+static void
+next_angle_action_cb (GSimpleAction *action,
+                     GVariant      *parameter,
+                     gpointer       user_data)
+{
+        totem_object_action_next_angle (TOTEM_OBJECT (user_data));
+}
+
 static GActionEntry app_entries[] = {
        { "open", open_action_cb, NULL, NULL, NULL },
        { "open-location", open_location_action_cb, NULL, NULL, NULL },
@@ -231,6 +238,7 @@ static GActionEntry app_entries[] = {
        { "dvd-chapter-menu", dvd_chapter_menu_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 },
        { "preferences", preferences_action_cb, NULL, NULL, NULL },
        { "shuffle", toggle_action_cb, NULL, "false", shuffle_change_state },
        { "repeat", toggle_action_cb, NULL, "false", repeat_change_state },
@@ -248,6 +256,8 @@ totem_app_menu_setup (Totem *totem)
        appmenu = (GMenuModel *)gtk_builder_get_object (totem->xml, "appmenu");
        gtk_application_set_app_menu (GTK_APPLICATION (totem), appmenu);
 
+       gtk_application_add_accelerator (GTK_APPLICATION (totem), "<Primary>G", "app.next-angle", NULL);
+
        gtk_window_set_application (GTK_WINDOW (totem->win), GTK_APPLICATION (totem));
 }
 
@@ -553,12 +563,6 @@ select_subtitle_action_callback (GtkAction *action, Totem *totem)
 }
 
 void
-next_angle_action_callback (GtkAction *action, Totem *totem)
-{
-       totem_object_action_next_angle (totem);
-}
-
-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 8d8f783..0cb518b 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3633,8 +3633,8 @@ update_media_menu_items (TotemObject *totem)
        totem_action_set_sensitivity2 ("dvd-angle-menu", playing);
        totem_action_set_sensitivity2 ("dvd-chapter-menu", playing);
 
-       totem_action_set_sensitivity ("next-angle",
-                                     bacon_video_widget_has_angles (totem->bvw));
+       totem_action_set_sensitivity2 ("next-angle",
+                                      bacon_video_widget_has_angles (totem->bvw));
 
        mount = totem_get_mount_for_media (totem->mrl);
        totem_action_set_sensitivity ("eject", mount != NULL);


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