[DVDBurn] usability improvements: title list layout, bottom info area, consistency...
[enigma2.git] / lib / python / Plugins / Extensions / DVDBurn / TitleProperties.py
old mode 100644 (file)
new mode 100755 (executable)
index 86d21c2..956f054
@@ -9,7 +9,7 @@ from Components.Sources.StaticText import StaticText
 from Components.Sources.Progress import Progress
 from Components.FileList import FileList
 from Components.Pixmap import Pixmap
-from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT, ePicLoad
+from enigma import 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
@@ -18,16 +18,18 @@ import DVDTitle
 
 class TitleProperties(Screen,ConfigListScreen):
        skin = """
-               <screen position="90,83" size="560,445" title="Properties of current title" >
-                   <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
-                   <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
-                   <ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" alphatest="on" />
-                   <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
-                   <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
-                   <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
-                   <widget source="serviceinfo" render="Label" position="10,46" size="350,144" font="Regular;18" />
-                   <widget name="thumbnail" position="370,46" size="180,144" alphatest="on" />
-                   <widget name="config" position="10,206" size="540,228" scrollbarMode="showOnDemand" />
+               <screen name="TitleProperties" position="center,center" size="560,445" title="Properties of current title" >
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" alphatest="on" />
+                       <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+                       <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+                       <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
+                       <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
+                       <widget source="serviceinfo" render="Label" position="10,46" size="350,144" font="Regular;18" />
+                       <widget name="thumbnail" position="370,46" size="180,144" alphatest="on" />
+                       <widget name="config" position="10,206" size="540,228" scrollbarMode="showOnDemand" />
                </screen>"""
 
        def __init__(self, session, parent, project, title_idx):
@@ -38,7 +40,8 @@ class TitleProperties(Screen,ConfigListScreen):
 
                self["key_red"] = StaticText(_("Cancel"))
                self["key_green"] = StaticText(_("OK"))
-               self["key_blue"] = StaticText(_("Edit Title"))
+               self["key_yellow"] = StaticText(_("Edit Title"))
+               self["key_blue"] = StaticText()
                self["serviceinfo"] = StaticText()
 
                self["thumbnail"] = Pixmap()
@@ -57,12 +60,16 @@ class TitleProperties(Screen,ConfigListScreen):
                {
                    "green": self.exit,
                    "red": self.cancel,
-                   "blue": self.editTitle,
+                   "yellow": self.editTitle,
                    "cancel": self.cancel,
                    "ok": self.ok,
                }, -2)
                
                self.onShown.append(self.update)
+               self.onLayoutFinish.append(self.layoutFinished)
+
+       def layoutFinished(self):
+               self.setTitle(_("Properties of current title"))
 
        def initConfigList(self, element=None):
                try:
@@ -160,7 +167,8 @@ class LanguageChoices():
                self.choices.sort()
                self.choices.insert(0,("nolang", ("unspecified")))
                self.choices.insert(1,(syslang, self.langdict[syslang]))
-               self.choices.insert(2,("en", self.langdict["en"]))
+               if syslang != "en":
+                       self.choices.insert(2,("en", self.langdict["en"]))
 
        def getLanguage(self, DVB_lang):
                DVB_lang = DVB_lang.lower()