[totem] main: Move Eject to the cogwheel menu



commit 87d077f6d8436c660ef15023b69af86d929d2cf7
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 10 18:21:57 2013 +0200

    main: Move Eject to the cogwheel menu

 data/totem.ui      |   26 +++++++-------------------
 src/totem-menu.c   |   17 ++++++++++-------
 src/totem-object.c |    2 +-
 3 files changed, 18 insertions(+), 27 deletions(-)
---
diff --git a/data/totem.ui b/data/totem.ui
index 2e95c2f..78b39df 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -113,6 +113,13 @@
                        <attribute name="accel">&lt;Ctrl&gt;P</attribute>
                </item>
        </section>
+       <section>
+               <item>
+                       <attribute name="label" translatable="yes">_Eject</attribute>
+                       <attribute name="action">app.eject</attribute>
+                       <attribute name="accel">&lt;Ctrl&gt;E</attribute>
+               </item>
+       </section>
 </menu>
 
 <menu id="gomenu">
@@ -148,20 +155,6 @@
    <child>
       <object class="GtkActionGroup" id="main-action-group">
          <child>
-            <object class="GtkAction" id="movie-menu">
-               <property name="label" translatable="yes">_Movie</property>
-            </object>
-         </child>
-         <child>
-            <object class="GtkAction" id="eject">
-               <property name="label" translatable="yes">_Eject</property>
-               <property name="icon-name">media-eject-symbolic</property>
-               <property name="tooltip" translatable="yes">Eject the current disc</property>
-               <signal name="activate" handler="eject_action_callback"/>
-            </object>
-            <accelerator key="E" modifiers="GDK_CONTROL_MASK"/>
-         </child>
-         <child>
             <object class="GtkAction" id="play">
                <property name="label" translatable="yes">Play / P_ause</property>
                <property name="icon-name">media-playback-start-symbolic</property>
@@ -252,11 +245,6 @@
    </child>
    <ui>
       <menubar name="tmw-menubar">
-         <menu name="movie" action="movie-menu">
-            <placeholder name="recent-placeholder"/>
-            <separator/>
-            <menuitem name="eject" action="eject"/>
-         </menu>
          <menu name="edit" action="edit-menu">
             <menuitem name="clear-playlist" action="clear-playlist"/>
          </menu>
diff --git a/src/totem-menu.c b/src/totem-menu.c
index 224baa9..58933cc 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -41,7 +41,6 @@
 #define TOTEM_MAX_RECENT_ITEM_LEN 40
 
 /* Callback functions for GtkBuilder */
-G_MODULE_EXPORT void eject_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_chapter_action_callback (GtkAction *action, Totem *totem);
@@ -234,6 +233,14 @@ properties_action_cb (GSimpleAction *action,
         totem_action_show_properties (TOTEM_OBJECT (user_data));
 }
 
+static void
+eject_action_cb (GSimpleAction *action,
+                GVariant      *parameter,
+                gpointer       user_data)
+{
+       totem_action_eject (TOTEM_OBJECT (user_data));
+}
+
 static GActionEntry app_entries[] = {
        /* Main app menu */
        { "open", open_action_cb, NULL, NULL, NULL },
@@ -257,6 +264,7 @@ static GActionEntry app_entries[] = {
        { "zoom", toggle_action_cb, NULL, "false", zoom_action_change_state },
        { "next-angle", next_angle_action_cb, NULL, NULL, NULL },
        { "properties", properties_action_cb, NULL, NULL, NULL },
+       { "eject", eject_action_cb, NULL, NULL, NULL },
 };
 
 void
@@ -273,6 +281,7 @@ totem_app_menu_setup (Totem *totem)
        gtk_application_add_accelerator (GTK_APPLICATION (totem), "<Primary>G", "app.next-angle", NULL);
        gtk_application_add_accelerator (GTK_APPLICATION (totem), "<Primary>M", "app.next-angle", NULL);
        gtk_application_add_accelerator (GTK_APPLICATION (totem), "<Primary>P", "app.properties", NULL);
+       gtk_application_add_accelerator (GTK_APPLICATION (totem), "<Primary>E", "app.eject", NULL);
 
        gtk_window_set_application (GTK_WINDOW (totem->win), GTK_APPLICATION (totem));
 }
@@ -548,12 +557,6 @@ totem_sublang_exit (Totem *totem)
 }
 
 void
-eject_action_callback (GtkAction *action, Totem *totem)
-{
-       totem_action_eject (totem);
-}
-
-void
 play_action_callback (GtkAction *action, Totem *totem)
 {
        totem_object_action_play_pause (totem);
diff --git a/src/totem-object.c b/src/totem-object.c
index 0cb518b..6e180a9 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3637,7 +3637,7 @@ update_media_menu_items (TotemObject *totem)
                                       bacon_video_widget_has_angles (totem->bvw));
 
        mount = totem_get_mount_for_media (totem->mrl);
-       totem_action_set_sensitivity ("eject", mount != NULL);
+       totem_action_set_sensitivity2 ("eject", mount != NULL);
        if (mount != NULL)
                g_object_unref (mount);
 }


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