Merge branch 'bug_245_record_playback_fixes' into experimental
authorghost <andreas.monzner@multimedia-labs.de>
Tue, 3 Nov 2009 18:53:05 +0000 (19:53 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Tue, 3 Nov 2009 18:53:05 +0000 (19:53 +0100)
19 files changed:
RecordTimer.py
data/menu.xml
data/setup.xml
lib/python/Components/AVSwitch.py
lib/python/Components/FileList.py
lib/python/Components/Harddisk.py
lib/python/Components/NimManager.py
lib/python/Components/UsageConfig.py
lib/python/Components/config.py
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
lib/python/Screens/EpgSelection.py
lib/python/Screens/EventView.py
lib/python/Screens/InfoBar.py
lib/python/Screens/InfoBarGenerics.py
lib/python/Screens/LocationBox.py
lib/python/Screens/MovieSelection.py
lib/python/Screens/TimerEdit.py
lib/python/Screens/TimerEntry.py
lib/service/servicemp3.cpp

index 4907f64..f670417 100644 (file)
@@ -2,6 +2,7 @@ from enigma import eEPGCache, getBestPlayableServiceReference, \
        eServiceReference, iRecordableService, quitMainloop
 
 from Components.config import config
+from Components.UsageConfig import defaultMoviePath
 from Components.TimerSanityCheck import TimerSanityCheck
 
 from Screens.MessageBox import MessageBox
@@ -141,11 +142,13 @@ class RecordTimerEntry(timer.TimerEntry, object):
                if config.recording.ascii_filenames.value:
                        filename = ASCIItranslit.legacyEncode(filename)
 
-               if self.dirname and not Directories.fileExists(self.dirname, 'w'):
-                       self.dirnameHadToFallback = True
-                       self.Filename = Directories.getRecordingFilename(filename, None)
+               if not self.dirname or not Directories.fileExists(self.dirname, 'w'):
+                       if self.dirname:
+                               self.dirnameHadToFallback = True
+                       dirname = defaultMoviePath()
                else:
-                       self.Filename = Directories.getRecordingFilename(filename, self.dirname)
+                       dirname = self.dirname
+               self.Filename = Directories.getRecordingFilename(filename, dirname)
                self.log(0, "Filename calculated as: '%s'" % self.Filename)
                #begin_date + " - " + service_name + description)
 
index c7fb889..403e0b8 100644 (file)
@@ -70,7 +70,7 @@
                                        <item level="1" text="Device Setup..." entryID="device_setup"><screen module="NetworkSetup" screen="NetworkAdapterSelection"/></item>
                                        <item level="1" text="Nameserver Setup..." entryID="dns_setup"><screen module="NetworkSetup" screen="NameserverSetup"/></item>
                                </menu>-->
-                               <item level="2" text="Timeshift path..." entryId="timeshift_path"><screen module="LocationBox" screen="TimeshiftLocationBox" /></item>
+                               <item level="2" text="Recording paths..." entryId="RecordPaths"><screen module="RecordPaths" screen="RecordPathsSettings" /></item>
                        </menu>
                        <item weight="10" level="1" text="Common Interface" entryID="ci_setup" requires="CommonInterface"><screen module="Ci" screen="CiSelection" /></item>
                        <item weight="15" level="0" text="Parental control" entryID="parental_setup"><screen module="ParentalControlSetup" screen="ParentalControlSetup" /></item>
index fe91ba2..9425afd 100644 (file)
@@ -13,8 +13,8 @@
                        <item level="0" text="TV System">config.av.tvsystem</item>
                        <item level="1" text="WSS on 4:3">config.av.wss</item>
                        <item level="1" text="AC3 default">config.av.defaultac3</item>
-                       <item level="1" text="General AC3 delay">config.av.generalAC3delay</item>
-                       <item level="1" text="General PCM delay">config.av.generalPCMdelay</item>
+                       <item level="1" text="General AC3 delay (ms)">config.av.generalAC3delay</item>
+                       <item level="1" text="General PCM delay (ms)">config.av.generalPCMdelay</item>
                        <item level="1" text="AC3 downmix" requires="CanDownmixAC3">config.av.downmix_ac3</item>
                        <item level="1" text="Auto scart switching" requires="ScartSwitch">config.av.vcrswitch</item>
                </setup>
                        <item level="0" text="Brightness">config.lcd.bright</item>
                        <item level="0" text="Contrast">config.lcd.contrast</item>
                        <item level="0" text="Standby">config.lcd.standby</item>
-                       <item level="2" text="Invert display">config.lcd.invert</item>
                </setup>
                <setup key="satconfig" title="Sat / Dish Setup">
                        <item text="Tuner Slot">config.sat.tunerslot</item>
index bc2a66a..2658f9b 100644 (file)
@@ -1,5 +1,5 @@
 from config import config, ConfigSlider, ConfigSelection, ConfigYesNo, \
-       ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigNumber, ConfigNothing, NoSave
+       ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigSelectionNumber, ConfigNothing, NoSave
 from enigma import eAVSwitch, getDesktop
 from SystemInfo import SystemInfo
 from os import path as os_path
@@ -112,8 +112,8 @@ def InitAVSwitch():
        config.av.tvsystem = ConfigSelection(choices = {"pal": _("PAL"), "ntsc": _("NTSC"), "multinorm": _("multinorm")}, default="pal")
        config.av.wss = ConfigEnableDisable(default = True)
        config.av.defaultac3 = ConfigYesNo(default = False)
-       config.av.generalAC3delay = ConfigNumber(default = 0)
-       config.av.generalPCMdelay = ConfigNumber(default = 0)
+       config.av.generalAC3delay = ConfigSelectionNumber(-1000, 1000, 25, default = 0)
+       config.av.generalPCMdelay = ConfigSelectionNumber(-1000, 1000, 25, default = 0)
        config.av.vcrswitch = ConfigEnableDisable(default = False)
 
        iAVSwitch = AVSwitch()
index 54bb1ac..a0f66bd 100755 (executable)
@@ -3,7 +3,7 @@ from os import path as os_path, listdir
 from MenuList import MenuList
 from Components.Harddisk import harddiskmanager
 
-from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
+from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename, fileExists
 
 from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, \
        eServiceReference, eServiceCenter, gFont
@@ -159,8 +159,11 @@ class FileList(MenuList):
                        directories.sort()
                        files.sort()
                else:
-                       if os_path.exists(directory):
-                               files = listdir(directory)
+                       if fileExists(directory):
+                               try:
+                                       files = listdir(directory)
+                               except:
+                                       files = []
                                files.sort()
                                tmpfiles = files[:]
                                for x in tmpfiles:
@@ -373,8 +376,11 @@ class MultiFileSelectList(FileList):
                        directories.sort()
                        files.sort()
                else:
-                       if os_path.exists(directory):
-                               files = listdir(directory)
+                       if fileExists(directory):
+                               try:
+                                       files = listdir(directory)
+                               except:
+                                       files = []
                                files.sort()
                                tmpfiles = files[:]
                                for x in tmpfiles:
index 2efdb68..03f574f 100755 (executable)
@@ -290,7 +290,10 @@ class Harddisk:
        # any access has been made to the disc. If there has been no access over a specifed time,
        # we set the hdd into standby.
        def readStats(self):
-               l = readFile("/sys/block/%s/stat" % self.device)
+               try:
+                       l = open("/sys/block/%s/stat" % self.device).read()
+               except IOError:
+                       return -1,-1
                (nr_read, _, _, _, nr_write) = l.split()[:5]
                return int(nr_read), int(nr_write)
 
@@ -319,7 +322,7 @@ class Harddisk:
                l = sum(stats)
                print "sum", l, "prev_sum", self.last_stat
 
-               if l != self.last_stat: # access
+               if l != self.last_stat and l >= 0: # access
                        print "hdd was accessed since previous check!"
                        self.last_stat = l
                        self.last_access = t
index 70cde47..5154e2b 100644 (file)
@@ -939,7 +939,7 @@ def InitNimManager(nimmgr):
 
        lnb_choices = {
                "universal_lnb": _("Universal LNB"),
-               "unicable": _("Unicable"),
+#              "unicable": _("Unicable"),
                "c_band": _("C-Band"),
                "user_defined": _("User defined")}
 
index 6fcab8b..680b594 100644 (file)
@@ -1,5 +1,6 @@
 from Components.Harddisk import harddiskmanager
 from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigNumber, ConfigSet, ConfigLocations
+from Tools.Directories import resolveFilename, SCOPE_HDD
 from enigma import Misc_Options, setTunerTypePriorityOrder;
 from SystemInfo import SystemInfo
 import os
@@ -30,8 +31,11 @@ def InitUsageConfig():
                ("standard", _("standard")), ("swap", _("swap PiP and main picture")),
                ("swapstop", _("move PiP to main picture")), ("stop", _("stop PiP")) ])
 
+       config.usage.default_path = ConfigText(default = resolveFilename(SCOPE_HDD))
+       config.usage.timer_path = ConfigText(default = "<default>")
+       config.usage.instantrec_path = ConfigText(default = "<default>")
+       config.usage.timeshift_path = ConfigText(default = "/media/hdd/")
        config.usage.allowed_timeshift_paths = ConfigLocations(default = ["/media/hdd/"])
-       config.usage.timeshift_path = ConfigText(default = "/media/hdd")
 
        config.usage.on_movie_start = ConfigSelection(default = "ask", choices = [
                ("ask", _("Ask user")), ("resume", _("Resume from last position")), ("beginning", _("Start from the beginning")) ])
@@ -65,19 +69,19 @@ def InitUsageConfig():
        
        def TunerTypePriorityOrderChanged(configElement):
                setTunerTypePriorityOrder(int(configElement.value))
-       config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged)
+       config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged, immediate_feedback=False)
 
        def setHDDStandby(configElement):
                for hdd in harddiskmanager.HDDList():
                        hdd[1].setIdleTime(int(configElement.value))
-       config.usage.hdd_standby.addNotifier(setHDDStandby)
+       config.usage.hdd_standby.addNotifier(setHDDStandby, immediate_feedback=False)
 
        def set12VOutput(configElement):
                if configElement.value == "on":
                        Misc_Options.getInstance().set_12V_output(1)
                elif configElement.value == "off":
                        Misc_Options.getInstance().set_12V_output(0)
-       config.usage.output_12V.addNotifier(set12VOutput)
+       config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)
 
        SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
 
@@ -128,3 +132,23 @@ def updateChoices(sel, choices):
                                        defval = str(x)
                                        break
                sel.setChoices(map(str, choices), defval)
+
+def preferredPath(path):
+       if config.usage.setup_level.index < 2 or path == "<default>":
+               return None  # config.usage.default_path.value, but delay lookup until usage
+       elif path == "<current>":
+               return config.movielist.last_videodir.value
+       elif path == "<timer>":
+               return config.movielist.last_timer_videodir.value
+       else:
+               return path
+
+def preferredTimerPath():
+       return preferredPath(config.usage.timer_path.value)
+
+def preferredInstantRecordPath():
+       return preferredPath(config.usage.instantrec_path.value)
+
+def defaultMoviePath():
+       return config.usage.default_path.value
+
index e249caf..876e3a3 100755 (executable)
@@ -1,6 +1,6 @@
 from enigma import getPrevAsciiCode
 from Tools.NumericalTextInput import NumericalTextInput
-from Tools.Directories import resolveFilename, SCOPE_CONFIG
+from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists
 from Components.Harddisk import harddiskmanager
 from copy import copy as copy_copy
 from os import path as os_path
@@ -1017,6 +1017,42 @@ class ConfigPassword(ConfigText):
                ConfigText.onDeselect(self, session)
                self.hidden = True
 
+# lets the user select between [min, min+stepwidth, min+(stepwidth*2)..., maxval] with maxval <= max depending
+# on the stepwidth
+# min, max, stepwidth, default are int values
+# wraparound: pressing RIGHT key at max value brings you to min value and vice versa if set to True
+class ConfigSelectionNumber(ConfigSelection):
+       def __init__(self, min, max, stepwidth, default = None, wraparound = False):
+               self.wraparound = wraparound
+               if default is None:
+                       default = min
+               default = str(default)
+               choices = []
+               step = min
+               while step <= max:
+                       choices.append(str(step))
+                       step += stepwidth
+               
+               ConfigSelection.__init__(self, choices, default)
+               
+       def getValue(self):
+               return int(self.text)
+
+       def setValue(self, val):
+               self.text = str(val)
+               
+       def handleKey(self, key):
+               if not self.wraparound:
+                       if key == KEY_RIGHT:
+                               if len(self.choices) == (self.choices.index(self.value) + 1):
+                                       return
+                       if key == KEY_LEFT:
+                               if self.choices.index(self.value) == 0:
+                                       return
+               ConfigSelection.handleKey(self, key)
+                               
+                               
+
 class ConfigNumber(ConfigText):
        def __init__(self, default = 0):
                ConfigText.__init__(self, str(default), fixed_size = False)
@@ -1249,7 +1285,6 @@ class ConfigLocations(ConfigElement):
                self.default = default
                self.locations = []
                self.mountpoints = []
-               harddiskmanager.on_partition_list_change.append(self.mountpointsChanged)
                self.value = default[:]
 
        def setValue(self, value):
@@ -1286,7 +1321,7 @@ class ConfigLocations(ConfigElement):
                locations = [[x, None, False, False] for x in tmp]
                self.refreshMountpoints()
                for x in locations:
-                       if os_path.exists(x[0]):
+                       if fileExists(x[0]):
                                x[1] = self.getMountpoint(x[0])
                                x[2] = True
                self.locations = locations
@@ -1305,20 +1340,11 @@ class ConfigLocations(ConfigElement):
                        return False
                return self.tostring([x[0] for x in locations]) != sv
 
-       def mountpointsChanged(self, action, dev):
-               print "Mounts changed: ", action, dev
-               mp = dev.mountpoint+"/"
-               if action == "add":
-                       self.addedMount(mp)
-               elif action == "remove":
-                       self.removedMount(mp)
-               self.refreshMountpoints()
-
        def addedMount(self, mp):
                for x in self.locations:
                        if x[1] == mp:
                                x[2] = True
-                       elif x[1] == None and os_path.exists(x[0]):
+                       elif x[1] == None and fileExists(x[0]):
                                x[1] = self.getMountpoint(x[0])
                                x[2] = True
 
@@ -1328,7 +1354,7 @@ class ConfigLocations(ConfigElement):
                                x[2] = False
 
        def refreshMountpoints(self):
-               self.mountpoints = [p.mountpoint + "/" for p in harddiskmanager.getMountedPartitions() if p.mountpoint != "/"]
+               self.mountpoints = [p.mountpoint for p in harddiskmanager.getMountedPartitions() if p.mountpoint != "/"]
                self.mountpoints.sort(key = lambda x: -len(x))
 
        def checkChangedMountpoints(self):
index 596f2d5..0e3bdf0 100644 (file)
@@ -110,7 +110,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
 
                # 'None' is magic to start at the list of mountpoints
                defaultDir = config.mediaplayer.defaultDir.getValue()
-               self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|m2ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
+               self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
                self["filelist"] = self.filelist
 
                self.playlist = MyPlayList()
index 3dde7e2..f8edba1 100644 (file)
@@ -6,6 +6,7 @@ from Components.Label import Label
 from Components.EpgList import EPGList, EPG_TYPE_SINGLE, EPG_TYPE_SIMILAR, EPG_TYPE_MULTI
 from Components.ActionMap import ActionMap
 from Components.TimerSanityCheck import TimerSanityCheck
+from Components.UsageConfig import preferredTimerPath
 from Components.Sources.ServiceEvent import ServiceEvent
 from Components.Sources.Event import Event
 from Screens.TimerEdit import TimerSanityConflict
@@ -235,7 +236,7 @@ class EPGSelection(Screen):
                                self.session.openWithCallback(cb_func, MessageBox, _("Do you really want to delete %s?") % event.getEventName())
                                break
                else:
-                       newEntry = RecordTimerEntry(serviceref, checkOldTimers = True, *parseEvent(event))
+                       newEntry = RecordTimerEntry(serviceref, checkOldTimers = True, dirname = preferredTimerPath(), *parseEvent(event))
                        self.session.openWithCallback(self.finishedAdd, TimerEntry, newEntry)
 
        def finishedAdd(self, answer):
index c1ffb58..cced3ce 100644 (file)
@@ -6,6 +6,7 @@ from Components.Button import Button
 from Components.Label import Label
 from Components.ScrollLabel import ScrollLabel
 from Components.TimerList import TimerList
+from Components.UsageConfig import preferredTimerPath
 from enigma import eEPGCache, eTimer, eServiceReference
 from RecordTimer import RecordTimerEntry, parseEvent, AFTEREVENT
 from TimerEntry import TimerEntry
@@ -85,7 +86,7 @@ class EventViewBase:
                                self.session.openWithCallback(cb_func, MessageBox, _("Do you really want to delete %s?") % event.getEventName())
                                break
                else:
-                       newEntry = RecordTimerEntry(self.currentService, checkOldTimers = True, *parseEvent(self.event))
+                       newEntry = RecordTimerEntry(self.currentService, checkOldTimers = True, dirname = preferredTimerPath(), *parseEvent(self.event))
                        self.session.openWithCallback(self.finishedAdd, TimerEntry, newEntry)
 
        def finishedAdd(self, answer):
index d65eace..a15c7ac 100644 (file)
@@ -16,7 +16,7 @@ from Screens.InfoBarGenerics import InfoBarShowHide, \
        InfoBarSubserviceSelection, InfoBarShowMovies, InfoBarTimeshift,  \
        InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
        InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \
-       InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarSleepTimer, InfoBarServiceErrorPopupSupport, InfoBarJobman
+       InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarServiceErrorPopupSupport, InfoBarJobman
 
 profile("LOAD:InitBar_Components")
 from Components.ActionMap import HelpableActionMap
@@ -32,7 +32,7 @@ class InfoBar(InfoBarBase, InfoBarShowHide,
        HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
        InfoBarSubserviceSelection, InfoBarTimeshift, InfoBarSeek,
        InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions,
-       InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarSleepTimer, InfoBarServiceErrorPopupSupport, InfoBarJobman,
+       InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarServiceErrorPopupSupport, InfoBarJobman,
        Screen):
        
        ALLOW_SUSPEND = True
@@ -56,7 +56,7 @@ class InfoBar(InfoBarBase, InfoBarShowHide,
                                InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
                                InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
                                InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, InfoBarJobman, \
-                               InfoBarSleepTimer, InfoBarPlugins, InfoBarServiceErrorPopupSupport:
+                               InfoBarPlugins, InfoBarServiceErrorPopupSupport:
                        x.__init__(self)
 
                self.helpList.append((self["actions"], "InfobarActions", [("showMovies", _("view recordings..."))]))
@@ -212,7 +212,6 @@ class MoviePlayer(InfoBarBase, InfoBarShowHide, \
                                        return
 
                if answer in ("quit", "quitanddeleteconfirmed"):
-                       config.movielist.last_videodir.cancel()
                        self.close()
                elif answer == "movielist":
                        ref = self.session.nav.getCurrentlyPlayingServiceReference()
index 5336f9a..b98cd46 100644 (file)
@@ -10,6 +10,7 @@ from Components.ServiceEventTracker import ServiceEventTracker
 from Components.Sources.Boolean import Boolean
 from Components.config import config, ConfigBoolean, ConfigClock
 from Components.SystemInfo import SystemInfo
+from Components.UsageConfig import preferredInstantRecordPath, defaultMoviePath
 from EpgSelection import EPGSelection
 from Plugins.Plugin import PluginDescriptor
 
@@ -24,12 +25,11 @@ from Screens.TimerSelection import TimerSelection
 from Screens.PictureInPicture import PictureInPicture
 from Screens.SubtitleDisplay import SubtitleDisplay
 from Screens.RdsDisplay import RdsInfoDisplay, RassInteractive
-from Screens.SleepTimerEdit import SleepTimerEdit
 from Screens.TimeDateInput import TimeDateInput
 from ServiceReference import ServiceReference
 
 from Tools import Notifications
-from Tools.Directories import SCOPE_HDD, resolveFilename, fileExists
+from Tools.Directories import fileExists
 
 from enigma import eTimer, eServiceCenter, eDVBServicePMTHandler, iServiceInformation, \
        iPlayableService, eServiceReference, eEPGCache
@@ -1350,17 +1350,6 @@ class InfoBarJobman:
                job_manager.in_background = in_background
 
 # depends on InfoBarExtensions
-class InfoBarSleepTimer:
-       def __init__(self):
-               self.addExtension((self.getSleepTimerName, self.showSleepTimerSetup, lambda: True), "1")
-
-       def getSleepTimerName(self):
-               return _("Sleep Timer")
-
-       def showSleepTimerSetup(self):
-               self.session.open(SleepTimerEdit)
-
-# depends on InfoBarExtensions
 class InfoBarPiP:
        def __init__(self):
                try:
@@ -1489,7 +1478,7 @@ class InfoBarInstantRecord:
                if isinstance(serviceref, eServiceReference):
                        serviceref = ServiceReference(serviceref)
 
-               recording = RecordTimerEntry(serviceref, begin, end, name, description, eventid, dirname = config.movielist.last_videodir.value)
+               recording = RecordTimerEntry(serviceref, begin, end, name, description, eventid, dirname = preferredInstantRecordPath())
                recording.dontSave = True
                
                if event is None or limitEvent == False:
@@ -1590,9 +1579,9 @@ class InfoBarInstantRecord:
                        self.session.nav.RecordTimer.timeChanged(entry)
 
        def instantRecord(self):
-               dir = config.movielist.last_videodir.value
-               if not fileExists(dir, 'w'):
-                       dir = resolveFilename(SCOPE_HDD)
+               dir = preferredInstantRecordPath()
+               if not dir or not fileExists(dir, 'w'):
+                       dir = defaultMoviePath()
                try:
                        stat = os_stat(dir)
                except:
index 61d7105..29d94f5 100644 (file)
@@ -289,6 +289,11 @@ class LocationBox(Screen, NumericalTextInput, HelpableScreen):
                        else:
                                self["filelist"].refresh()
                                self.removeBookmark(name, True)
+                               val = self.realBookmarks and self.realBookmarks.value
+                               if val and name in val:
+                                       val.remove(name)
+                                       self.realBookmarks.value = val
+                                       self.realBookmarks.save()
 
        def up(self):
                self[self.currList].up()
index 174a4f0..15f6b46 100644 (file)
@@ -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
index caaf8c9..5435498 100644 (file)
@@ -4,6 +4,7 @@ from Components.config import config
 from Components.MenuList import MenuList
 from Components.TimerList import TimerList
 from Components.TimerSanityCheck import TimerSanityCheck
+from Components.UsageConfig import preferredTimerPath
 from RecordTimer import RecordTimerEntry, parseEvent, AFTEREVENT
 from Screen import Screen
 from Screens.ChoiceBox import ChoiceBox
@@ -243,7 +244,7 @@ class TimerEditList(Screen):
                else:
                        data = parseEvent(event, description = False)
 
-               self.addTimer(RecordTimerEntry(serviceref, checkOldTimers = True, dirname = config.movielist.last_timer_videodir.value, *data))
+               self.addTimer(RecordTimerEntry(serviceref, checkOldTimers = True, dirname = preferredTimerPath(), *data))
                
        def addTimer(self, timer):
                self.session.openWithCallback(self.finishedAdd, TimerEntry, timer)
index edd1968..5813bac 100644 (file)
@@ -8,11 +8,11 @@ from Components.MenuList import MenuList
 from Components.Button import Button
 from Components.Label import Label
 from Components.Pixmap import Pixmap
+from Components.UsageConfig import defaultMoviePath
 from Screens.MovieSelection import getPreferredTagEditor
 from Screens.LocationBox import MovieLocationBox
 from Screens.ChoiceBox import ChoiceBox
 from RecordTimer import AFTEREVENT
-from Tools.Directories import resolveFilename, SCOPE_HDD
 from enigma import eEPGCache
 from time import localtime, mktime, time, strftime
 from datetime import datetime
@@ -106,7 +106,7 @@ class TimerEntry(Screen, ConfigListScreen):
                        self.timerentry_starttime = ConfigClock(default = self.timer.begin)
                        self.timerentry_endtime = ConfigClock(default = self.timer.end)
 
-                       default = self.timer.dirname or resolveFilename(SCOPE_HDD)
+                       default = self.timer.dirname or defaultMoviePath()
                        tmp = config.movielist.videodirs.value
                        if default not in tmp:
                                tmp.append(default)
@@ -273,9 +273,10 @@ class TimerEntry(Screen, ConfigListScreen):
                self.timer.service_ref = self.timerentry_service_ref
                self.timer.tags = self.timerentry_tags
 
-               self.timer.dirname = self.timerentry_dirname.value
-               config.movielist.last_timer_videodir.value = self.timer.dirname
-               config.movielist.last_timer_videodir.save()
+               if self.timer.dirname or self.timerentry_dirname.value != defaultMoviePath():
+                       self.timer.dirname = self.timerentry_dirname.value
+                       config.movielist.last_timer_videodir.value = self.timer.dirname
+                       config.movielist.last_timer_videodir.save()
 
                if self.timerentry_type.value == "once":
                        self.timer.begin, self.timer.end = self.getBeginEnd()
index 7f87ffa..e1bf23d 100644 (file)
@@ -42,7 +42,6 @@ eServiceFactoryMP3::eServiceFactoryMP3()
                extensions.push_back("mp4");
                extensions.push_back("mov");
                extensions.push_back("m4a");
-               extensions.push_back("m2ts");
                sc->addServiceFactory(eServiceFactoryMP3::id, this, extensions);
        }