[gnome-control-center/wip/hadess/wifi-freqs: 856/856] wifi: Show the frequency used by the Wi-Fi network
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/hadess/wifi-freqs: 856/856] wifi: Show the frequency used by the Wi-Fi network
- Date: Mon, 11 Nov 2019 03:33:52 +0000 (UTC)
commit b26ad90b72b877f9dc757406493179571edcf216
Author: Bastien Nocera <hadess hadess net>
Date: Fri Aug 10 16:05:09 2018 +0200
wifi: Show the frequency used by the Wi-Fi network
https://bugzilla.gnome.org/show_bug.cgi?id=722550
panels/network/connection-editor/ce-page-details.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-details.c
b/panels/network/connection-editor/ce-page-details.c
index 31252716d..3c7fbd51b 100644
--- a/panels/network/connection-editor/ce-page-details.c
+++ b/panels/network/connection-editor/ce-page-details.c
@@ -215,6 +215,7 @@ connect_details_page (CEPageDetails *self)
NMSettingConnection *sc;
guint speed;
NMDeviceWifiCapabilities wifi_caps;
+ guint frequency;
guint strength;
NMDeviceState state;
NMAccessPoint *active_ap;
@@ -231,10 +232,13 @@ connect_details_page (CEPageDetails *self)
sc = nm_connection_get_setting_connection (self->connection);
type = nm_setting_connection_get_connection_type (sc);
- if (NM_IS_DEVICE_WIFI (self->device))
+ if (NM_IS_DEVICE_WIFI (self->device)) {
active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (self->device));
- else
+ frequency = nm_access_point_get_frequency (active_ap);
+ } else {
active_ap = NULL;
+ frequency = 0;
+ }
state = self->device ? nm_device_get_state (self->device) : NM_DEVICE_STATE_DISCONNECTED;
@@ -263,7 +267,10 @@ connect_details_page (CEPageDetails *self)
speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (self->device));
}
}
- if (speed > 0)
+
+ if (speed > 0 && frequency > 0)
+ speed_label = g_strdup_printf (_("%d Mb/s (%1.1f GHz)"), speed, (float) (frequency) /
1000.0);
+ else if (speed > 0)
speed_label = g_strdup_printf (_("%d Mb/s"), speed);
gtk_label_set_label (self->speed_label, speed_label);
gtk_widget_set_visible (GTK_WIDGET (self->speed_heading_label), speed_label != NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]