From 97164baf8ea068ec7c4326d656c5c8f5ba262750 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Tue, 6 Oct 2009 16:47:55 +0200 Subject: [PATCH] Extensions/DVDBurn: - use center,center for screens where possible - replace some Lables through StaticText - remove unused Buttons - minor Skin alignments - use own Skin for adding a Title to the DVD, this changes button actions.(Red is now close, green is add and yellow edit) --- .../Plugins/Extensions/DVDBurn/DVDToolbox.py | 12 +-- .../Plugins/Extensions/DVDBurn/ProjectSettings.py | 45 ++++++++---- lib/python/Plugins/Extensions/DVDBurn/TitleList.py | 85 ++++++++++++++-------- .../Plugins/Extensions/DVDBurn/TitleProperties.py | 24 +++--- 4 files changed, 107 insertions(+), 59 deletions(-) mode change 100644 => 100755 lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py mode change 100644 => 100755 lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py mode change 100644 => 100755 lib/python/Plugins/Extensions/DVDBurn/TitleList.py mode change 100644 => 100755 lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py diff --git a/lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py b/lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py old mode 100644 new mode 100755 index ce16259..feb39a9 --- a/lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py +++ b/lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py @@ -13,15 +13,13 @@ from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier class DVDToolbox(Screen): skin = """ - + - - @@ -34,7 +32,6 @@ class DVDToolbox(Screen): self["key_red"] = StaticText(_("Exit")) self["key_green"] = StaticText(_("Update")) self["key_yellow"] = StaticText() - self["key_blue"] = StaticText() self["space_label"] = StaticText() self["space_bar"] = Progress() @@ -49,14 +46,17 @@ class DVDToolbox(Screen): "red": self.exit, "green": self.update, "yellow": self.format, - #"blue": self.eject, "cancel": self.exit, "pageUp": self.pageUp, "pageDown": self.pageDown }) self.update() hotplugNotifier.append(self.update) - + self.onLayoutFinish.append(self.layoutFinished) + + def layoutFinished(self): + self.setTitle(_("DVD media toolbox")) + def pageUp(self): self["details"].pageUp() diff --git a/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py b/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py old mode 100644 new mode 100755 index f95bbc3..9b4e2d5 --- a/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py +++ b/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py @@ -15,9 +15,14 @@ from Components.ConfigList import ConfigListScreen class FileBrowser(Screen, HelpableScreen): skin = """ - - - """ + + + + + + + """ + def __init__(self, session, scope, configRef): Screen.__init__(self, session) HelpableScreen.__init__(self) @@ -58,6 +63,13 @@ class FileBrowser(Screen, HelpableScreen): "cancel": self.exit }) + self["key_red"] = StaticText(_("Cancel")) + self["key_green"] = StaticText(_("OK")) + self.onLayoutFinish.append(self.layoutFinished) + + def layoutFinished(self): + self.setTitle(_("DVD File Browser")) + def getDir(self, currentVal=None, defaultDir=None): if currentVal: return (currentVal.rstrip("/").rsplit("/",1))[0] @@ -81,17 +93,18 @@ class FileBrowser(Screen, HelpableScreen): class ProjectSettings(Screen,ConfigListScreen): skin = """ - - - - - - - - - - - + + + + + + + + + + + + """ def __init__(self, session, project = None): @@ -126,6 +139,10 @@ class ProjectSettings(Screen,ConfigListScreen): "cancel": self.cancel, "ok": self.ok, }, -2) + self.onLayoutFinish.append(self.layoutFinished) + + def layoutFinished(self): + self.setTitle(_("Collection settings")) def changedConfigList(self): key = self.keydict[self["config"].getCurrent()[1]] diff --git a/lib/python/Plugins/Extensions/DVDBurn/TitleList.py b/lib/python/Plugins/Extensions/DVDBurn/TitleList.py old mode 100644 new mode 100755 index 83bafd7..928a8b8 --- a/lib/python/Plugins/Extensions/DVDBurn/TitleList.py +++ b/lib/python/Plugins/Extensions/DVDBurn/TitleList.py @@ -10,28 +10,27 @@ from Components.ActionMap import HelpableActionMap, ActionMap from Components.Sources.List import List from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Progress -from Components.Label import Label from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT from Tools.Directories import resolveFilename, SCOPE_PLUGINS class TitleList(Screen, HelpableScreen): skin = """ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + """ def __init__(self, session, project = None): @@ -63,7 +62,7 @@ class TitleList(Screen, HelpableScreen): self["key_blue"] = StaticText(_("Settings")) self["title_label"] = StaticText() - self["error_label"] = Label("") + self["error_label"] = StaticText() self["space_label"] = StaticText() self["space_bar"] = Progress() @@ -75,6 +74,10 @@ class TitleList(Screen, HelpableScreen): self["titles"] = List(list = [ ], enableWrapAround = True, item_height=30, fonts = [gFont("Regular", 20)]) self.updateTitleList() self.previous_size = 0 + self.onLayoutFinish.append(self.layoutFinished) + + def layoutFinished(self): + self.setTitle(_("DVD Titlelist")) def checkBackgroundJobs(self): for job in job_manager.getPendingJobs(): @@ -128,18 +131,43 @@ class TitleList(Screen, HelpableScreen): def addTitle(self): from Screens.MovieSelection import MovieSelection - from Components.Button import Button from Components.ActionMap import HelpableActionMap - class MovieSelectionNoMenu(MovieSelection): + class DVDMovieSelection(MovieSelection): + skin = """ + + + + + + + + + + + ShortDescription + + + Duration + AsLength + + + RecordServiceName + + + ExtendedDescription + + + """ def __init__(self, session): MovieSelection.__init__(self, session) - self.skinName = "MovieSelection" - self["key_red"] = Button(_("Edit title")) - self["key_green"] = Button(_("Add")) + self["key_red"] = StaticText(_("Close")) + self["key_green"] = StaticText(_("Add")) + self["key_yellow"] = StaticText(_("Edit title")) self["ColorActions"] = HelpableActionMap(self, "ColorActions", { - "red": (self.movieSelected, _("Add a new title")), - "green": (self.insertWithoutEdit, ("insert without cutlist editor")) + "red": (self.close, _("Close title selection")), + "green": (self.insertWithoutEdit, ("insert without cutlist editor")), + "yellow": (self.movieSelected, _("Add a new title")) }) def updateTags(self): pass @@ -155,7 +183,7 @@ class TitleList(Screen, HelpableScreen): if current is not None: current.edit = True self.close(current) - self.session.openWithCallback(self.selectedSource, MovieSelectionNoMenu) + self.session.openWithCallback(self.selectedSource, DVDMovieSelection) def selectedSource(self, source): if source is None: @@ -190,11 +218,10 @@ class TitleList(Screen, HelpableScreen): def loadTemplate(self): filename = resolveFilename(SCOPE_PLUGINS)+"Extensions/DVDBurn/DreamboxDVD.ddvdp.xml" if self.project.load(filename): - self["error_label"].hide() + self["error_label"].setText("") return True else: - self["error_label"].text = self.project.error - self["error_label"].show() + self["error_label"].setText(self.project.error) return False def askBurnProject(self): diff --git a/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py b/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py old mode 100644 new mode 100755 index 86d21c2..11601cc --- a/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py +++ b/lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py @@ -18,16 +18,16 @@ import DVDTitle class TitleProperties(Screen,ConfigListScreen): skin = """ - - - - - - - - - - + + + + + + + + + + """ def __init__(self, session, parent, project, title_idx): @@ -63,6 +63,10 @@ class TitleProperties(Screen,ConfigListScreen): }, -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: -- 2.7.4