diff options
author | bfox <bfox> | 2000-11-15 04:45:58 +0000 |
---|---|---|
committer | bfox <bfox> | 2000-11-15 04:45:58 +0000 |
commit | 49f26a95500faf9be3a7b5292118cd5e0837d460 (patch) | |
tree | 97c56879fa3b2059e5a9a2169924e8ed369ca6f3 /iw | |
parent | 777e1c69726fb80db324afb3e4571720c525c561 (diff) | |
download | anaconda-49f26a95500faf9be3a7b5292118cd5e0837d460.tar.gz anaconda-49f26a95500faf9be3a7b5292118cd5e0837d460.tar.xz anaconda-49f26a95500faf9be3a7b5292118cd5e0837d460.zip |
Added code to exit gracefully if comps file or hdlist file is not found. More work needs to be done here.
Diffstat (limited to 'iw')
-rw-r--r-- | iw/package_gui.py | 81 |
1 files changed, 73 insertions, 8 deletions
diff --git a/iw/package_gui.py b/iw/package_gui.py index 0e5df2227..94de2c179 100644 --- a/iw/package_gui.py +++ b/iw/package_gui.py @@ -13,6 +13,8 @@ import xpms_gui from translate import _ #import checkbutton_xpms import checklist +import time +from threading import * class IndividualPackageSelectionWindow (InstallWindow): @@ -505,6 +507,43 @@ class IndividualPackageSelectionWindow (InstallWindow): return vbox + +class ErrorWindow: + def __init__ (self): + win = GnomeDialog ("File not found") + win.connect ("clicked", self.quit) + + info = GtkLabel (_("An error has occurred while retreiving hdlist or comps files. " + "The installation media or image is probably corrupt. Installer will exit now.")) + info.set_line_wrap (TRUE) + info.set_usize (400, -1) + +# hbox = GtkHBox (FALSE) + +# hbox.pack_start (sw, TRUE) + win.vbox.pack_start (info, FALSE) +# win.vbox.pack_start (hbox, TRUE) + win.set_usize (500, 300) + win.set_position (WIN_POS_CENTER) + win.show_all () + self.window = win + + thread = currentThread () + if thread.getName () == "gtk_main": + self.mutex = None + self.rc = self.window.run () + threads_leave() + else: + threads_leave () + self.mutex = Event () + self.mutex.wait () + + def quit (self, dialog, button): + self.rc = button + if self.mutex: + self.mutex.set () + + class PackageSelectionWindow (InstallWindow): def __init__ (self, ics): InstallWindow.__init__ (self, ics) @@ -514,6 +553,8 @@ class PackageSelectionWindow (InstallWindow): ics.readHTML ("sel-group") self.selectIndividualPackages = FALSE + self.files = "TRUE" + def getPrev (self): self.todo.comps.setSelectionState(self.origSelection) @@ -544,13 +585,33 @@ class PackageSelectionWindow (InstallWindow): self.setSize() + def getScreen (self): - threads_leave () - self.todo.getHeaderList () - self.todo.getCompsList() - threads_enter () +# threads_leave () + try: + threads_leave () + self.todo.getHeaderList () + self.todo.getCompsList() + threads_enter () + + except: + print "Cannot read either header or comps or both" + self.files = "FALSE" + + print self.files + +# threads_enter () + +# threads_leave () + if self.files == "FALSE": +# self.raiseDialog () + win = ErrorWindow () +# threads_enter () + else: + self.origSelection = self.todo.comps.getSelectionState() +# threads_enter () + - self.origSelection = self.todo.comps.getSelectionState() sw = GtkScrolledWindow () sw.set_border_width (5) @@ -558,7 +619,7 @@ class PackageSelectionWindow (InstallWindow): box = GtkVBox (FALSE, 0) - self.checkButtons = [] + self.checkButtons = [] klass = self.todo.getClass () for comp in self.todo.comps: show = 0 @@ -595,7 +656,7 @@ class PackageSelectionWindow (InstallWindow): checkButton = GtkCheckButton (comp.name) checkButton.set_active (comp.isSelected()) - checkButton.connect('toggled', self.componentToggled, comp) + checkButton.connect('toggled', self.componentToggled, comp) self.checkButtons.append ((checkButton, comp)) box.pack_start (checkButton) @@ -613,7 +674,7 @@ class PackageSelectionWindow (InstallWindow): hbox.pack_start (self.individualPackages, FALSE) self.sizelabel = GtkLabel ("") - self.setSize() + self.setSize() hbox.pack_start (self.sizelabel, TRUE) vbox = GtkVBox (FALSE, 5) @@ -623,6 +684,10 @@ class PackageSelectionWindow (InstallWindow): return vbox + +# else: +# self.raiseDialog () + |