summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-09-15 16:27:01 +0200
committerThomas Haller <thaller@redhat.com>2015-09-15 16:34:16 +0200
commit37570da2f1cb03c6ae7904456c95bd246df7d4c3 (patch)
tree4017c92d493227b3102ab470985a1d9ff70045ec
parent7d3ec1058d7c6977dfbba9b6d3997704b62c461f (diff)
downloadnetwork-manager-applet-jk/editor-wol-bgo755039.tar.gz
fixup! editor: add Wake-on-LAN settings to the editor Ethernet page (bgo #755039)jk/editor-wol-bgo755039
When disabling "Default", the other check boxes should only be disabled, not cleared -- like we also only disable the wol_passwd field, without clearing the text.
-rw-r--r--src/connection-editor/page-ethernet.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/connection-editor/page-ethernet.c b/src/connection-editor/page-ethernet.c
index 043a0b06..7a56d356 100644
--- a/src/connection-editor/page-ethernet.c
+++ b/src/connection-editor/page-ethernet.c
@@ -114,7 +114,7 @@ wol_default_toggled_cb (GtkWidget *widget, gpointer user_data)
{
CEPageEthernet *self = CE_PAGE_ETHERNET (user_data);
CEPageEthernetPrivate *priv = CE_PAGE_ETHERNET_GET_PRIVATE (self);
- gboolean enabled;
+ gboolean enabled, enabled_passwd;
enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
@@ -124,14 +124,11 @@ wol_default_toggled_cb (GtkWidget *widget, gpointer user_data)
gtk_widget_set_sensitive (GTK_WIDGET (priv->wol_broadcast), !enabled);
gtk_widget_set_sensitive (GTK_WIDGET (priv->wol_arp), !enabled);
gtk_widget_set_sensitive (GTK_WIDGET (priv->wol_magic), !enabled);
- if (enabled) {
- gtk_toggle_button_set_active (priv->wol_phy, FALSE);
- gtk_toggle_button_set_active (priv->wol_unicast, FALSE);
- gtk_toggle_button_set_active (priv->wol_multicast, FALSE);
- gtk_toggle_button_set_active (priv->wol_broadcast, FALSE);
- gtk_toggle_button_set_active (priv->wol_arp, FALSE);
- gtk_toggle_button_set_active (priv->wol_magic, FALSE);
- }
+
+ enabled_passwd = !enabled && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->wol_magic));
+ gtk_widget_set_sensitive (GTK_WIDGET (priv->wol_passwd), enabled_passwd);
+
+ stuff_changed (NULL, self);
}
static void
@@ -141,7 +138,8 @@ wol_magic_toggled_cb (GtkWidget *widget, gpointer user_data)
CEPageEthernetPrivate *priv = CE_PAGE_ETHERNET_GET_PRIVATE (self);
gboolean enabled;
- enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
+ enabled = gtk_widget_get_sensitive (widget)
+ && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
gtk_widget_set_sensitive (GTK_WIDGET (priv->wol_passwd), enabled);