From 12c6bf272242bff469627013ed1e566429b6a571 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Sun, 31 Mar 2013 20:28:19 -0400
Subject: [PATCH] info: Switch around GNOME and distro information
This makes the distribution logo prominent, and puts GNOME version
information in the small print.
https://bugzilla.gnome.org/show_bug.cgi?id=695691
---
panels/info/cc-info-panel.c | 55 +++++++++++++++++---------------
panels/info/info.ui | 77 ++++++++++++++++++++++++++++++++-------------
2 files changed, 84 insertions(+), 48 deletions(-)
diff --git a/panels/info/cc-info-panel.c b/panels/info/cc-info-panel.c
index 79729dd..bc3789f 100644
--- a/panels/info/cc-info-panel.c
+++ b/panels/info/cc-info-panel.c
@@ -455,42 +455,23 @@ static char *
get_os_type (void)
{
GHashTable *os_info;
- gchar *name, *result, *build_id;
- int bits;
+ gchar *name, *result, *version;
os_info = get_os_info ();
if (!os_info)
return NULL;
- name = g_hash_table_lookup (os_info, "PRETTY_NAME");
- build_id = g_hash_table_lookup (os_info, "BUILD_ID");
+ name = g_hash_table_lookup (os_info, "NAME");
+ version = g_hash_table_lookup (os_info, "VERSION_ID");
- if (GLIB_SIZEOF_VOID_P == 8)
- bits = 64;
- else
- bits = 32;
-
- if (build_id)
+ if (name && version)
{
- /* 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)" */
- if (name)
- result = g_strdup_printf (_("%s %d-bit (Build ID: %s)"), name, bits, build_id);
- else
- result = g_strdup_printf (_("%d-bit (Build ID: %s)"), bits, build_id);
+ result = g_strconcat (name, " ", version, NULL);
}
- else
+ else if (name)
{
- /* 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" */
- if (name)
- result = g_strdup_printf (_("%s %d-bit"), name, bits);
- else
- result = g_strdup_printf (_("%d-bit"), bits);
+ result = g_strdup (name);
}
g_clear_pointer (&os_info, g_hash_table_destroy);
@@ -498,6 +479,23 @@ get_os_type (void)
return result;
}
+static char *
+get_os_description (void)
+{
+ int bits;
+ gchar *result;
+
+ if (GLIB_SIZEOF_VOID_P == 8)
+ bits = 64;
+ else
+ bits = 32;
+
+ /* translators: This is the the type of OS architecture, eg: "64-bit" or "32-bit" */
+ result = g_strdup_printf (_("%d-bit"), bits);
+
+ return result;
+}
+
static void
query_done (GFile *file,
GAsyncResult *res,
@@ -1519,6 +1517,11 @@ info_panel_setup_overview (CcInfoPanel *self)
gtk_label_set_text (GTK_LABEL (widget), text ? text : "");
g_free (text);
+ widget = WID ("os_description_label");
+ text = get_os_description ();
+ gtk_label_set_text (GTK_LABEL (widget), text ? text : "");
+ g_free (text);
+
get_primary_disc_info (self);
widget = WID ("graphics_label");
diff --git a/panels/info/info.ui b/panels/info/info.ui
index 1967fdf..0bdfc1a 100644
--- a/panels/info/info.ui
+++ b/panels/info/info.ui
@@ -199,13 +199,14 @@
<object class="GtkBox" id="vbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">18</property>
+ <property name="spacing">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkImage" id="system_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="resource">/org/gnome/control-center/info/GnomeLogoVerticalMedium.svg</property>
+ <property name="pixel_size">128</property>
+ <property name="icon_name">fedora-logo-icon</property>
</object>
<packing>
<property name="expand">False</property>
@@ -214,11 +215,12 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="version_label">
+ <object class="GtkLabel" id="os_type_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">Version 3.0</property>
<property name="selectable">True</property>
+ <property name="margin-bottom">24</property>
<attributes>
<attribute name="scale" value="1.25"/>
</attributes>
@@ -282,19 +284,35 @@
</packing>
</child>
<child>
+ <object class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">OS Type</property>
+ <property name="mnemonic_widget">os_description_label</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="label7">
<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">GNOME</property>
+ <property name="mnemonic_widget">version_label</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
</packing>
</child>
<child>
@@ -309,8 +327,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>
@@ -354,7 +372,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="os_type_label">
+ <object class="GtkLabel" id="os_description_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -364,8 +382,23 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="version_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>
@@ -379,8 +412,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>
@@ -462,8 +495,8 @@
</style>
</object>
<packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
</packing>
</child>
<child>
@@ -491,8 +524,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
</packing>
</child>
<child>
@@ -510,8 +543,8 @@
</style>
</object>
<packing>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
</packing>
</child>
<child>
@@ -525,8 +558,8 @@
<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>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
</packing>
</child>
</object>
--
2.9.3