- def hddInitialize(self):
- #some protection for the exhibition (IFA 2005)
- #if self.hdd.getIndex() == 2: #CF
- # print "not a good idea!"
- # self.session.open(MessageBox, "not a good idea - this will kill our rootfs!")
- #else:
- print "this will start the initialize now!"
- self.hdd.initialize()
+ def hddReady(self, result):
+ print "Result: " + str(result)
+ if (result != 0):
+ if self.type == self.HARDDISK_INITIALIZE:
+ message = _("Unable to initialize harddisk.\nError: ")
+ else:
+ message = _("Unable to complete filesystem check.\nError: ")
+ self.session.open(MessageBox, message + str(self.hdd.errorList[0 - result]), MessageBox.TYPE_ERROR)
+ else:
+ self.close()
+
+ def hddQuestion(self):
+ if self.type == self.HARDDISK_INITIALIZE:
+ message = _("Do you really want to initialize the harddisk?\nAll data on the disk will be lost!")
+ else:
+ message = _("Do you really want to check the filesystem?\nThis could take lots of time!")
+ self.session.openWithCallback(self.hddConfirmed, MessageBox, message)
+
+ def hddConfirmed(self, confirmed):
+ if not confirmed:
+ return
+
+ print "this will start either the initialize or the fsck now!"
+ self.session.openWithCallback(self.hddReady, HarddiskWait, self.hdd, self.type)