[network-manager-applet/wimax] applet: show WiMAX CINR and BSID in connection information
- From: Dan Williams <dcbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/wimax] applet: show WiMAX CINR and BSID in connection information
- Date: Thu, 6 Jan 2011 21:17:56 +0000 (UTC)
commit 7ffb2c6f5bbc294360ca87552030917d5805dd99
Author: Dan Williams <dcbw redhat com>
Date: Thu Jan 6 15:16:32 2011 -0600
applet: show WiMAX CINR and BSID in connection information
src/applet-dialogs.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 57 insertions(+), 0 deletions(-)
---
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c
index 1d73f64..1344c4a 100644
--- a/src/applet-dialogs.c
+++ b/src/applet-dialogs.c
@@ -338,6 +338,33 @@ bitrate_changed_cb (GObject *device, GParamSpec *pspec, gpointer user_data)
}
static void
+wimax_cinr_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
+{
+ GtkWidget *label = GTK_WIDGET (user_data);
+ gint cinr;
+ char *str = NULL;
+
+ cinr = nm_device_wimax_get_cinr (NM_DEVICE_WIMAX (device));
+ if (cinr)
+ str = g_strdup_printf (_("%d dB"), cinr);
+
+ gtk_label_set_text (GTK_LABEL (label), str ? str : C_("WiMAX CINR", "unknown"));
+ g_free (str);
+}
+
+static void
+wimax_bsid_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
+{
+ GtkWidget *label = GTK_WIDGET (user_data);
+ const char *str = NULL;
+
+ str = nm_device_wimax_get_bsid (NM_DEVICE_WIMAX (device));
+ if (!str)
+ str = C_("WiMAX Base Station ID", "unknown");
+ gtk_label_set_text (GTK_LABEL (label), str);
+}
+
+static void
info_dialog_add_page (GtkNotebook *notebook,
NMConnection *connection,
gboolean is_default,
@@ -459,6 +486,36 @@ info_dialog_add_page (GtkNotebook *notebook,
}
}
+ if (NM_IS_DEVICE_WIMAX (device)) {
+ GtkWidget *bsid_label, *cinr_label;
+
+ /* CINR */
+ cinr_label = create_info_label ("", TRUE);
+ gtk_table_attach (table, create_info_label (_("CINR:"), FALSE),
+ 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+ gtk_table_attach (table, cinr_label,
+ 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+ label_info_new (device,
+ cinr_label,
+ "notify::" NM_DEVICE_WIMAX_CINR,
+ G_CALLBACK (wimax_cinr_changed_cb));
+ wimax_cinr_changed_cb (device, NULL, cinr_label);
+ row++;
+
+ /* Base Station ID */
+ bsid_label = create_info_label ("", TRUE);
+ gtk_table_attach (table, create_info_label (_("BSID:"), FALSE),
+ 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+ gtk_table_attach (table, bsid_label,
+ 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+ label_info_new (device,
+ bsid_label,
+ "notify::" NM_DEVICE_WIMAX_BSID,
+ G_CALLBACK (wimax_bsid_changed_cb));
+ wimax_bsid_changed_cb (device, NULL, bsid_label);
+ row++;
+ }
+
/* Empty line */
gtk_table_attach (table, gtk_label_new (""), 0, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
row++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]