fix wrong free capacity reading on blank dvd(-/+)r
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>
Wed, 22 Oct 2008 14:50:32 +0000 (14:50 +0000)
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>
Wed, 22 Oct 2008 14:50:32 +0000 (14:50 +0000)
lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py

index 058c30ca57b97c49b0aca7c9302d33c5886d45bc..c0cec2197e936e3b306868b7cd4935f97983a5b2 100644 (file)
@@ -42,7 +42,7 @@ class DVDToolbox(Screen):
                self["details"] = ScrollLabel()
                self["info"] = StaticText()
 
                self["details"] = ScrollLabel()
                self["info"] = StaticText()
 
-               self["toolboxactions"] = ActionMap(["ColorActions", "DVDToolbox"],
+               self["toolboxactions"] = ActionMap(["ColorActions", "DVDToolbox", "OkCancelActions"],
                {
                    "red": self.close,
                    "green": self.update,
                {
                    "red": self.close,
                    "green": self.update,
@@ -100,8 +100,9 @@ class DVDToolbox(Screen):
                                except:
                                        size = 0
                                if size > 0:
                                except:
                                        size = 0
                                if size > 0:
-                                       capacity = size
-                                       used = capacity-used                            
+                                       capacity = size / 1048576
+                                       if used:
+                                               used = capacity-used
                                        print "[free blocks] capacity=%d, used=%d" % (capacity, used)
                        infotext += line
                self["details"].setText(infotext)
                                        print "[free blocks] capacity=%d, used=%d" % (capacity, used)
                        infotext += line
                self["details"].setText(infotext)