summaryrefslogtreecommitdiff
path: root/panels/info/cc-info-overview-panel.c
diff options
context:
space:
mode:
authorKalev Lember <klember@redhat.com>2016-08-30 13:47:45 +0200
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2017-05-01 12:43:15 -0300
commit439548b89f984538559230864d84b7edeafdbafb (patch)
tree233682a4c06903dfee57f151b585253561492fc3 /panels/info/cc-info-overview-panel.c
parenteeb5594d46886a97e441ae0d3cec2ee972feb776 (diff)
downloadgnome-control-center-439548b89f984538559230864d84b7edeafdbafb.tar.gz
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
Diffstat (limited to 'panels/info/cc-info-overview-panel.c')
-rw-r--r--panels/info/cc-info-overview-panel.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/panels/info/cc-info-overview-panel.c b/panels/info/cc-info-overview-panel.c
index 3c3d01a5d..1adc2aa5d 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);