summaryrefslogtreecommitdiff
path: root/panels
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2017-05-21 15:40:33 -0300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2017-06-14 16:41:10 -0300
commit3458566f7cc572c1b8ce64434bf6aca8ba3db14b (patch)
treeceb883ffa1fdc4f4c3c7d05cfa8aed45ca68a20e /panels
parent813703667550229f0618a709a83686113cebafcd (diff)
downloadgnome-control-center-3458566f7cc572c1b8ce64434bf6aca8ba3db14b.tar.gz
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
Diffstat (limited to 'panels')
-rw-r--r--panels/network/connection-editor/ce-page-details.c11
-rw-r--r--panels/network/connection-editor/details-page.ui1
2 files changed, 11 insertions, 1 deletions
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 @@
</child>
<child>
<object class="GtkButton" id="button_forget">
- <property name="label" translatable="yes">_Forget</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_underline">True</property>