From: "Brian C. Lane" bcl@redhat.com
Refresh the environments and groups when the source changes, and allow the software spoke's apply() method to run when the source is different than the last time the spoke was visited. --- pyanaconda/ui/gui/spokes/software.py | 5 ++++- pyanaconda/ui/gui/spokes/source.py | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py index 8fd4c59..64f0587 100644 --- a/pyanaconda/ui/gui/spokes/software.py +++ b/pyanaconda/ui/gui/spokes/software.py @@ -81,7 +81,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
# Don't redo dep solving if nothing's changed. if row[2] == self._origEnvironment and set(addons) == set(self._origAddons) and \ - not self._clickedRemove: + not self._clickedRemove and self._tx_id == self.payload.txID: return
self._selectFlag = False @@ -153,6 +153,9 @@ class SoftwareSelectionSpoke(NormalSpoke): if not self.ready: return _("Installation source not set up")
+ if self._tx_id != self.payload.txID: + return _("Source Changed") + row = self._get_selected_environment() if not row: # Kickstart installs with %packages will have a row selected, unless diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index 9892fff..c60d965 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -41,7 +41,7 @@ from pyanaconda.ui.gui.utils import enlightbox, gtk_thread_wait from pyanaconda.iutil import ProxyString, ProxyStringError from pyanaconda.ui.gui.utils import gtk_call_once from pyanaconda.threads import threadMgr, AnacondaThread -from pyanaconda.packaging import PayloadError, get_mount_paths +from pyanaconda.packaging import PayloadError, get_mount_paths, MetadataError from pyanaconda.constants import DRACUT_ISODIR, ISO_DIR
__all__ = ["SourceSpoke"] @@ -576,7 +576,19 @@ class SourceSpoke(NormalSpoke): self._error = True gtk_call_once(self.set_warning, _("Failed to set up install source, check the repo url")) else: - communication.send_ready("SoftwareSelectionSpoke") + try: + # Grabbing the list of groups could potentially take a long time the + # first time (yum does a lot of magic property stuff, some of which + # involves side effects like network access) so go ahead and grab + # them now. These are properties with side-effects, just accessing + # them will trigger yum. + e = self.payload.environments + g = self.payload.groups + except MetadataError: + communication.send_message("SoftwareSelectionSpoke", + _("No installation source available")) + else: + communication.send_ready("SoftwareSelectionSpoke") finally: communication.send_ready(self.__class__.__name__)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py index 8fd4c59..64f0587 100644 --- a/pyanaconda/ui/gui/spokes/software.py +++ b/pyanaconda/ui/gui/spokes/software.py @@ -81,7 +81,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
# Don't redo dep solving if nothing's changed. if row[2] == self._origEnvironment and set(addons) == set(self._origAddons) and \
not self._clickedRemove:
not self._clickedRemove and self._tx_id == self.payload.txID: return self._selectFlag = False
Ah, I like this change. We're already doing a comparison in the completed method too, so I wonder if it wouldn't be worth adding something like this:
@property def tx_valid(self): return self._tx_id == self.payload.txID
@@ -153,6 +153,9 @@ class SoftwareSelectionSpoke(NormalSpoke): if not self.ready: return _("Installation source not set up")
if self._tx_id != self.payload.txID:return _("Source Changed")row = self._get_selected_environment() if not row: # Kickstart installs with %packages will have a row selected, unless
All other status lines in this spoke capitalize only the first word, so I'd change that.
Also I wonder if we could have more explicit wording here to make it clearer what's going on. The fundamental problem is that we've made it so the user has to go back into the software spoke just to check everything's still okay. I think we expect that most people are just going to go in and right back out, because most people aren't going to drastically change the source (like from F18 to F20, or whatever).
I wonder if wording more like "Source changed - please verify" might be even more helpful in telling the user why we want them to go back in.
- Chris
From: "Brian C. Lane" bcl@redhat.com
Refresh the environments and groups when the source changes, and allow the software spoke's apply() method to run when the source is different than the last time the spoke was visited. --- pyanaconda/ui/gui/spokes/software.py | 12 +++++++++--- pyanaconda/ui/gui/spokes/source.py | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py index 8fd4c59..a50cf60 100644 --- a/pyanaconda/ui/gui/spokes/software.py +++ b/pyanaconda/ui/gui/spokes/software.py @@ -81,7 +81,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
# Don't redo dep solving if nothing's changed. if row[2] == self._origEnvironment and set(addons) == set(self._origAddons) and \ - not self._clickedRemove: + not self._clickedRemove and self.txid_valid: return
self._selectFlag = False @@ -122,8 +122,7 @@ class SoftwareSelectionSpoke(NormalSpoke): @property def completed(self): processingDone = not threadMgr.get("AnaCheckSoftwareThread") and \ - not self._errorMsgs and \ - self._tx_id == self.payload.txID + not self._errorMsgs and self.txid_valid
if flags.automatedInstall and packagesSeen: return processingDone @@ -153,6 +152,9 @@ class SoftwareSelectionSpoke(NormalSpoke): if not self.ready: return _("Installation source not set up")
+ if not self.txid_valid: + return _("Source changed - please verify") + row = self._get_selected_environment() if not row: # Kickstart installs with %packages will have a row selected, unless @@ -277,6 +279,10 @@ class SoftwareSelectionSpoke(NormalSpoke):
return self._environmentStore[itr]
+ @property + def txid_valid(self): + return self._tx_id == self.payload.txID + # Signal handlers def on_environment_toggled(self, renderer, path): if not self._selectFlag: diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index 9892fff..c60d965 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -41,7 +41,7 @@ from pyanaconda.ui.gui.utils import enlightbox, gtk_thread_wait from pyanaconda.iutil import ProxyString, ProxyStringError from pyanaconda.ui.gui.utils import gtk_call_once from pyanaconda.threads import threadMgr, AnacondaThread -from pyanaconda.packaging import PayloadError, get_mount_paths +from pyanaconda.packaging import PayloadError, get_mount_paths, MetadataError from pyanaconda.constants import DRACUT_ISODIR, ISO_DIR
__all__ = ["SourceSpoke"] @@ -576,7 +576,19 @@ class SourceSpoke(NormalSpoke): self._error = True gtk_call_once(self.set_warning, _("Failed to set up install source, check the repo url")) else: - communication.send_ready("SoftwareSelectionSpoke") + try: + # Grabbing the list of groups could potentially take a long time the + # first time (yum does a lot of magic property stuff, some of which + # involves side effects like network access) so go ahead and grab + # them now. These are properties with side-effects, just accessing + # them will trigger yum. + e = self.payload.environments + g = self.payload.groups + except MetadataError: + communication.send_message("SoftwareSelectionSpoke", + _("No installation source available")) + else: + communication.send_ready("SoftwareSelectionSpoke") finally: communication.send_ready(self.__class__.__name__)
anaconda-patches@lists.fedorahosted.org