[gnome-control-center] network: Drop deprecated API usage
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Drop deprecated API usage
- Date: Fri, 5 Dec 2014 15:16:19 +0000 (UTC)
commit cd5316b7a7c063933faa0ec99c3ad9a72ef040ef
Author: Rui Matos <tiagomatos gmail com>
Date: Mon Dec 1 15:34:54 2014 +0100
network: Drop deprecated API usage
https://bugzilla.gnome.org/show_bug.cgi?id=740986
panels/network/connection-editor/ce-page-ip4.c | 16 ++++++++--------
panels/network/connection-editor/ce-page-ip6.c | 16 ++++++++--------
panels/network/connection-editor/ce-page-vpn.c | 6 +++---
.../connection-editor/net-connection-editor.c | 8 ++++----
panels/network/net-device-ethernet.c | 2 --
panels/network/net-device-simple.c | 4 ++--
panels/network/net-virtual-device.c | 4 ++--
7 files changed, 27 insertions(+), 29 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-ip4.c b/panels/network/connection-editor/ce-page-ip4.c
index 643a7f2..7972222 100644
--- a/panels/network/connection-editor/ce-page-ip4.c
+++ b/panels/network/connection-editor/ce-page-ip4.c
@@ -175,7 +175,7 @@ add_address_row (CEPageIP4 *page,
row_grid = gtk_grid_new ();
label = gtk_label_new (_("Address"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 1, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -188,7 +188,7 @@ add_address_row (CEPageIP4 *page,
gtk_grid_attach (GTK_GRID (row_grid), widget, 2, 1, 1, 1);
label = gtk_label_new (_("Netmask"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 2, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -202,7 +202,7 @@ add_address_row (CEPageIP4 *page,
label = gtk_label_new (_("Gateway"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 3, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -341,7 +341,7 @@ add_dns_row (CEPageIP4 *page,
row_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
label = gtk_label_new (_("Server"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_box_pack_start (GTK_BOX (row_box), label, FALSE, FALSE, 0);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -437,7 +437,7 @@ add_route_row (CEPageIP4 *page,
row_grid = gtk_grid_new ();
label = gtk_label_new (_("Address"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 1, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -450,7 +450,7 @@ add_route_row (CEPageIP4 *page,
gtk_grid_attach (GTK_GRID (row_grid), widget, 2, 1, 1, 1);
label = gtk_label_new (_("Netmask"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 2, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -463,7 +463,7 @@ add_route_row (CEPageIP4 *page,
gtk_grid_attach (GTK_GRID (row_grid), widget, 2, 2, 1, 1);
label = gtk_label_new (_("Gateway"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 3, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -477,7 +477,7 @@ add_route_row (CEPageIP4 *page,
/* 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_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 4, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
diff --git a/panels/network/connection-editor/ce-page-ip6.c b/panels/network/connection-editor/ce-page-ip6.c
index 077a5d5..5c07290 100644
--- a/panels/network/connection-editor/ce-page-ip6.c
+++ b/panels/network/connection-editor/ce-page-ip6.c
@@ -177,7 +177,7 @@ add_address_row (CEPageIP6 *page,
row_grid = gtk_grid_new ();
label = gtk_label_new (_("Address"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 1, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -190,7 +190,7 @@ add_address_row (CEPageIP6 *page,
gtk_grid_attach (GTK_GRID (row_grid), widget, 2, 1, 1, 1);
label = gtk_label_new (_("Prefix"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 2, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -203,7 +203,7 @@ add_address_row (CEPageIP6 *page,
gtk_grid_attach (GTK_GRID (row_grid), widget, 2, 2, 1, 1);
label = gtk_label_new (_("Gateway"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 3, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -345,7 +345,7 @@ add_dns_row (CEPageIP6 *page,
row_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
label = gtk_label_new (_("Server"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_box_pack_start (GTK_BOX (row_box), label, FALSE, FALSE, 0);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -441,7 +441,7 @@ add_route_row (CEPageIP6 *page,
row_grid = gtk_grid_new ();
label = gtk_label_new (_("Address"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 1, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -454,7 +454,7 @@ add_route_row (CEPageIP6 *page,
gtk_grid_attach (GTK_GRID (row_grid), widget, 2, 1, 1, 1);
label = gtk_label_new (_("Prefix"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 2, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -471,7 +471,7 @@ add_route_row (CEPageIP6 *page,
gtk_grid_attach (GTK_GRID (row_grid), widget, 2, 2, 1, 1);
label = gtk_label_new (_("Gateway"));
- gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 3, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -485,7 +485,7 @@ add_route_row (CEPageIP6 *page,
/* 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_widget_set_halign (label, GTK_ALIGN_END);
gtk_grid_attach (GTK_GRID (row_grid), label, 1, 4, 1, 1);
widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
diff --git a/panels/network/connection-editor/ce-page-vpn.c b/panels/network/connection-editor/ce-page-vpn.c
index 9b497ed..c77d753 100644
--- a/panels/network/connection-editor/ce-page-vpn.c
+++ b/panels/network/connection-editor/ce-page-vpn.c
@@ -69,11 +69,11 @@ vpn_gnome3ify_editor (GtkWidget *widget)
g_list_free (children);
} else if (GTK_IS_LABEL (widget)) {
const char *text;
- gfloat xalign, yalign;
+ gfloat xalign;
char *newtext;
int len;
- gtk_misc_get_alignment (GTK_MISC (widget), &xalign, &yalign);
+ xalign = gtk_label_get_xalign (GTK_LABEL (widget));
if (xalign != 0.0)
return;
text = gtk_label_get_text (GTK_LABEL (widget));
@@ -84,7 +84,7 @@ vpn_gnome3ify_editor (GtkWidget *widget)
newtext = g_strndup (text, len - 1);
gtk_label_set_text (GTK_LABEL (widget), newtext);
g_free (newtext);
- gtk_misc_set_alignment (GTK_MISC (widget), 1.0, yalign);
+ gtk_label_set_xalign (GTK_LABEL (widget), 1.0);
}
}
diff --git a/panels/network/connection-editor/net-connection-editor.c
b/panels/network/connection-editor/net-connection-editor.c
index 02df8db..4931d0e 100644
--- a/panels/network/connection-editor/net-connection-editor.c
+++ b/panels/network/connection-editor/net-connection-editor.c
@@ -770,13 +770,13 @@ select_vpn_type (NetConnectionEditor *editor, GtkListBox *list)
gtk_widget_set_margin_bottom (row_box, 12);
name_label = gtk_label_new (name);
- gtk_misc_set_alignment (GTK_MISC (name_label), 0.0, 0.5);
+ gtk_widget_set_halign (name_label, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (row_box), name_label, FALSE, TRUE, 0);
desc_label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (desc_label), desc_markup);
gtk_label_set_line_wrap (GTK_LABEL (desc_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (desc_label), 0.0, 0.5);
+ gtk_widget_set_halign (desc_label, GTK_ALIGN_START);
context = gtk_widget_get_style_context (desc_label);
gtk_style_context_add_class (context, "dim-label");
gtk_box_pack_start (GTK_BOX (row_box), desc_label, FALSE, TRUE, 0);
@@ -801,7 +801,7 @@ select_vpn_type (NetConnectionEditor *editor, GtkListBox *list)
gtk_widget_set_margin_bottom (row_box, 12);
name_label = gtk_label_new (_("Import from fileā¦"));
- gtk_misc_set_alignment (GTK_MISC (name_label), 0.0, 0.5);
+ gtk_widget_set_halign (name_label, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (row_box), name_label, FALSE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (row), row_box);
@@ -854,7 +854,7 @@ net_connection_editor_add_connection (NetConnectionEditor *editor)
row_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
label = gtk_label_new (_(connection_types[i].name));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_margin_start (label, 12);
gtk_widget_set_margin_end (label, 12);
gtk_widget_set_margin_top (label, 12);
diff --git a/panels/network/net-device-ethernet.c b/panels/network/net-device-ethernet.c
index f8abec1..695ecfb 100644
--- a/panels/network/net-device-ethernet.c
+++ b/panels/network/net-device-ethernet.c
@@ -79,14 +79,12 @@ add_details_row (GtkWidget *details, gint top, const gchar *heading, const gchar
gtk_style_context_add_class (gtk_widget_get_style_context (heading_label), "dim-label");
gtk_widget_set_halign (heading_label, GTK_ALIGN_END);
gtk_widget_set_hexpand (heading_label, TRUE);
- gtk_misc_set_alignment (GTK_MISC (heading_label), 1, 0.5);
gtk_grid_attach (GTK_GRID (details), heading_label, 0, top, 1, 1);
value_label = gtk_label_new (value);
gtk_widget_set_halign (value_label, GTK_ALIGN_START);
gtk_widget_set_hexpand (value_label, TRUE);
- gtk_misc_set_alignment (GTK_MISC (value_label), 0, 0.5);
gtk_label_set_mnemonic_widget (GTK_LABEL (heading_label), value_label);
diff --git a/panels/network/net-device-simple.c b/panels/network/net-device-simple.c
index aef427c..f57618d 100644
--- a/panels/network/net-device-simple.c
+++ b/panels/network/net-device-simple.c
@@ -282,7 +282,7 @@ net_device_simple_add_row (NetDeviceSimple *device_simple,
grid = GTK_GRID (gtk_builder_get_object (priv->builder, "grid"));
label = gtk_label_new (label_string);
- gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_container_add (GTK_CONTAINER (grid), label);
context = gtk_widget_get_style_context (label);
@@ -294,7 +294,7 @@ net_device_simple_add_row (NetDeviceSimple *device_simple,
NULL);
value = gtk_label_new (NULL);
- gtk_misc_set_alignment (GTK_MISC (value), 0.0, 0.5);
+ gtk_widget_set_halign (value, GTK_ALIGN_START);
g_object_bind_property (device_simple, property_name, value, "label", 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), value);
gtk_grid_attach (grid, value, 1, top_attach, 1, 1);
diff --git a/panels/network/net-virtual-device.c b/panels/network/net-virtual-device.c
index aeacb7e..3d0ad95 100644
--- a/panels/network/net-virtual-device.c
+++ b/panels/network/net-virtual-device.c
@@ -447,7 +447,7 @@ net_virtual_device_add_row (NetVirtualDevice *virtual_device,
grid = GTK_GRID (gtk_builder_get_object (priv->builder, "grid"));
label = gtk_label_new (label_string);
- gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_container_add (GTK_CONTAINER (grid), label);
context = gtk_widget_get_style_context (label);
@@ -459,7 +459,7 @@ net_virtual_device_add_row (NetVirtualDevice *virtual_device,
NULL);
value = gtk_label_new (NULL);
- gtk_misc_set_alignment (GTK_MISC (value), 0.0, 0.5);
+ gtk_widget_set_halign (value, GTK_ALIGN_START);
g_object_bind_property (virtual_device, property_name, value, "label", 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), value);
gtk_grid_attach (grid, value, 1, top_attach, 1, 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]