[gnome-control-center] info: Split up "Base system" and "OS type" to separate lines



commit 439548b89f984538559230864d84b7edeafdbafb
Author: Kalev Lember <klember redhat com>
Date:   Tue Aug 30 13:47:45 2016 +0200

    info: Split up "Base system" and "OS type" to separate lines
    
    Having the OS name and architecture at the same place proved
    to be harder to understand than having the processor arch.
    
    Fix that by splitting the OS name and type labels in different
    rows.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770593

 panels/info/cc-info-overview-panel.c |   46 ++++++++++++++++++++------------
 panels/info/info-overview.ui         |   49 +++++++++++++++++++++++++++------
 2 files changed, 69 insertions(+), 26 deletions(-)
---
diff --git a/panels/info/cc-info-overview-panel.c b/panels/info/cc-info-overview-panel.c
index 3c3d01a..1adc2aa 100644
--- a/panels/info/cc-info-overview-panel.c
+++ b/panels/info/cc-info-overview-panel.c
@@ -60,6 +60,7 @@ typedef struct
   GtkWidget      *name_entry;
   GtkWidget      *memory_label;
   GtkWidget      *processor_label;
+  GtkWidget      *os_name_label;
   GtkWidget      *os_type_label;
   GtkWidget      *disk_label;
   GtkWidget      *graphics_label;
@@ -442,11 +443,11 @@ get_os_info (void)
 }
 
 static char *
-get_os_type (void)
+get_os_name (void)
 {
   GHashTable *os_info;
-  gchar *name, *version_id, *pretty_name, *result, *build_id;
-  int bits;
+  gchar *name, *version_id, *pretty_name, *build_id;
+  gchar *result = NULL;
   g_autofree gchar *name_version = NULL;
 
   os_info = get_os_info ();
@@ -466,25 +467,17 @@ get_os_type (void)
   else
     name_version = g_strdup (_("Unknown"));
 
-  if (GLIB_SIZEOF_VOID_P == 8)
-    bits = 64;
-  else
-    bits = 32;
-
   if (build_id)
     {
-      /* translators: This is the name of the OS, followed by the type
-       * of architecture and the build id, for example:
-       * "Fedora 18 (Spherical Cow) 64-bit (Build ID: xyz)" or
-       * "Ubuntu (Oneric Ocelot) 32-bit (Build ID: jki)" */
-      result = g_strdup_printf (_("%s %d-bit (Build ID: %s)"), name_version, bits, build_id);
+      /* translators: This is the name of the OS, followed by the build id, for
+       * example:
+       * "Fedora 25 (Workstation Edition) (Build ID: xyz)" or
+       * "Ubuntu 16.04 LTS (Build ID: jki)" */
+      result = g_strdup_printf (_("%s (Build ID: %s)"), name_version, build_id);
     }
   else
     {
-      /* translators: This is the name of the OS, followed by the type
-       * of architecture, for example:
-       * "Fedora 18 (Spherical Cow) 64-bit" or "Ubuntu (Oneric Ocelot) 32-bit" */
-      result = g_strdup_printf (_("%s %d-bit"), name_version, bits);
+      result = g_strdup (name_version);
     }
 
   g_clear_pointer (&os_info, g_hash_table_destroy);
@@ -492,6 +485,20 @@ get_os_type (void)
   return result;
 }
 
+static char *
+get_os_type (void)
+{
+  int bits;
+
+  if (GLIB_SIZEOF_VOID_P == 8)
+    bits = 64;
+  else
+    bits = 32;
+
+  /* translators: This is the type of architecture for the OS */
+  return g_strdup_printf (_("%d-bit"), bits);
+}
+
 static void
 query_done (GFile               *file,
             GAsyncResult        *res,
@@ -815,6 +822,10 @@ info_overview_panel_setup_overview (CcInfoOverviewPanel *self)
   gtk_label_set_text (GTK_LABEL (priv->os_type_label), text ? text : "");
   g_free (text);
 
+  text = get_os_name ();
+  gtk_label_set_text (GTK_LABEL (priv->os_name_label), text ? text : "");
+  g_free (text);
+
   get_primary_disc_info (self);
 
   gtk_label_set_markup (GTK_LABEL (priv->graphics_label), priv->graphics_data->hardware_string);
@@ -903,6 +914,7 @@ cc_info_overview_panel_class_init (CcInfoOverviewPanelClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, name_entry);
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, memory_label);
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, processor_label);
+  gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, os_name_label);
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, os_type_label);
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, disk_label);
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, graphics_label);
diff --git a/panels/info/info-overview.ui b/panels/info/info-overview.ui
index 4b67a69..e7f0d45 100644
--- a/panels/info/info-overview.ui
+++ b/panels/info/info-overview.ui
@@ -91,8 +91,8 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">1</property>
-            <property name="label" translatable="yes" comments="To translators: this field contains the 
distro name, version and type">Base system</property>
-            <property name="mnemonic_widget">os_type_label</property>
+            <property name="label" translatable="yes" comments="To translators: this field contains the 
distro name and version">Base system</property>
+            <property name="mnemonic_widget">os_name_label</property>
             <style>
              <class name="dim-label"/>
             </style>
@@ -103,6 +103,22 @@
           </packing>
         </child>
         <child>
+          <object class="GtkLabel" id="label17">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">1</property>
+            <property name="label" translatable="yes" comments="To translators: this field contains the 
distro type">OS type</property>
+            <property name="mnemonic_widget">os_type_label</property>
+            <style>
+              <class name="dim-label"/>
+            </style>
+          </object>
+          <packing>
+            <property name="top_attach">5</property>
+            <property name="bottom_attach">6</property>
+          </packing>
+        </child>
+        <child>
           <object class="GtkLabel" id="label8">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
@@ -114,8 +130,8 @@
             </style>
           </object>
           <packing>
-            <property name="top_attach">6</property>
-            <property name="bottom_attach">7</property>
+            <property name="top_attach">7</property>
+            <property name="bottom_attach">8</property>
           </packing>
         </child>
         <child>
@@ -159,7 +175,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="os_type_label">
+          <object class="GtkLabel" id="os_name_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">0</property>
@@ -174,6 +190,21 @@
           </packing>
         </child>
         <child>
+          <object class="GtkLabel" id="os_type_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label">Unknown</property>
+            <property name="selectable">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">5</property>
+            <property name="bottom_attach">6</property>
+          </packing>
+        </child>
+        <child>
           <object class="GtkLabel" id="disk_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
@@ -184,8 +215,8 @@
           <packing>
             <property name="left_attach">1</property>
             <property name="right_attach">2</property>
-            <property name="top_attach">6</property>
-            <property name="bottom_attach">7</property>
+            <property name="top_attach">7</property>
+            <property name="bottom_attach">8</property>
           </packing>
         </child>
         <child>
@@ -251,8 +282,8 @@
           <packing>
             <property name="left_attach">2</property>
             <property name="right_attach">3</property>
-            <property name="top_attach">5</property>
-            <property name="bottom_attach">6</property>
+            <property name="top_attach">6</property>
+            <property name="bottom_attach">7</property>
             <property name="x_options">GTK_FILL</property>
           </packing>
         </child>


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