[DVDBurn] usability improvements: title list layout, bottom info area, consistency...
[enigma2.git] / lib / python / Plugins / Extensions / DVDBurn / TitleCutter.py
index 210a3d58bac36a62ecb741af4146f5c83b370f8a..a52fad9f12785bc52926c3b34dc8a8174ac07c08 100644 (file)
@@ -1,6 +1,7 @@
 from Plugins.Extensions.CutListEditor.plugin import CutListEditor
 from Components.ServiceEventTracker import ServiceEventTracker
 from enigma import iPlayableService, iServiceInformation
+from Tools.Directories import fileExists
 
 class TitleCutter(CutListEditor):
        def __init__(self, session, t):
@@ -46,14 +47,42 @@ class TitleCutter(CutListEditor):
                self.t.properties.aspect.setValue(aspect)
                self.t.VideoType = service.info().getInfo(iServiceInformation.sVideoType)
 
+       def checkAndGrabThumb(self):
+               if not fileExists(self.t.inputfile.rsplit('.',1)[0] + ".png"):
+                       CutListEditor.grabFrame(self)
+
        def exit(self):
+               if self.t.VideoType == -1:
+                       self.getPMTInfo()
+               self.checkAndGrabThumb()
                self.session.nav.stopService()
                self.close(self.cut_list[:])
 
 class CutlistReader(TitleCutter):
+       skin = """
+               <screen position="0,0" size="720,576">
+               <eLabel position="0,0" size="720,576" zPosition="1" backgroundColor="#000000" />
+               <widget name="Video" position="0,0" size="100,75" />
+               <widget name="SeekState" position="0,0" />
+               <widget source="cutlist" position="0,0" render="Listbox" >
+                       <convert type="TemplatedMultiContent">
+                               {"template": [
+                                               MultiContentEntryText(text = 1),
+                                               MultiContentEntryText(text = 2)
+                                       ],
+                                "fonts": [gFont("Regular", 18)],
+                                "itemHeight": 20
+                               }
+                       </convert>
+               </widget>
+               <widget name="Timeline" position="0,0" />
+       </screen>"""
+
        def __init__(self, session, t):
                TitleCutter.__init__(self, session, t)
+               self.skin = CutlistReader.skin
 
        def getPMTInfo(self):
                TitleCutter.getPMTInfo(self)
+               TitleCutter.checkAndGrabThumb(self)
                self.close(self.cut_list[:])