[master 1/1] If the network is disabled, also disable the network part of the source spoke. (#1192104)

dashea installerbot-noreply at redhat.com
Mon Apr 13 18:35:39 UTC 2015


From: Chris Lumens <clumens at redhat.com>

Otherwise, the user could be put into a confusing situation where they have
a network source entered, but the displayed error messages do not help the user
figure out that there's no network connection.  For RHEL this is especially bad
since no network is the default.

(cherry picked from commit 822f9348ca2193f700a55e5763fd89bbc06af80a)
---
 pyanaconda/ui/gui/spokes/source.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 42a3913..2e26a06 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -45,6 +45,7 @@
 from pyanaconda.packaging import PackagePayload, payloadMgr
 from pyanaconda.regexes import REPO_NAME_VALID, URL_PARSE, HOSTNAME_PATTERN_WITHOUT_ANCHORS
 from pyanaconda import constants
+from pyanaconda import nm
 
 from blivet.util import get_mount_device, get_mount_paths
 
@@ -782,6 +783,9 @@ def refresh(self):
         self._updateURLEntryCheck()
 
         # Set up the default state of UI elements.
+        self._networkButton.set_sensitive(True)
+        self._networkBox.set_sensitive(True)
+
         if self.data.method.method == "url":
             self._networkButton.set_active(True)
 
@@ -854,6 +858,13 @@ def refresh(self):
             # that condition here too.
             self.on_protocol_changed(self._protocolComboBox)
 
+        if not nm.nm_is_connected():
+            self._networkButton.set_sensitive(False)
+            self._networkBox.set_sensitive(False)
+
+            self.clear_info()
+            self.set_warning(_("You need to configure the network to use a network installation source."))
+
     def _setup_no_updates(self):
         """ Setup the state of the No Updates checkbox.
 
@@ -1031,6 +1042,7 @@ def on_back_clicked(self, button):
         elif not GUISpokeInputCheckHandler.on_back_clicked(self, button):
             return
 
+        self.clear_info()
         NormalSpoke.on_back_clicked(self, button)
 
     def on_chooser_clicked(self, button):


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/dc24fe0075e884ff5a0801753545f132c915ea5a


More information about the anaconda-patches mailing list