[gnome-software/1554-more-informative-os-updates-row] updates: More informative 'OS Updates' row



commit 61578e2006bd192e6985365f7253a279aefc3fa3
Author: Milan Crha <mcrha redhat com>
Date:   Mon Dec 6 15:36:35 2021 +0100

    updates: More informative 'OS Updates' row
    
    This covers three changes:
    * rename the "OS Updates" to the "System Updates"
    * change the summary of the update
    * show the summary in the app row of the Updates page
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1554

 plugins/core/gs-plugin-generic-updates.c |  6 +++---
 plugins/dummy/gs-self-test.c             |  4 ++--
 src/gs-app-row.c                         |  9 +++++++++
 src/gs-app-row.ui                        | 18 ++++++++++++++++++
 src/gs-common.c                          |  2 +-
 5 files changed, 33 insertions(+), 6 deletions(-)
---
diff --git a/plugins/core/gs-plugin-generic-updates.c b/plugins/core/gs-plugin-generic-updates.c
index c92130590..bef94d77c 100644
--- a/plugins/core/gs-plugin-generic-updates.c
+++ b/plugins/core/gs-plugin-generic-updates.c
@@ -64,12 +64,12 @@ gs_plugin_generic_updates_get_os_update (GsPlugin *plugin)
                         GS_APP_QUALITY_NORMAL,
                         /* TRANSLATORS: this is a group of updates that are not
                          * packages and are not shown in the main list */
-                        _("OS Updates"));
+                        _("System Updates"));
        gs_app_set_summary (app,
                            GS_APP_QUALITY_NORMAL,
                            /* TRANSLATORS: this is a longer description of the
-                            * "OS Updates" string */
-                           _("Includes performance, stability and security improvements."));
+                            * "System Updates" string */
+                           _("General system updates, such as security or bug fixes, and performance 
improvements."));
        gs_app_set_description (app,
                                GS_APP_QUALITY_NORMAL,
                                gs_app_get_summary (app));
diff --git a/plugins/dummy/gs-self-test.c b/plugins/dummy/gs-self-test.c
index cda6bc445..509622427 100644
--- a/plugins/dummy/gs-self-test.c
+++ b/plugins/dummy/gs-self-test.c
@@ -285,8 +285,8 @@ gs_plugins_dummy_updates_func (GsPluginLoader *plugin_loader)
        /* get the virtual non-apps OS update */
        app = gs_app_list_index (list, 2);
        g_assert_cmpstr (gs_app_get_id (app), ==, "org.gnome.Software.OsUpdate");
-       g_assert_cmpstr (gs_app_get_name (app), ==, "OS Updates");
-       g_assert_cmpstr (gs_app_get_summary (app), ==, "Includes performance, stability and security 
improvements.");
+       g_assert_cmpstr (gs_app_get_name (app), ==, "System Updates");
+       g_assert_cmpstr (gs_app_get_summary (app), ==, "General system updates, such as security or bug 
fixes, and performance improvements.");
        g_assert_cmpint (gs_app_get_kind (app), ==, AS_COMPONENT_KIND_GENERIC);
        g_assert_cmpint (gs_app_get_special_kind (app), ==, GS_APP_SPECIAL_KIND_OS_UPDATE);
        g_assert_cmpint (gs_app_get_state (app), ==, GS_APP_STATE_UPDATABLE);
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 03abfdd7a..b35432557 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -28,6 +28,7 @@ typedef struct
        GtkWidget       *version_current_label;
        GtkWidget       *version_arrow_label;
        GtkWidget       *version_update_label;
+       GtkWidget       *system_updates_label; /* Only for "System Updates" app */
        GtkWidget       *star;
        GtkWidget       *description_box;
        GtkWidget       *description_label;
@@ -415,6 +416,13 @@ gs_app_row_actually_refresh (GsAppRow *app_row)
                }
        }
 
+       if (priv->show_update && gs_app_get_special_kind (priv->app) == GS_APP_SPECIAL_KIND_OS_UPDATE) {
+               gtk_label_set_label (GTK_LABEL (priv->system_updates_label), gs_app_get_summary (priv->app));
+               gtk_widget_show (priv->system_updates_label);
+       } else {
+               gtk_widget_hide (priv->system_updates_label);
+       }
+
        /* pixbuf */
        icon = gs_app_get_icon_for_size (priv->app,
                                         gtk_image_get_pixel_size (GTK_IMAGE (priv->image)),
@@ -816,6 +824,7 @@ gs_app_row_class_init (GsAppRowClass *klass)
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, version_current_label);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, version_arrow_label);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, version_update_label);
+       gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, system_updates_label);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, star);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, description_box);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, description_label);
diff --git a/src/gs-app-row.ui b/src/gs-app-row.ui
index fba8c1113..cdf6b366e 100644
--- a/src/gs-app-row.ui
+++ b/src/gs-app-row.ui
@@ -68,6 +68,24 @@
                 </child>
               </object>
             </child>
+            <child>
+              <object class="GtkBox" id="system_updates_box">
+                <property name="orientation">horizontal</property>
+                <property name="spacing">4</property>
+                <property name="visible" bind-source="system_updates_label" bind-property="visible" 
bind-flags="sync-create"/>
+                <child>
+                  <object class="GtkLabel" id="system_updates_label">
+                    <property name="visible">False</property>
+                    <property name="xalign">0.0</property>
+                    <property name="yalign">0.5</property>
+                    <property name="wrap">True</property>
+                    <property name="wrap-mode">word-char</property>
+                    <property name="ellipsize">end</property>
+                    <property name="lines">2</property>
+                  </object>
+                </child>
+              </object>
+            </child>
            <child>
              <object class="GtkLabel" id="label_app_size">
                 <property name="halign">start</property>
diff --git a/src/gs-common.c b/src/gs-common.c
index 8ef7d5932..af56c4428 100644
--- a/src/gs-common.c
+++ b/src/gs-common.c
@@ -143,7 +143,7 @@ gs_app_notify_installed (GsApp *app)
                    gs_app_get_special_kind (app) == GS_APP_SPECIAL_KIND_OS_UPDATE) {
                        /* TRANSLATORS: this is the summary of a notification that OS updates
                        * have been successfully installed */
-                       summary = g_strdup (_("OS updates are now installed"));
+                       summary = g_strdup (_("System updates are now installed"));
                        /* TRANSLATORS: this is the body of a notification that OS updates
                        * have been successfully installed */
                        body = _("Recently installed updates are available to review");


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