diff options
| author | Felix Domke <felix.domke@multimedia-labs.de> | 2009-10-29 01:54:31 +0100 |
|---|---|---|
| committer | Felix Domke <felix.domke@multimedia-labs.de> | 2009-10-29 01:54:31 +0100 |
| commit | 7560beb3e371704d798259ca1ea927bf4575306c (patch) | |
| tree | 3aa3341dbf843e064dbf0179b81ee3dca0c36a3b /lib/python/Components/config.py | |
| parent | dafa266c71fd625cd5a9bedbea10a47e27c868ad (diff) | |
| download | enigma2-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/Components/config.py')
| -rwxr-xr-x | lib/python/Components/config.py | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index e249caf4..450c302e 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -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 @@ -1249,7 +1249,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 +1285,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 +1304,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 +1318,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): |
