[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 2/2] Update flags for text-mode ipv4 and ipv6 radio buttons based on whether networking is selected.



Greetings,

I noticed that in the text-mode anaconda network configuration screen (e.g.
rescue-mode), the ipv4 and ipv6 checkboxes behave differently than the same
dialog in loader.  In loader, disabling (unchecking) the ipv4 and ipv6 checkbox
will disable all related network radio buttons.  I'm not sure why, but it drove
me nuts that the rescue-mode dialog didn't act the same.  I've patched
textw/netconfig_text.py so that it sets the snack flags for the v4 and v6 radio
buttons based on whether the corresponding checkbox is enabled.

Comments welcome.

Thanks,
James

---
 pyanaconda/textw/netconfig_text.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/textw/netconfig_text.py b/pyanaconda/textw/netconfig_text.py
index 7a44516..de0eca2 100644
--- a/pyanaconda/textw/netconfig_text.py
+++ b/pyanaconda/textw/netconfig_text.py
@@ -420,6 +420,14 @@ class NetworkConfiguratorText:
         self.ipv4GatewayEntry.setFlags(FLAG_DISABLED, flag)
         self.ipv4NameserverEntry.setFlags(FLAG_DISABLED, flag)
 
+        # Update flags for radio buttons based on whether ipv4 is selected
+        if self.ipv4Checkbox.selected():
+            self.v4radio_auto.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_RESET)
+            self.v4radio_manual.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_RESET)
+        else:
+            self.v4radio_auto.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET)
+            self.v4radio_manual.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET)
+
     def _ipv6MethodToggled(self, *args):
         if (self.v6radio.getSelection() == "v6manual" and
             self.ipv6Checkbox.selected()):
@@ -432,3 +440,13 @@ class NetworkConfiguratorText:
         self.ipv6GatewayEntry.setFlags(FLAG_DISABLED, flag)
         self.ipv6NameserverEntry.setFlags(FLAG_DISABLED, flag)
 
+        # Update flags for radio buttons based on whether ipv6 is selected
+        if self.ipv6Checkbox.selected():
+            self.v6radio_auto.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_RESET)
+            self.v6radio_dhcp.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_RESET)
+            self.v6radio_manual.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_RESET)
+        else:
+            self.v6radio_auto.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET)
+            self.v6radio_dhcp.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET)
+            self.v6radio_manual.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET)
+
-- 
1.7.4.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]