Commit 439548b8 authored by Kalev Lember's avatar Kalev Lember Committed by Georges Basile Stavracas Neto
Browse files

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
parent eeb5594d
......@@ -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);
......
......@@ -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>
......@@ -102,6 +102,22 @@
<property name="bottom_attach">5</property>
</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>
......@@ -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>
......@@ -173,6 +189,21 @@
<property name="bottom_attach">5</property>
</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>
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment