[gnome-control-center: 10/14] network: Show the wireless speed as a seporate line in the details
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center: 10/14] network: Show the wireless speed as a seporate line in the details
- Date: Fri, 27 Jul 2012 15:23:35 +0000 (UTC)
commit 9a10722da21096501a45af13e6191971465bf799
Author: Richard Hughes <richard hughsie com>
Date: Thu Jul 26 15:41:25 2012 +0100
network: Show the wireless speed as a seporate line in the details
...to match the mockup.
panels/network/net-device-wifi.c | 19 +++++++++----------
panels/network/network-wifi.ui | 34 +++++++++++++++++++++++++++++-----
2 files changed, 38 insertions(+), 15 deletions(-)
---
diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c
index 1c7e7d1..7e51f38 100644
--- a/panels/network/net-device-wifi.c
+++ b/panels/network/net-device-wifi.c
@@ -638,7 +638,6 @@ nm_device_wifi_refresh_ui (NetDeviceWifi *device_wifi)
gchar *hotspot_security;
gchar *hotspot_ssid;
gchar *str_tmp;
- GString *string;
GtkWidget *sw;
GtkWidget *widget;
gint strength = 0;
@@ -681,18 +680,19 @@ nm_device_wifi_refresh_ui (NetDeviceWifi *device_wifi)
widget = GTK_WIDGET (gtk_builder_get_object (device_wifi->priv->builder, wid_name));
g_free (wid_name);
if (is_hotspot) {
- string = g_string_new (_("Hotspot"));
+ gtk_label_set_label (GTK_LABEL (widget), _("Hotspot"));
} else {
- string = g_string_new (panel_device_state_to_localized_string (nm_device));
+ gtk_label_set_label (GTK_LABEL (widget),
+ panel_device_state_to_localized_string (nm_device));
}
- if (speed > 0) {
- g_string_append (string, " - ");
- /* Translators: network device speed */
- g_string_append_printf (string, _("%d Mb/s"), speed);
- }
- gtk_label_set_label (GTK_LABEL (widget), string->str);
gtk_widget_set_tooltip_text (widget, panel_device_state_reason_to_localized_string (nm_device));
+ /* Translators: network device speed */
+ str_tmp = g_strdup_printf (_("%d Mb/s"), speed);
+ panel_set_device_widget_details (device_wifi->priv->builder,
+ "speed",
+ str_tmp);
+
/* The options button is always enabled for wired connections,
* and is sensitive for other connection types if the device
* is currently connected */
@@ -707,7 +707,6 @@ nm_device_wifi_refresh_ui (NetDeviceWifi *device_wifi)
break;
}
}
- g_string_free (string, TRUE);
/* sort out hotspot ui */
is_hotspot = device_is_hotspot (device_wifi);
diff --git a/panels/network/network-wifi.ui b/panels/network/network-wifi.ui
index 619e955..4168ea2 100644
--- a/panels/network/network-wifi.ui
+++ b/panels/network/network-wifi.ui
@@ -562,13 +562,37 @@
</packing>
</child>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
+ <object class="GtkLabel" id="heading_speed">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Link speed</property>
+ <property name="mnemonic_widget">label_speed</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkLabel" id="label_speed">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">1Mb/sec</property>
+ <property name="mnemonic_widget">label_security</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
</child>
</object>
<packing>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]