diff options
author | Chris Lumens <clumens@redhat.com> | 2012-10-19 10:34:04 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2012-10-19 16:47:44 -0400 |
commit | 91aca5c967eaade8e299c507f56fe8be8a05bb3f (patch) | |
tree | 71eca65c3bbc80316f763a1d1b6ec864f10cb28c | |
parent | 95ba9a4940cc756f6cb6e6e2f5a6e619834deb8f (diff) | |
download | anaconda-91aca5c967eaade8e299c507f56fe8be8a05bb3f.tar.gz anaconda-91aca5c967eaade8e299c507f56fe8be8a05bb3f.tar.xz anaconda-91aca5c967eaade8e299c507f56fe8be8a05bb3f.zip |
If nothing's changed in the software spoke, don't redo dep solving.
-rw-r--r-- | pyanaconda/ui/gui/spokes/software.py | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py index 231e47889..b091c9f57 100644 --- a/pyanaconda/ui/gui/spokes/software.py +++ b/pyanaconda/ui/gui/spokes/software.py @@ -62,6 +62,10 @@ class SoftwareSelectionSpoke(NormalSpoke): self._addRepoDialog = AdditionalReposDialog(self.data) + # Used for detecting whether anything's changed in the spoke. + self._origAddons = [] + self._origEnvironment = None + def apply(self): # NOTE: Other apply methods work directly with the ksdata, but this # one does not. However, selectGroup/deselectGroup modifies ksdata as @@ -69,13 +73,25 @@ class SoftwareSelectionSpoke(NormalSpoke): from pyanaconda.threads import threadMgr, AnacondaThread row = self._get_selected_environment() - if row: - self._selectFlag = False - self.payload.data.packages.groupList = [] - self.payload.selectEnvironment(row[2]) - self.environment = row[2] - for group in self.selectedGroups: - self.payload.selectGroup(group) + if not row: + return + + addons = self._get_selected_addons() + + # Don't redo dep solving if nothing's changed. + if row[2] == self._origEnvironment and set(addons) == set(self._origAddons): + return + + self._selectFlag = False + self.payload.data.packages.groupList = [] + self.payload.selectEnvironment(row[2]) + self.environment = row[2] + for group in self.selectedGroups: + self.payload.selectGroup(group) + + # And then save these values so we can check next time. + self._origAddons = addons + self._origEnvironment = self.environment communication.send_not_ready(self.__class__.__name__) threadMgr.add(AnacondaThread(name="AnaCheckSoftwareThread", @@ -200,7 +216,7 @@ class SoftwareSelectionSpoke(NormalSpoke): communication.send_message(self.__class__.__name__, _("No installation source available")) return False - + def refresh(self): from pyanaconda.threads import threadMgr NormalSpoke.refresh(self) @@ -254,6 +270,9 @@ class SoftwareSelectionSpoke(NormalSpoke): if self._errorMsgs: self.window.set_info(Gtk.MessageType.WARNING, _("Error checking software dependencies. Click for details.")) + def _get_selected_addons(self): + return [row[2] for row in self._addonStore if row[0]] + # Returns the row in the store corresponding to what's selected on the # left hand panel, or None if nothing's selected. def _get_selected_environment(self): |