X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FScreens%2FMovieSelection.py;h=15f6b465c62fa0a21a819db6c624a7785cf1532a;hp=5951653ffc38d5bd249e38146d80a79cd6e49d3c;hb=28dcf6be0ee22fedd728fef11ccff484f8a851e8;hpb=153e0ed5048c79c600e1acd085b62015b7314ba7 diff --git a/lib/python/Screens/MovieSelection.py b/lib/python/Screens/MovieSelection.py index 5951653..15f6b46 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): @@ -65,20 +67,20 @@ class MovieContextMenu(Screen): }) menu = [(_("delete..."), self.delete)] - - for p in plugins.getPlugins(PluginDescriptor.WHERE_MOVIELIST): - menu.append((p.description, boundFunction(self.execPlugin, p))) - + menu.extend([(p.description, boundFunction(self.execPlugin, p)) for p in plugins.getPlugins(PluginDescriptor.WHERE_MOVIELIST)]) + if config.movielist.moviesort.value == MovieList.SORT_ALPHANUMERIC: menu.append((_("sort by date"), boundFunction(self.sortBy, MovieList.SORT_RECORDED))) else: menu.append((_("alphabetic sort"), boundFunction(self.sortBy, MovieList.SORT_ALPHANUMERIC))) - menu.append((_("list style default"), boundFunction(self.listType, MovieList.LISTTYPE_ORIGINAL))) - menu.append((_("list style compact with description"), boundFunction(self.listType, MovieList.LISTTYPE_COMPACT_DESCRIPTION))) - menu.append((_("list style compact"), boundFunction(self.listType, MovieList.LISTTYPE_COMPACT))) - menu.append((_("list style single line"), boundFunction(self.listType, MovieList.LISTTYPE_MINIMAL))) - + menu.extend(( + (_("list style default"), boundFunction(self.listType, MovieList.LISTTYPE_ORIGINAL)), + (_("list style compact with description"), boundFunction(self.listType, MovieList.LISTTYPE_COMPACT_DESCRIPTION)), + (_("list style compact"), boundFunction(self.listType, MovieList.LISTTYPE_COMPACT)), + (_("list style single line"), boundFunction(self.listType, MovieList.LISTTYPE_MINIMAL)) + )) + if config.movielist.description.value == MovieList.SHOW_DESCRIPTION: menu.append((_("hide extended description"), boundFunction(self.showDescription, MovieList.HIDE_DESCRIPTION))) else: @@ -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