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.
Resolves: rhbz#1072453 --- pyanaconda/ui/gui/spokes/source.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index 7a72785..812f01f 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -42,6 +42,7 @@ from pyanaconda.ui.gui.utils import gtk_call_once, really_hide, really_show from pyanaconda.threads import threadMgr, AnacondaThread from pyanaconda.packaging import PackagePayload, payloadMgr from pyanaconda import constants +from pyanaconda import nm
from blivet.util import get_mount_device, get_mount_paths
@@ -761,6 +762,18 @@ class SourceSpoke(NormalSpoke): # that condition here too. self.on_protocol_changed(self._protocolComboBox)
+ # If there's no network up (which is the default case), disable all the + # network-related stuff. + 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.")) + else: + self._networkButton.set_sensitive(True) + self._networkBox.set_sensitive(True) + @property def showable(self): return isinstance(self.payload, PackagePayload) @@ -806,6 +819,10 @@ class SourceSpoke(NormalSpoke): if len(ui_repo_names) != len(frozenset(ui_repo_names)): return else: + # Clear any error message on the bottom of the screen so that on + # the next visit to this spoke, the user doesn't see a stale message + # about no network being up. + self.clear_info() NormalSpoke.on_back_clicked(self, button)
def on_chooser_clicked(self, button):
On 09/25/2014 04:24 PM, Chris Lumens wrote:
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.
Resolves: rhbz#1072453
pyanaconda/ui/gui/spokes/source.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index 7a72785..812f01f 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -42,6 +42,7 @@ from pyanaconda.ui.gui.utils import gtk_call_once, really_hide, really_show from pyanaconda.threads import threadMgr, AnacondaThread from pyanaconda.packaging import PackagePayload, payloadMgr from pyanaconda import constants +from pyanaconda import nm
from blivet.util import get_mount_device, get_mount_paths
@@ -761,6 +762,18 @@ class SourceSpoke(NormalSpoke): # that condition here too. self.on_protocol_changed(self._protocolComboBox)
# If there's no network up (which is the default case), disable all the
# network-related stuff.
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."))
else:
self._networkButton.set_sensitive(True)
self._networkBox.set_sensitive(True)
@property def showable(self): return isinstance(self.payload, PackagePayload)
@@ -806,6 +819,10 @@ class SourceSpoke(NormalSpoke): if len(ui_repo_names) != len(frozenset(ui_repo_names)): return else:
# Clear any error message on the bottom of the screen so that on
# the next visit to this spoke, the user doesn't see a stale message
# about no network being up.
self.clear_info() NormalSpoke.on_back_clicked(self, button) def on_chooser_clicked(self, button):
Ack.
On Thu, 2014-09-25 at 16:24 -0400, Chris Lumens wrote:
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.
Resolves: rhbz#1072453
pyanaconda/ui/gui/spokes/source.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index 7a72785..812f01f 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -42,6 +42,7 @@ from pyanaconda.ui.gui.utils import gtk_call_once, really_hide, really_show from pyanaconda.threads import threadMgr, AnacondaThread from pyanaconda.packaging import PackagePayload, payloadMgr from pyanaconda import constants +from pyanaconda import nm
from blivet.util import get_mount_device, get_mount_paths
@@ -761,6 +762,18 @@ class SourceSpoke(NormalSpoke): # that condition here too. self.on_protocol_changed(self._protocolComboBox)
# If there's no network up (which is the default case), disable all the
# network-related stuff.
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."))
else:
self._networkButton.set_sensitive(True)
self._networkBox.set_sensitive(True)
- @property def showable(self): return isinstance(self.payload, PackagePayload)
@@ -806,6 +819,10 @@ class SourceSpoke(NormalSpoke): if len(ui_repo_names) != len(frozenset(ui_repo_names)): return else:
# Clear any error message on the bottom of the screen so that on
# the next visit to this spoke, the user doesn't see a stale message
# about no network being up.
self.clear_info() NormalSpoke.on_back_clicked(self, button)
def on_chooser_clicked(self, button):
ACK and thanks! :)
----- Original Message -----
From: "Chris Lumens" clumens@redhat.com To: anaconda-patches@lists.fedorahosted.org Sent: Thursday, September 25, 2014 4:24:48 PM Subject: [PATCH rhel7-branch/master] If the network is disabled, also disable the network part of the source spoke.
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.
Resolves: rhbz#1072453
pyanaconda/ui/gui/spokes/source.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index 7a72785..812f01f 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -42,6 +42,7 @@ from pyanaconda.ui.gui.utils import gtk_call_once, really_hide, really_show from pyanaconda.threads import threadMgr, AnacondaThread from pyanaconda.packaging import PackagePayload, payloadMgr from pyanaconda import constants +from pyanaconda import nm
from blivet.util import get_mount_device, get_mount_paths
@@ -761,6 +762,18 @@ class SourceSpoke(NormalSpoke): # that condition here too. self.on_protocol_changed(self._protocolComboBox)
# If there's no network up (which is the default case), disable all
the
# network-related stuff.
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."))
else:
This looks like a mistake, because of other code above that sets sensitivity of these widgets to False, that this code overrides unconditionally.
self._networkButton.set_sensitive(True)
self._networkBox.set_sensitive(True)
- @property def showable(self): return isinstance(self.payload, PackagePayload)
@@ -806,6 +819,10 @@ class SourceSpoke(NormalSpoke): if len(ui_repo_names) != len(frozenset(ui_repo_names)): return else:
# Clear any error message on the bottom of the screen so that on
# the next visit to this spoke, the user doesn't see a stale
message
# about no network being up.
self.clear_info()
Should this, in general, be done for all spokes, i.e., the clearing out of the stale information?
NormalSpoke.on_back_clicked(self, button) def on_chooser_clicked(self, button):
-- 1.9.3
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
- mulhern
This looks like a mistake, because of other code above that sets sensitivity of these widgets to False, that this code overrides unconditionally.
Yeah I'll send an updated patch.
Should this, in general, be done for all spokes, i.e., the clearing out of the stale information?
Maybe, but I'd prefer not changing this on RHEL7 unless it becomes a bug.
- Chris
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.
Resolves: rhbz#1072453 --- pyanaconda/ui/gui/spokes/source.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index 7a72785..5df5ce7 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -42,6 +42,7 @@ from pyanaconda.ui.gui.utils import gtk_call_once, really_hide, really_show from pyanaconda.threads import threadMgr, AnacondaThread from pyanaconda.packaging import PackagePayload, payloadMgr from pyanaconda import constants +from pyanaconda import nm
from blivet.util import get_mount_device, get_mount_paths
@@ -692,6 +693,14 @@ class SourceSpoke(NormalSpoke): self._urlEntry.set_sensitive(True)
# Set up the default state of UI elements. + + # Make these sensitive now in case the network has been brought up since + # a previous visit when they were insensitive. Later, we'll worry about + # the various conditions that could cause these widgets to be marked as + # insensitive. + self._networkButton.set_sensitive(True) + self._networkBox.set_sensitive(True) + if self.data.method.method == "url": self._networkButton.set_active(True)
@@ -761,6 +770,15 @@ class SourceSpoke(NormalSpoke): # that condition here too. self.on_protocol_changed(self._protocolComboBox)
+ # If there's no network up (which is the default case), disable all the + # network-related stuff. + 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.")) + @property def showable(self): return isinstance(self.payload, PackagePayload) @@ -806,6 +824,10 @@ class SourceSpoke(NormalSpoke): if len(ui_repo_names) != len(frozenset(ui_repo_names)): return else: + # Clear any error message on the bottom of the screen so that on + # the next visit to this spoke, the user doesn't see a stale message + # about no network being up. + self.clear_info() NormalSpoke.on_back_clicked(self, button)
def on_chooser_clicked(self, button):
----- Original Message ----- From: "Chris Lumens" clumens@redhat.com To: anaconda-patches@lists.fedorahosted.org Sent: Friday, September 26, 2014 10:17:25 AM Subject: [PATCH] If the network is disabled, also disable the network part of the source spoke.
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.
Resolves: rhbz#1072453 --- pyanaconda/ui/gui/spokes/source.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index 7a72785..5df5ce7 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -42,6 +42,7 @@ from pyanaconda.ui.gui.utils import gtk_call_once, really_hide, really_show from pyanaconda.threads import threadMgr, AnacondaThread from pyanaconda.packaging import PackagePayload, payloadMgr from pyanaconda import constants +from pyanaconda import nm
from blivet.util import get_mount_device, get_mount_paths
@@ -692,6 +693,14 @@ class SourceSpoke(NormalSpoke): self._urlEntry.set_sensitive(True)
# Set up the default state of UI elements. + + # Make these sensitive now in case the network has been brought up since + # a previous visit when they were insensitive. Later, we'll worry about + # the various conditions that could cause these widgets to be marked as + # insensitive. + self._networkButton.set_sensitive(True) + self._networkBox.set_sensitive(True) + if self.data.method.method == "url": self._networkButton.set_active(True)
@@ -761,6 +770,15 @@ class SourceSpoke(NormalSpoke): # that condition here too. self.on_protocol_changed(self._protocolComboBox)
+ # If there's no network up (which is the default case), disable all the + # network-related stuff.
Could you get rid of the parenthetical expression? Nobody's going to come and fix it when the default case changes to network up.
+ 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.")) + @property def showable(self): return isinstance(self.payload, PackagePayload) @@ -806,6 +824,10 @@ class SourceSpoke(NormalSpoke): if len(ui_repo_names) != len(frozenset(ui_repo_names)): return else: + # Clear any error message on the bottom of the screen so that on + # the next visit to this spoke, the user doesn't see a stale message + # about no network being up.
Could you get rid of the very last line of this comment? I know that's what the bug is about, but the code is about all stale messages, not just network related ones.
+ self.clear_info() NormalSpoke.on_back_clicked(self, button)
def on_chooser_clicked(self, button):
anaconda-patches@lists.fedorahosted.org