diff --git a/RecordTimer.py b/RecordTimer.py
index 9f3b2ff..bb5d3f8 100644
--- a/RecordTimer.py
+++ b/RecordTimer.py
@@ -115,7 +115,7 @@ class RecordTimerEntry(timer.TimerEntry, object):
self.start_prepare = 0
self.justplay = justplay
self.afterEvent = afterEvent
- self.dirname = dirname
+ self.dirname = dirname or config.usage.timer_record_path.value
self.dirnameHadToFallback = False
self.autoincrease = False
self.autoincreasetime = 3600 * 24 # 1 day
@@ -142,6 +142,7 @@ class RecordTimerEntry(timer.TimerEntry, object):
filename += " - " + self.name
if self.dirname and not Directories.fileExists(self.dirname, 'w'):
+ # XXX: we might want to check if we actually fall back here... we might change /hdd/movie to /hdd/movie
self.dirnameHadToFallback = True
self.Filename = Directories.getRecordingFilename(filename, None)
else:
diff --git a/data/menu.xml b/data/menu.xml
index 56b3ee6..98f23b6 100644
--- a/data/menu.xml
+++ b/data/menu.xml
@@ -70,7 +70,7 @@
-->
-
+
diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py
index 26138f2..8df39fe 100644
--- a/lib/python/Components/UsageConfig.py
+++ b/lib/python/Components/UsageConfig.py
@@ -2,6 +2,7 @@ from Components.Harddisk import harddiskmanager
from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigNumber, ConfigSet, ConfigLocations
from enigma import Misc_Options, setTunerTypePriorityOrder;
from SystemInfo import SystemInfo
+from Tools.Directories import resolveFilename, SCOPE_HDD
import os
def InitUsageConfig():
@@ -32,6 +33,9 @@ def InitUsageConfig():
config.usage.allowed_timeshift_paths = ConfigLocations(default = ["/media/hdd/"])
config.usage.timeshift_path = ConfigText(default = "/media/hdd")
+ hdd = resolveFilename(SCOPE_HDD)
+ config.usage.instantrecord_path = ConfigText(default = hdd)
+ config.usage.timer_record_path = ConfigText(default = hdd)
config.usage.on_movie_start = ConfigSelection(default = "ask", choices = [
("ask", _("Ask user")), ("resume", _("Resume from last position")), ("beginning", _("Start from the beginning")) ])
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 1594b3a..1e29368 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -1501,7 +1501,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 = config.usage.instantrecord_path.value)
recording.dontSave = True
if event is None or limitEvent == False:
@@ -1602,8 +1602,9 @@ class InfoBarInstantRecord:
self.session.nav.RecordTimer.timeChanged(entry)
def instantRecord(self):
- dir = config.movielist.last_videodir.value
+ dir = config.usage.instantrecord_path.value
if not fileExists(dir, 'w'):
+ # XXX: inform the user about this?
dir = resolveFilename(SCOPE_HDD)
try:
stat = os_stat(dir)
diff --git a/lib/python/Screens/LocationBox.py b/lib/python/Screens/LocationBox.py
index 61d7105..ba9394b 100644
--- a/lib/python/Screens/LocationBox.py
+++ b/lib/python/Screens/LocationBox.py
@@ -502,35 +502,62 @@ class LocationBox(Screen, NumericalTextInput, HelpableScreen):
def __repr__(self):
return str(type(self)) + "(" + self.text + ")"
-class MovieLocationBox(LocationBox):
- def __init__(self, session, text, dir, minFree = None):
- inhibitDirs = ["/bin", "/boot", "/dev", "/etc", "/lib", "/proc", "/sbin", "/sys", "/usr", "/var"]
- LocationBox.__init__(self, session, text = text, currDir = dir, bookmarks = config.movielist.videodirs, autoAdd = True, editDir = True, inhibitDirs = inhibitDirs, minFree = minFree)
- self.skinName = "LocationBox"
-
-class TimeshiftLocationBox(LocationBox):
- def __init__(self, session):
+class DefaultLocationBox(LocationBox):
+ def __init__(self, session, text, dir, bookmarks, minFree = None):
inhibitDirs = ["/bin", "/boot", "/dev", "/etc", "/lib", "/proc", "/sbin", "/sys", "/usr", "/var"]
LocationBox.__init__(
self,
session,
- text = _("Where to save temporary timeshift recordings?"),
- currDir = config.usage.timeshift_path.value,
- bookmarks = config.usage.allowed_timeshift_paths,
+ text = text,
+ currDir = dir,
+ bookmarks = bookmarks,
autoAdd = True,
editDir = True,
inhibitDirs = inhibitDirs,
- minFree = 1024 # the same requirement is hardcoded in servicedvb.cpp
+ minFree = minFree
)
self.skinName = "LocationBox"
- def cancel(self):
- config.usage.timeshift_path.cancel()
- LocationBox.cancel(self)
+class MovieLocationBox(DefaultLocationBox):
+ def __init__(self, session, text, dir, minFree = None):
+ DefaultLocationBox.__init__(
+ self,
+ session,
+ text,
+ dir,
+ config.movielist.videodirs,
+ minFree = minFree
+ )
- def selectConfirmed(self, ret):
- if ret:
- config.usage.timeshift_path.value = self.getPreferredFolder()
- config.usage.timeshift_path.save()
- LocationBox.selectConfirmed(self, ret)
+class TimeshiftLocationBox(DefaultLocationBox):
+ def __init__(self, session, dir):
+ DefaultLocationBox.__init__(
+ self,
+ session,
+ _("Where to save temporary timeshift recordings?"),
+ dir,
+ config.usage.allowed_timeshift_paths,
+ minFree = 1024 # XXX: the same requirement is hardcoded in servicedvb.cpp
+ )
+
+class InstantrecordLocationBox(DefaultLocationBox):
+ def __init__(self, session, dir):
+ DefaultLocationBox.__init__(
+ self,
+ session,
+ _("Where to save instant recordings?"),
+ dir,
+ config.movielist.videodirs,
+ minFree = 1024
+ )
+class TimerLocationBox(DefaultLocationBox):
+ def __init__(self, session, dir):
+ DefaultLocationBox.__init__(
+ self,
+ session,
+ _("Where to save timer recordings by default?"),
+ dir,
+ config.movielist.videodirs,
+ minFree = 1024
+ )
diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am
index ca67f73..1081e3e 100755
--- a/lib/python/Screens/Makefile.am
+++ b/lib/python/Screens/Makefile.am
@@ -14,5 +14,5 @@ install_PYTHON = \
SubtitleDisplay.py SubservicesQuickzap.py ParentalControlSetup.py NumericalTextInputHelpDialog.py \
SleepTimerEdit.py Ipkg.py RdsDisplay.py Globals.py DefaultWizard.py \
SessionGlobals.py LocationBox.py WizardLanguage.py TaskView.py Rc.py VirtualKeyBoard.py \
- TextBox.py FactoryReset.py
+ TextBox.py FactoryReset.py RecordPaths.py
diff --git a/lib/python/Screens/MovieSelection.py b/lib/python/Screens/MovieSelection.py
index 174a4f0..dbcf0a1 100644
--- a/lib/python/Screens/MovieSelection.py
+++ b/lib/python/Screens/MovieSelection.py
@@ -27,7 +27,6 @@ config.movielist.moviesort = ConfigInteger(default=MovieList.SORT_RECORDED)
config.movielist.listtype = ConfigInteger(default=MovieList.LISTTYPE_ORIGINAL)
config.movielist.description = ConfigInteger(default=MovieList.HIDE_DESCRIPTION)
config.movielist.last_videodir = ConfigText(default=resolveFilename(SCOPE_HDD))
-config.movielist.last_timer_videodir = ConfigText(default=resolveFilename(SCOPE_HDD))
config.movielist.videodirs = ConfigLocations(default=[resolveFilename(SCOPE_HDD)])
config.movielist.first_tags = ConfigText(default="")
config.movielist.second_tags = ConfigText(default="")
diff --git a/lib/python/Screens/RecordPaths.py b/lib/python/Screens/RecordPaths.py
new file mode 100644
index 0000000..c9d5dab
--- /dev/null
+++ b/lib/python/Screens/RecordPaths.py
@@ -0,0 +1,110 @@
+from Screens.Screen import Screen
+from Screens.LocationBox import TimerLocationBox, InstantrecordLocationBox, TimeshiftLocationBox
+from Components.Label import Label
+from Components.config import config, ConfigSelection, getConfigListEntry
+from Components.ConfigList import ConfigListScreen
+from Components.ActionMap import ActionMap
+from Components.Button import Button
+
+class RecordPathsSettings(Screen, ConfigListScreen):
+ skin = """
+
+
+
+
+
+
+ """
+
+ def __init__(self, session):
+ Screen.__init__(self, session)
+
+ self["key_red"] = Button(_("Cancel"))
+ self["key_green"] = Button(_("Save"))
+
+ default = config.usage.timer_record_path.value
+ tmp = config.movielist.videodirs.value
+ if default not in tmp:
+ tmp.append(default)
+ self.timer_record_dirname = ConfigSelection(default = default, choices = tmp)
+ default = config.usage.instantrecord_path.value
+ if default not in tmp:
+ tmp.append(default)
+ self.instantrecord_dirname = ConfigSelection(default = default, choices = tmp)
+ default = config.usage.timeshift_path.value
+ tmp = config.usage.allowed_timeshift_paths.value
+ if default not in tmp:
+ tmp.append(default)
+ self.timeshift_dirname = ConfigSelection(default = default, choices = tmp)
+
+ self.timer_record_path = getConfigListEntry(_("Timer record path"), self.timer_record_dirname)
+ self.instantrecord_path = getConfigListEntry(_("Instant record path"), self.instantrecord_dirname)
+ self.timeshift_path = getConfigListEntry(_("Timeshift path"), self.timeshift_dirname)
+
+ l = (
+ self.timer_record_path,
+ self.instantrecord_path,
+ self.timeshift_path
+ )
+
+ ConfigListScreen.__init__(self, l)
+
+ self["setupActions"] = ActionMap(["OkCancelActions", "ColorActions"],
+ {
+ "green": self.save,
+ "red": self.cancel,
+ "cancel": self.cancel,
+ "ok": self.ok,
+ })
+
+ def ok(self):
+ cur = self["config"].getCurrent()
+ if cur == self.timer_record_path:
+ self.session.openWithCallback(
+ self.timerPathSelected,
+ TimerLocationBox,
+ self.timer_record_dirname.value,
+ )
+ elif cur == self.instantrecord_path:
+ self.session.openWithCallback(
+ self.instantrecordPathSelected,
+ InstantrecordLocationBox,
+ self.instantrecord_dirname.value,
+ )
+ elif cur == self.timeshift_path:
+ self.session.openWithCallback(
+ self.timeshiftPathSelected,
+ TimeshiftLocationBox,
+ self.timeshift_dirname.value,
+ )
+
+ def timerPathSelected(self, res):
+ if res:
+ if config.movielist.videodirs.value != self.timer_record_dirname.choices:
+ self.timer_record_dirname.setChoices(config.movielist.videodirs.value, default=res)
+ self.timer_record_dirname.value = res
+
+ def instantrecordPathSelected(self, res):
+ if res:
+ if config.movielist.videodirs.value != self.instantrecord_dirname.choices:
+ self.instantrecord_dirname.setChoices(config.movielist.videodirs.value, default=res)
+ self.instantrecord_dirname.value = res
+
+ def timeshiftPathSelected(self, res):
+ if res:
+ if config.usage.allowed_timeshift_paths.value != self.timeshift_dirname.choices:
+ self.timeshift_dirname.setChoices(config.usage.allowed_timeshift_paths.value, default=res)
+ self.timeshift_dirname.value = res
+
+ def save(self):
+ config.usage.timer_record_path.value = self.timer_record_dirname.value
+ config.usage.instantrecord_path.value = self.instantrecord_dirname.value
+ config.usage.timeshift_path.value = self.timeshift_dirname.value
+ config.usage.timer_record_path.save()
+ config.usage.instantrecord_path.save()
+ config.usage.timeshift_path.save()
+ self.close()
+
+ def cancel(self):
+ self.close()
+
diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py
index caaf8c9..162d75f 100644
--- a/lib/python/Screens/TimerEdit.py
+++ b/lib/python/Screens/TimerEdit.py
@@ -243,7 +243,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 = config.usage.timer_record_path.value, *data))
def addTimer(self, timer):
self.session.openWithCallback(self.finishedAdd, TimerEntry, timer)
diff --git a/lib/python/Screens/TimerEntry.py b/lib/python/Screens/TimerEntry.py
index 73b2175..51152fc 100644
--- a/lib/python/Screens/TimerEntry.py
+++ b/lib/python/Screens/TimerEntry.py
@@ -274,8 +274,6 @@ class TimerEntry(Screen, ConfigListScreen):
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.timerentry_type.value == "once":
self.timer.begin, self.timer.end = self.getBeginEnd()