[gnome-software] Rename the about menu item to "About Software"



commit cb995df3200da92aada93e49c8c80a56c34a8537
Author: Kalev Lember <klember redhat com>
Date:   Thu Oct 4 14:33:26 2018 +0200

    Rename the about menu item to "About Software"
    
    Fixes: https://gitlab.gnome.org/GNOME/gnome-software/issues/485

 src/gnome-software.ui |  6 ------
 src/gs-shell.c        | 21 +++++++++++++++++++++
 2 files changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index 2ad3563a..23c9693c 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -43,12 +43,6 @@
         <attribute name="action">app.prefs</attribute>
       </item>
     </section>
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">_About</attribute>
-        <attribute name="action">app.about</attribute>
-      </item>
-    </section>
   </menu>
   <object class="GtkApplicationWindow" id="window_software">
     <property name="can_focus">False</property>
diff --git a/src/gs-shell.c b/src/gs-shell.c
index bab903f9..475f8efe 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -1930,6 +1930,24 @@ gs_shell_setup_pages (GsShell *shell)
        }
 }
 
+static void
+gs_shell_add_about_menu_item (GsShell *shell)
+{
+       GsShellPrivate *priv = gs_shell_get_instance_private (shell);
+       GMenu *primary_menu;
+       g_autoptr(GMenuItem) menu_item = NULL;
+       g_autofree gchar *label = NULL;
+
+       primary_menu = G_MENU (gtk_builder_get_object (priv->builder, "primary_menu"));
+
+       /* TRANSLATORS: this is the menu item that opens the about window, e.g.
+        * 'About Software' or 'About Application Installer' where the %s is
+        * the application name chosen by the distro */
+       label = g_strdup_printf (_("About %s"), g_get_application_name ());
+       menu_item = g_menu_item_new (label, "app.about");
+       g_menu_append_item (primary_menu, menu_item);
+}
+
 void
 gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *cancellable)
 {
@@ -2081,6 +2099,9 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
        /* coldplug */
        gs_shell_rescan_events (shell);
 
+       /* primary menu */
+       gs_shell_add_about_menu_item (shell);
+
        /* auth menu */
        priv->auth_actions = g_simple_action_group_new ();
        gtk_widget_insert_action_group (GTK_WIDGET (priv->main_window), "auth", G_ACTION_GROUP 
(priv->auth_actions));


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