summaryrefslogtreecommitdiffstats
path: root/pyanaconda/ui/gui/spokes/software.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyanaconda/ui/gui/spokes/software.py')
-rw-r--r--pyanaconda/ui/gui/spokes/software.py34
1 files changed, 20 insertions, 14 deletions
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 2083b5371..e99a1a2bc 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -28,9 +28,10 @@ from pyanaconda.flags import flags
from pyanaconda.ui.gui import communication
from pyanaconda.ui.gui.spokes import NormalSpoke
from pyanaconda.ui.gui.spokes.lib.detailederror import DetailedErrorDialog
-from pyanaconda.ui.gui.utils import enlightbox, gdk_threaded
+from pyanaconda.ui.gui.utils import enlightbox, gtk_thread_wait
from pyanaconda.ui.gui.categories.software import SoftwareCategory
from .source import AdditionalReposDialog
+from gi.repository import GLib
from pyanaconda.kickstart import packagesSeen
from pykickstart.parser import Group
@@ -155,7 +156,6 @@ class SoftwareSelectionSpoke(NormalSpoke):
threadMgr.add(AnacondaThread(name="AnaSoftwareWatcher", target=self._initialize))
def _initialize(self):
- from pyanaconda.packaging import MetadataError
from pyanaconda.threads import threadMgr
communication.send_message(self.__class__.__name__, _("Downloading package metadata..."))
@@ -175,18 +175,8 @@ class SoftwareSelectionSpoke(NormalSpoke):
if mdGatherThread:
mdGatherThread.join()
else:
- with gdk_threaded():
- # 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 once now.
- try:
- self.refresh()
- except MetadataError:
- communication.send_message(self.__class__.__name__,
- _("No installation source available"))
- return
-
+ if not self._first_refresh():
+ return
self.payload.release()
communication.send_ready(self.__class__.__name__)
@@ -195,6 +185,22 @@ class SoftwareSelectionSpoke(NormalSpoke):
# we should do dependency solving here.
self.apply()
+ @gtk_thread_wait
+ def _first_refresh(self):
+ # 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 once now.
+ from pyanaconda.packaging import MetadataError
+
+ try:
+ self.refresh()
+ return True
+ except MetadataError:
+ communication.send_message(self.__class__.__name__,
+ _("No installation source available"))
+ return False
+
def refresh(self):
from pyanaconda.threads import threadMgr
NormalSpoke.refresh(self)