[totem] main: Move help menu item to the app menu



commit 632b0857057761a9086759ea9ad761b17b9b103f
Author: Bastien Nocera <hadess hadess net>
Date:   Tue May 7 10:21:59 2013 +0200

    main: Move help menu item to the app menu

 data/totem.ui    |   25 +++++++------------------
 src/totem-menu.c |   16 +++++++++-------
 2 files changed, 16 insertions(+), 25 deletions(-)
---
diff --git a/data/totem.ui b/data/totem.ui
index 91d044e..ae9e031 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -42,6 +42,13 @@
        </section>
        <section>
                <item>
+                       <attribute name="label" translatable="yes">_Help</attribute>
+                       <attribute name="action">app.help</attribute>
+                       <attribute name="accel">F1</attribute>
+               </item>
+       </section>
+       <section>
+               <item>
                        <attribute name="label" translatable="yes">_Quit</attribute>
                        <attribute name="action">app.quit</attribute>
                        <attribute name="accel">&lt;Ctrl&gt;Q</attribute>
@@ -218,21 +225,6 @@
          </child>
 
          <child>
-            <object class="GtkAction" id="help-menu">
-               <property name="label" translatable="yes">_Help</property>
-            </object>
-         </child>
-         <child>
-            <object class="GtkAction" id="contents">
-               <property name="label" translatable="yes">_Contents</property>
-               <property name="stock-id">gtk-help</property>
-               <property name="tooltip" translatable="yes">Help contents</property>
-               <signal name="activate" handler="contents_action_callback"/>
-            </object>
-            <accelerator key="F1"/>
-         </child>
-
-         <child>
                <object class="GtkToggleAction" id="sidebar">
                <property name="label" translatable="yes">S_idebar</property>
                <property name="tooltip" translatable="yes">Show or hide the sidebar</property>
@@ -405,9 +397,6 @@
             <menuitem name="volume-up" action="volume-up"/>
             <menuitem name="volume-down" action="volume-down"/>
          </menu>
-         <menu name="help" action="help-menu">
-            <menuitem name="contents" action="contents"/>
-         </menu>
       </menubar>
       <popup name="totem-main-popup">
          <menuitem name="play" action="play"/>
diff --git a/src/totem-menu.c b/src/totem-menu.c
index 27590ec..4ae51c4 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -59,7 +59,6 @@ G_MODULE_EXPORT void skip_forward_action_callback (GtkAction *action, Totem *tot
 G_MODULE_EXPORT void skip_backwards_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void volume_up_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void volume_down_action_callback (GtkAction *action, Totem *totem);
-G_MODULE_EXPORT void contents_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void plugins_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void show_sidebar_action_callback (GtkToggleAction *action, Totem *totem);
 G_MODULE_EXPORT void aspect_ratio_changed_callback (GtkRadioAction *action, GtkRadioAction *current, Totem 
*totem);
@@ -142,6 +141,14 @@ toggle_action_cb (GSimpleAction *action,
 }
 
 static void
+help_action_cb (GSimpleAction *action,
+               GVariant      *parameter,
+               gpointer       user_data)
+{
+       totem_action_show_help (TOTEM_OBJECT (user_data));
+}
+
+static void
 quit_action_cb (GSimpleAction *action,
                GVariant      *parameter,
                gpointer       user_data)
@@ -156,6 +163,7 @@ static GActionEntry app_entries[] = {
        { "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 },
+       { "help", help_action_cb, NULL, NULL, NULL },
        { "quit", quit_action_cb, NULL, NULL, NULL },
 };
 
@@ -553,12 +561,6 @@ volume_down_action_callback (GtkAction *action, Totem *totem)
        totem_action_volume_relative (totem, VOLUME_DOWN_OFFSET);
 }
 
-void
-contents_action_callback (GtkAction *action, Totem *totem)
-{
-       totem_action_show_help (totem);
-}
-
 static gboolean
 totem_plugins_window_delete_cb (GtkWidget *window,
                                   GdkEventAny *event,


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