X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/189694cba5501834e95e4fb6b38b0b97ffbc04ac..2c862a6323b51e446270ee3b6845ed234ed8771d:/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py
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 f95bbc36..39d7277e
--- a/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py
+++ b/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py
@@ -8,18 +8,17 @@ 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 Tools.Directories import fileExists, resolveFilename, SCOPE_PLUGINS, SCOPE_FONTS, SCOPE_HDD
from Components.config import config, getConfigListEntry
from Components.ConfigList import ConfigListScreen
class FileBrowser(Screen, HelpableScreen):
- skin = """
-
-
- """
+
def __init__(self, session, scope, configRef):
Screen.__init__(self, session)
+ # for the skin: first try FileBrowser_DVDBurn, then FileBrowser, this allows individual skinning
+ self.skinName = ["FileBrowser_DVDBurn", "FileBrowser" ]
+
HelpableScreen.__init__(self)
self.scope = scope
pattern = ""
@@ -52,11 +51,18 @@ class FileBrowser(Screen, HelpableScreen):
self.filelist = FileList(currDir, matchingPattern=pattern)
self["filelist"] = self.filelist
- self["FilelistActions"] = ActionMap(["OkCancelActions"],
+ self["FilelistActions"] = ActionMap(["SetupActions"],
{
+ "save": self.ok,
"ok": self.ok,
"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:
@@ -81,17 +87,18 @@ class FileBrowser(Screen, HelpableScreen):
class ProjectSettings(Screen,ConfigListScreen):
skin = """
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
"""
def __init__(self, session, project = None):
@@ -126,6 +133,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]]
@@ -222,11 +233,19 @@ class ProjectSettings(Screen,ConfigListScreen):
else:
self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
elif scope == "project":
- if self.project.loadProject(path):
- configRef.setValue(path)
- self.initConfigList()
+ self.path = path
+ print "len(self.titles)", len(self.project.titles)
+ if len(self.project.titles):
+ self.session.openWithCallback(self.askLoadCB, MessageBox,text = _("Your current collection will get lost!") + "\n" + _("Do you want to restore your settings?"), type = MessageBox.TYPE_YESNO)
else:
- self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
+ self.askLoadCB(True)
elif scope:
configRef.setValue(path)
self.initConfigList()
+
+ def askLoadCB(self, answer):
+ if answer is not None and answer:
+ if self.project.loadProject(self.path):
+ self.initConfigList()
+ else:
+ self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
\ No newline at end of file