X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e61975a7c2d349bcc5c372c3ca472ce8da28f6fc..c69c3febf1582fb1bd170bc4b04132354f574cfc:/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py diff --git a/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py b/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py index d5ba6c16..63ae6c1f 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py +++ b/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py @@ -8,10 +8,12 @@ from Components.Sources.List import List from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Progress from Components.FileList import FileList -from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT +from Components.Pixmap import Pixmap +from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT, ePicLoad from Tools.Directories import fileExists, resolveFilename, SCOPE_PLUGINS, SCOPE_FONTS, SCOPE_HDD from Components.config import config, getConfigListEntry, ConfigInteger, ConfigSubsection, ConfigSelection from Components.ConfigList import ConfigListScreen +from Components.AVSwitch import AVSwitch import DVDTitle class TitleProperties(Screen,ConfigListScreen): @@ -23,9 +25,9 @@ class TitleProperties(Screen,ConfigListScreen): - - - + + + """ def __init__(self, session, parent, project, title_idx): @@ -37,9 +39,12 @@ class TitleProperties(Screen,ConfigListScreen): self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) self["key_blue"] = StaticText(_("Edit Title")) - self["serviceinfo_headline"] = StaticText("DVB info:") self["serviceinfo"] = StaticText() + self["thumbnail"] = Pixmap() + self.picload = ePicLoad() + self.picload.PictureData.get().append(self.paintThumbPixmapCB) + self.properties = project.titles[title_idx].properties ConfigListScreen.__init__(self, []) self.properties.crop = DVDTitle.ConfigFixedText("crop") @@ -47,8 +52,6 @@ class TitleProperties(Screen,ConfigListScreen): self.properties.aspect.addNotifier(self.initConfigList) for audiotrack in self.properties.audiotracks: audiotrack.active.addNotifier(self.initConfigList) - - self.initConfigList() self["setupActions"] = ActionMap(["SetupActions", "ColorActions"], { @@ -58,6 +61,8 @@ class TitleProperties(Screen,ConfigListScreen): "cancel": self.cancel, "ok": self.ok, }, -2) + + self.onShown.append(self.update) def initConfigList(self, element=None): try: @@ -79,18 +84,15 @@ class TitleProperties(Screen,ConfigListScreen): self.list.append(getConfigListEntry("DVD " + "widescreen", self.properties.widescreen)) else: self.list.append(getConfigListEntry("DVD " + "widescreen", self.properties.crop)) - - infotext = _("Available format variables") + ":\n$i=" + _("Track") + ", $t=" + _("Title") + ", $d=" + _("Description") + ", $l=" + _("length") + ", $c=" + _("chapters") + ",\n" + _("Record") + " $T=" + _("Begin time") + ", $Y=" + _("year") + ", $M=" + _("month") + ", $D=" + _("day") + ",\n$A=" + _("audio tracks") + ", $C=" + _("Channel") + ", $f=" + _("filename") - self["info"] = StaticText(infotext) - + if len(title.chaptermarks) == 0: self.list.append(getConfigListEntry(_("Auto chapter split every ? minutes (0=never)"), self.properties.autochapter)) - infotext = _("Title") + ': ' + title.DVBname + "\n" + _("Description") + ': ' + title.DVBdescr + "\n" + _("Channel") + ': ' + title.DVBchannel + infotext = "DVB " + _("Title") + ': ' + title.DVBname + "\n" + _("Description") + ': ' + title.DVBdescr + "\n" + _("Channel") + ': ' + title.DVBchannel + '\n' + _("Begin time") + title.formatDVDmenuText(": $D.$M.$Y, $T\n", self.title_idx+1) chaptermarks = title.getChapterMarks(template="$h:$m:$s") chapters_count = len(chaptermarks) if chapters_count >= 1: - infotext += ', ' + str(chapters_count+1) + ' ' + _("chapters") + ' (' - infotext += ' / '.join(chaptermarks) + ')' + infotext += '\n' + str(chapters_count+1) + ' ' + _("chapters") + ': ' + infotext += ' / '.join(chaptermarks) self["serviceinfo"].setText(infotext) self["config"].setList(self.list) except AttributeError: @@ -98,7 +100,22 @@ class TitleProperties(Screen,ConfigListScreen): def editTitle(self): self.parent.editTitle() + + def update(self): + print "[onShown]" self.initConfigList() + self.loadThumb() + + def loadThumb(self): + thumbfile = self.project.titles[self.title_idx].inputfile.rsplit('.',1)[0] + ".png" + sc = AVSwitch().getFramebufferScale() + self.picload.setPara((self["thumbnail"].instance.size().width(), self["thumbnail"].instance.size().height(), sc[0], sc[1], False, 1, "#00000000")) + self.picload.startDecode(thumbfile) + + def paintThumbPixmapCB(self, picInfo=None): + ptr = self.picload.getData() + if ptr != None: + self["thumbnail"].instance.setPixmap(ptr.__deref__()) def changedConfigList(self): self.initConfigList()