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
This commit is contained in:
Georges Basile Stavracas Neto 2017-05-21 15:40:33 -03:00
parent 8137036675
commit 3458566f7c
2 changed files with 11 additions and 1 deletions

View file

@ -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

View file

@ -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>