[gnome-control-center] network: Set mnemonic labels for editable text fields for a11y
- From: Jeremy Bicha <jbicha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Set mnemonic labels for editable text fields for a11y
- Date: Tue, 12 Feb 2013 23:07:27 +0000 (UTC)
commit 7061457da45de76fb034ad8eac8eaa0bf90f3b09
Author: Jeremy Bicha <jbicha ubuntu com>
Date: Tue Feb 12 11:33:59 2013 -0500
network: Set mnemonic labels for editable text fields for a11y
https://bugzilla.gnome.org/show_bug.cgi?id=693657
panels/network/connection-editor/ce-page-ip4.c | 67 +++++++++++++++---------
panels/network/connection-editor/ce-page-ip6.c | 67 +++++++++++++++---------
2 files changed, 84 insertions(+), 50 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-ip4.c b/panels/network/connection-editor/ce-page-ip4.c
index b342bdf..7f10022 100644
--- a/panels/network/connection-editor/ce-page-ip4.c
+++ b/panels/network/connection-editor/ce-page-ip4.c
@@ -173,20 +173,16 @@ add_address_row (CEPageIP4 *page,
{
GtkWidget *row;
GtkWidget *widget;
+ GtkWidget *label;
GtkWidget *delete_button;
GtkWidget *image;
row = gtk_grid_new ();
- widget = gtk_label_new (_("Address"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 1, 1, 1);
- widget = gtk_label_new (_("Netmask"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 2, 1, 1);
- widget = gtk_label_new (_("Gateway"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 3, 1, 1);
+ label = gtk_label_new (_("Address"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 1, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "address", widget);
gtk_entry_set_text (GTK_ENTRY (widget), address);
@@ -194,7 +190,12 @@ add_address_row (CEPageIP4 *page,
gtk_widget_set_margin_right (widget, 10);
gtk_widget_set_hexpand (widget, TRUE);
gtk_grid_attach (GTK_GRID (row), widget, 2, 1, 1, 1);
+
+ label = gtk_label_new (_("Netmask"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 2, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "network", widget);
gtk_entry_set_text (GTK_ENTRY (widget), network);
@@ -202,7 +203,13 @@ add_address_row (CEPageIP4 *page,
gtk_widget_set_margin_right (widget, 10);
gtk_widget_set_hexpand (widget, TRUE);
gtk_grid_attach (GTK_GRID (row), widget, 2, 2, 1, 1);
+
+
+ label = gtk_label_new (_("Gateway"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 3, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "gateway", widget);
gtk_entry_set_text (GTK_ENTRY (widget), gateway);
@@ -324,15 +331,17 @@ add_dns_row (CEPageIP4 *page,
const gchar *address)
{
GtkWidget *row;
+ GtkWidget *label;
GtkWidget *widget;
GtkWidget *delete_button;
GtkWidget *image;
row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- widget = gtk_label_new (_("Server"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_box_pack_start (GTK_BOX (row), widget, FALSE, FALSE, 0);
+ label = gtk_label_new (_("Server"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_box_pack_start (GTK_BOX (row), label, FALSE, FALSE, 0);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "address", widget);
gtk_entry_set_text (GTK_ENTRY (widget), address);
@@ -411,25 +420,17 @@ add_route_row (CEPageIP4 *page,
gint metric)
{
GtkWidget *row;
+ GtkWidget *label;
GtkWidget *widget;
GtkWidget *delete_button;
GtkWidget *image;
row = gtk_grid_new ();
- widget = gtk_label_new (_("Address"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 1, 1, 1);
- widget = gtk_label_new (_("Netmask"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 2, 1, 1);
- widget = gtk_label_new (_("Gateway"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 3, 1, 1);
- /* Translators: Please see http://en.wikipedia.org/wiki/Metrics_(networking) */
- widget = gtk_label_new (C_("network parameters", "Metric"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 4, 1, 1);
+ label = gtk_label_new (_("Address"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 1, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "address", widget);
gtk_entry_set_text (GTK_ENTRY (widget), address);
@@ -437,7 +438,12 @@ add_route_row (CEPageIP4 *page,
gtk_widget_set_margin_right (widget, 10);
gtk_widget_set_hexpand (widget, TRUE);
gtk_grid_attach (GTK_GRID (row), widget, 2, 1, 1, 1);
+
+ label = gtk_label_new (_("Netmask"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 2, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "netmask", widget);
gtk_entry_set_text (GTK_ENTRY (widget), netmask);
@@ -445,7 +451,12 @@ add_route_row (CEPageIP4 *page,
gtk_widget_set_margin_right (widget, 10);
gtk_widget_set_hexpand (widget, TRUE);
gtk_grid_attach (GTK_GRID (row), widget, 2, 2, 1, 1);
+
+ label = gtk_label_new (_("Gateway"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 3, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "gateway", widget);
gtk_entry_set_text (GTK_ENTRY (widget), gateway);
@@ -453,7 +464,13 @@ add_route_row (CEPageIP4 *page,
gtk_widget_set_margin_right (widget, 10);
gtk_widget_set_hexpand (widget, TRUE);
gtk_grid_attach (GTK_GRID (row), widget, 2, 3, 1, 1);
+
+ /* Translators: Please see https://en.wikipedia.org/wiki/Metrics_(networking) */
+ label = gtk_label_new (C_("network parameters", "Metric"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 4, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "metric", widget);
if (metric > 0) {
diff --git a/panels/network/connection-editor/ce-page-ip6.c b/panels/network/connection-editor/ce-page-ip6.c
index ffb0b99..1958c90 100644
--- a/panels/network/connection-editor/ce-page-ip6.c
+++ b/panels/network/connection-editor/ce-page-ip6.c
@@ -174,21 +174,17 @@ add_address_row (CEPageIP6 *page,
const gchar *gateway)
{
GtkWidget *row;
+ GtkWidget *label;
GtkWidget *widget;
GtkWidget *delete_button;
GtkWidget *image;
row = gtk_grid_new ();
- widget = gtk_label_new (_("Address"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 1, 1, 1);
- widget = gtk_label_new (_("Prefix"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 2, 1, 1);
- widget = gtk_label_new (_("Gateway"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 3, 1, 1);
+ label = gtk_label_new (_("Address"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 1, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "address", widget);
gtk_entry_set_text (GTK_ENTRY (widget), address);
@@ -196,7 +192,12 @@ add_address_row (CEPageIP6 *page,
gtk_widget_set_margin_right (widget, 10);
gtk_widget_set_hexpand (widget, TRUE);
gtk_grid_attach (GTK_GRID (row), widget, 2, 1, 1, 1);
+
+ label = gtk_label_new (_("Prefix"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 2, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "prefix", widget);
gtk_entry_set_text (GTK_ENTRY (widget), network);
@@ -204,7 +205,12 @@ add_address_row (CEPageIP6 *page,
gtk_widget_set_margin_right (widget, 10);
gtk_widget_set_hexpand (widget, TRUE);
gtk_grid_attach (GTK_GRID (row), widget, 2, 2, 1, 1);
+
+ label = gtk_label_new (_("Gateway"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 3, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "gateway", widget);
gtk_entry_set_text (GTK_ENTRY (widget), gateway);
@@ -328,15 +334,18 @@ add_dns_row (CEPageIP6 *page,
const gchar *address)
{
GtkWidget *row;
+ GtkWidget *label;
GtkWidget *widget;
GtkWidget *delete_button;
GtkWidget *image;
row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- widget = gtk_label_new (_("Server"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_box_pack_start (GTK_BOX (row), widget, FALSE, FALSE, 0);
+ gtk_widget_set_can_focus (row, FALSE);
+ label = gtk_label_new (_("Server"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_box_pack_start (GTK_BOX (row), label, FALSE, FALSE, 0);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "address", widget);
gtk_entry_set_text (GTK_ENTRY (widget), address);
@@ -415,25 +424,17 @@ add_route_row (CEPageIP6 *page,
gint metric)
{
GtkWidget *row;
+ GtkWidget *label;
GtkWidget *widget;
GtkWidget *delete_button;
GtkWidget *image;
row = gtk_grid_new ();
- widget = gtk_label_new (_("Address"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 1, 1, 1);
- widget = gtk_label_new (_("Prefix"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 2, 1, 1);
- widget = gtk_label_new (_("Gateway"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 3, 1, 1);
- /* Translators: Please see http://en.wikipedia.org/wiki/Metrics_(networking) */
- widget = gtk_label_new (C_("network parameters", "Metric"));
- gtk_misc_set_alignment (GTK_MISC (widget), 1, 0.5);
- gtk_grid_attach (GTK_GRID (row), widget, 1, 4, 1, 1);
+ label = gtk_label_new (_("Address"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 1, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "address", widget);
gtk_entry_set_text (GTK_ENTRY (widget), address);
@@ -441,7 +442,12 @@ add_route_row (CEPageIP6 *page,
gtk_widget_set_margin_right (widget, 10);
gtk_widget_set_hexpand (widget, TRUE);
gtk_grid_attach (GTK_GRID (row), widget, 2, 1, 1, 1);
+
+ label = gtk_label_new (_("Prefix"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 2, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "prefix", widget);
if (prefix > 0) {
@@ -453,7 +459,12 @@ add_route_row (CEPageIP6 *page,
gtk_widget_set_margin_right (widget, 10);
gtk_widget_set_hexpand (widget, TRUE);
gtk_grid_attach (GTK_GRID (row), widget, 2, 2, 1, 1);
+
+ label = gtk_label_new (_("Gateway"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 3, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "gateway", widget);
gtk_entry_set_text (GTK_ENTRY (widget), gateway);
@@ -461,7 +472,13 @@ add_route_row (CEPageIP6 *page,
gtk_widget_set_margin_right (widget, 10);
gtk_widget_set_hexpand (widget, TRUE);
gtk_grid_attach (GTK_GRID (row), widget, 2, 3, 1, 1);
+
+ /* Translators: Please see https://en.wikipedia.org/wiki/Metrics_(networking) */
+ label = gtk_label_new (C_("network parameters", "Metric"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_grid_attach (GTK_GRID (row), label, 1, 4, 1, 1);
widget = gtk_entry_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
g_signal_connect_swapped (widget, "changed", G_CALLBACK (ce_page_changed), page);
g_object_set_data (G_OBJECT (row), "metric", widget);
if (metric > 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]