from gtk import * from iw import * from thread import * import isys class FormatWindow (InstallWindow): def __init__ (self, ics): InstallWindow.__init__ (self, ics) self.todo = ics.getToDo () ics.setTitle ("Choose partitions to Format") ics.setNextEnabled (1) ics.setHTML ("Choose partitions to Format") def getScreen (self): def toggled (widget, (todo, mount)): if widget.get_active (): (dev, fstype, format) = todo.mounts[mount] todo.mounts[mount] = (dev, fstype, 1) else: (dev, fstype, format) = todo.mounts[mount] todo.mounts[mount] = (dev, fstype, 0) box = GtkVBox (FALSE, 10) mounts = self.todo.mounts.keys () mounts.sort () for mount in mounts: (dev, fstype, format) = self.todo.mounts[mount] if fstype == "ext2": checkButton = GtkCheckButton ("/dev/%s %s" % (dev, mount)) checkButton.set_active (format) checkButton.connect ("toggled", toggled, (self.todo, mount)) box.pack_start (checkButton) vbox = GtkVBox (FALSE, 10) vbox.pack_start (box, FALSE) return vbox