aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens/MovieSelection.py
diff options
context:
space:
mode:
authorFelix Domke <felix.domke@multimedia-labs.de>2009-10-29 01:54:31 +0100
committerFelix Domke <felix.domke@multimedia-labs.de>2009-10-29 01:54:31 +0100
commit7560beb3e371704d798259ca1ea927bf4575306c (patch)
tree3aa3341dbf843e064dbf0179b81ee3dca0c36a3b /lib/python/Screens/MovieSelection.py
parentdafa266c71fd625cd5a9bedbea10a47e27c868ad (diff)
downloadenigma2-7560beb3e371704d798259ca1ea927bf4575306c.tar.gz
enigma2-7560beb3e371704d798259ca1ea927bf4575306c.zip
By Anders Holst:
At regular intervalls there are questions in the forum (in at least three or four different threads on only this subject) on how to configure the recording paths so you don't have to set them to the same thing over and over again in e.g EPG timers. People apparently forget to set it, and miss their recordings because the harddisk is full or not built in. They want an easy way to change the default from /hdd/movies/ to a NAS or a USB device. I have rebased the patch in this thread from March 23, added two minor bugfixes, and hopefully made it less controversial by making sure that it only affects the expert setup level. I don't think there should be anything controversial about this patch now, and no known bugs. It only provides functionality that several people are screaming to get. Synopsis: The patch changes the "Timeshift path..." setup dialogue into a "Recording paths..." dialogue where you can easily configure both the timeshift and the other recording paths.
Diffstat (limited to 'lib/python/Screens/MovieSelection.py')
-rw-r--r--lib/python/Screens/MovieSelection.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/python/Screens/MovieSelection.py b/lib/python/Screens/MovieSelection.py
index 174a4f07..15f6b465 100644
--- a/lib/python/Screens/MovieSelection.py
+++ b/lib/python/Screens/MovieSelection.py
@@ -7,8 +7,9 @@ from Components.DiskInfo import DiskInfo
from Components.Pixmap import Pixmap
from Components.Label import Label
from Components.PluginComponent import plugins
-from Components.config import config, ConfigSubsection, ConfigText, ConfigInteger, ConfigLocations
+from Components.config import config, ConfigSubsection, ConfigText, ConfigInteger, ConfigLocations, ConfigSet
from Components.Sources.ServiceEvent import ServiceEvent
+from Components.UsageConfig import defaultMoviePath
from Plugins.Plugin import PluginDescriptor
@@ -31,6 +32,7 @@ config.movielist.last_timer_videodir = ConfigText(default=resolveFilename(SCOPE_
config.movielist.videodirs = ConfigLocations(default=[resolveFilename(SCOPE_HDD)])
config.movielist.first_tags = ConfigText(default="")
config.movielist.second_tags = ConfigText(default="")
+config.movielist.last_selected_tags = ConfigSet([], default=[])
def setPreferredTagEditor(te):
@@ -168,7 +170,10 @@ class MovieSelection(Screen, HelpableScreen, SelectionEventInfo):
HelpableScreen.__init__(self)
self.tags = [ ]
- self.selected_tags = None
+ if selectedmovie:
+ self.selected_tags = config.movielist.last_selected_tags.value
+ else:
+ self.selected_tags = None
self.selected_tags_ele = None
self.movemode = False
@@ -183,8 +188,8 @@ class MovieSelection(Screen, HelpableScreen, SelectionEventInfo):
self["DescriptionBorder"] = Pixmap()
self["DescriptionBorder"].hide()
- if not pathExists(config.movielist.last_videodir.value):
- config.movielist.last_videodir.value = resolveFilename(SCOPE_HDD)
+ if not fileExists(config.movielist.last_videodir.value):
+ config.movielist.last_videodir.value = defaultMoviePath()
config.movielist.last_videodir.save()
self.current_ref = eServiceReference("2:0:1:0:0:0:0:0:0:0:" + config.movielist.last_videodir.value)
@@ -292,6 +297,7 @@ class MovieSelection(Screen, HelpableScreen, SelectionEventInfo):
self.close(None)
def saveconfig(self):
+ config.movielist.last_selected_tags.value = self.selected_tags
config.movielist.moviesort.save()
config.movielist.listtype.save()
config.movielist.description.save()
@@ -339,8 +345,8 @@ class MovieSelection(Screen, HelpableScreen, SelectionEventInfo):
self["list"].setSortType(type)
def reloadList(self, sel = None, home = False):
- if not pathExists(config.movielist.last_videodir.value):
- path = resolveFilename(SCOPE_HDD)
+ if not fileExists(config.movielist.last_videodir.value):
+ path = defaultMoviePath()
config.movielist.last_videodir.value = path
config.movielist.last_videodir.save()
self.current_ref = eServiceReference("2:0:1:0:0:0:0:0:0:0:" + path)
@@ -370,7 +376,7 @@ class MovieSelection(Screen, HelpableScreen, SelectionEventInfo):
def gotFilename(self, res):
if res is not None and res is not config.movielist.last_videodir.value:
- if pathExists(res):
+ if fileExists(res):
config.movielist.last_videodir.value = res
config.movielist.last_videodir.save()
self.current_ref = eServiceReference("2:0:1:0:0:0:0:0:0:0:" + res)
@@ -392,7 +398,7 @@ class MovieSelection(Screen, HelpableScreen, SelectionEventInfo):
def showTagsN(self, tagele):
if not self.tags:
self.showTagWarning()
- elif not tagele or self.selected_tags_ele == tagele or not tagele.value in self.tags:
+ elif not tagele or tagele.value in self.selected_tags or not tagele.value in self.tags:
self.showTagsMenu(tagele)
else:
self.selected_tags_ele = tagele