aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2008-11-17 00:00:43 +0100
committerFelix Domke <tmbinc@elitedvb.net>2008-11-17 00:00:43 +0100
commiteea4ecaf18d01dbdbe1590bc7b6e4c6f9da1fe8b (patch)
tree06b873c872d1983f2b5b3a7e2e74e41e0d53087f /lib/python
parent077c1e5f9b3cc53994c76723dcee48a6a02e5141 (diff)
downloadenigma2-eea4ecaf18d01dbdbe1590bc7b6e4c6f9da1fe8b.tar.gz
enigma2-eea4ecaf18d01dbdbe1590bc7b6e4c6f9da1fe8b.zip
allows to configure the path for timeshift recordings via gui, by Moritz Venn. closes #64.
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/UsageConfig.py5
-rw-r--r--lib/python/Screens/LocationBox.py29
2 files changed, 33 insertions, 1 deletions
diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py
index 714d366d..6ed87840 100644
--- a/lib/python/Components/UsageConfig.py
+++ b/lib/python/Components/UsageConfig.py
@@ -1,5 +1,5 @@
from Components.Harddisk import harddiskmanager
-from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigNumber, ConfigSet
+from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigNumber, ConfigSet, ConfigLocations
from enigma import Misc_Options, setTunerTypePriorityOrder;
from SystemInfo import SystemInfo
import os
@@ -30,6 +30,9 @@ def InitUsageConfig():
("standard", _("standard")), ("swap", _("swap PiP and main picture")),
("swapstop", _("move PiP to main picture")), ("stop", _("stop PiP")) ])
+ 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")) ])
config.usage.on_movie_stop = ConfigSelection(default = "ask", choices = [
diff --git a/lib/python/Screens/LocationBox.py b/lib/python/Screens/LocationBox.py
index 7cd6cbf9..68d4f772 100644
--- a/lib/python/Screens/LocationBox.py
+++ b/lib/python/Screens/LocationBox.py
@@ -503,3 +503,32 @@ 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)
+
+class TimeshiftLocationBox(LocationBox):
+
+ skinName = "LocationBox" # XXX: though we could use a custom skin or inherit the hardcoded one we stick with the original :-)
+
+ def __init__(self, session):
+ 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,
+ autoAdd = True,
+ editDir = True,
+ inhibitDirs = inhibitDirs,
+ minFree = 1024 # XXX: the same requirement is hardcoded in servicedvb.cpp
+ )
+
+ def cancel(self):
+ config.usage.timeshift_path.cancel()
+ LocationBox.cancel(self)
+
+ def selectConfirmed(self, ret):
+ if ret:
+ config.usage.timeshift_path.value = self.getPreferredFolder()
+ config.usage.timeshift_path.save()
+ LocationBox.selectConfirmed(self, ret)
+