show message and defer init
authorRonny Strutz <ronny.strutz@multimedia-labs.de>
Tue, 15 Nov 2005 02:45:41 +0000 (02:45 +0000)
committerRonny Strutz <ronny.strutz@multimedia-labs.de>
Tue, 15 Nov 2005 02:45:41 +0000 (02:45 +0000)
lib/python/Screens/HarddiskSetup.py

index 8a683a5452a15fc8cbec83a9d501ba269270ac18..73e3d6464785cc1610a0b2e8ce69c2490918f16b 100644 (file)
@@ -4,6 +4,21 @@ from Components.Harddisk import harddiskmanager                        #global harddiskmanager
 from Components.MenuList import MenuList
 from Components.Label import Label
 from Screens.MessageBox import MessageBox
+from enigma import eTimer
+
+class HarddiskWait(Screen):
+       def doInit(self):
+               self.timer.stop()
+               self.hdd.initialize()
+               self.close()
+
+       def __init__(self, session, hdd):
+               Screen.__init__(self, session)
+               self.hdd = hdd
+               self["wait"] = Label("Initializing Harddisk...");
+               self.timer = eTimer()
+               self.timer.timeout.get().append(self.doInit)
+               self.timer.start(100)
 
 class HarddiskSetup(Screen):
        def __init__(self, session, hdd):
@@ -26,9 +41,12 @@ class HarddiskSetup(Screen):
                        "red": self.hddInitialize
                })
 
+       def hddReady(self):
+               self.close()
+
        def hddInitialize(self):
                print "this will start the initialize now!"
-               self.hdd.initialize()
+               self.session.openWithCallback(self.hddReady, HarddiskWait, self.hdd)
 
 class HarddiskSelection(Screen):
        def __init__(self, session):