From 3458566f7cc572c1b8ce64434bf6aca8ba3db14b Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sun, 21 May 2017 15:40:33 -0300 Subject: [PATCH] network: Adapt forget button label according to connection type Per the mockup [1], the Forget button has different labels depending on the connection type. For example, when editing a VPN connection, the Forget button reads "Remove VPN", while when editing a Wi-Fi connection reads "Forget Connection". This patch adapts the forget button label according to the connection type. [1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/network/aday2/network-wires.png https://bugzilla.gnome.org/show_bug.cgi?id=779841 --- panels/network/connection-editor/ce-page-details.c | 11 +++++++++++ panels/network/connection-editor/details-page.ui | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/panels/network/connection-editor/ce-page-details.c b/panels/network/connection-editor/ce-page-details.c index b8505a5e4..2d8583677 100644 --- a/panels/network/connection-editor/ce-page-details.c +++ b/panels/network/connection-editor/ce-page-details.c @@ -141,6 +141,7 @@ connect_details_page (CEPageDetails *page) NMDeviceState state; NMAccessPoint *active_ap; const gchar *str; + const gchar *type; gboolean device_is_active; if (NM_IS_DEVICE_WIFI (page->device)) @@ -241,6 +242,16 @@ connect_details_page (CEPageDetails *page) /* Forget button */ widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "button_forget")); g_signal_connect (widget, "clicked", G_CALLBACK (forget_cb), page); + + type = nm_setting_connection_get_connection_type (sc); + if (g_str_equal (type, NM_SETTING_WIRELESS_SETTING_NAME)) + gtk_button_set_label (GTK_BUTTON (widget), _("Forget Connection")); + else if (g_str_equal (type, NM_SETTING_WIRED_SETTING_NAME)) + gtk_button_set_label (GTK_BUTTON (widget), _("Remove Connection Profile")); + else if (g_str_equal (type, NM_SETTING_VPN_SETTING_NAME)) + gtk_button_set_label (GTK_BUTTON (widget), _("Remove VPN")); + else + gtk_widget_hide (widget); } static void diff --git a/panels/network/connection-editor/details-page.ui b/panels/network/connection-editor/details-page.ui index ed6e3c536..3b1c71689 100644 --- a/panels/network/connection-editor/details-page.ui +++ b/panels/network/connection-editor/details-page.ui @@ -357,7 +357,6 @@ - _Forget True True True