aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-12-03 17:56:03 +0100
committerghost <andreas.monzner@multimedia-labs.de>2009-12-03 17:56:03 +0100
commit0cb206d2c07cb9e4130e13234e3fd59b127421a8 (patch)
tree07bcbcc638a6012d32b0574531cf0bd8304484ae /lib/python/Components
parent99a717e9813eab30cd34f5da6f4a5ab6e791dc1f (diff)
parente9272c492c7a3c7fd8a1225a4baa6bee2a02eea8 (diff)
downloadenigma2-0cb206d2c07cb9e4130e13234e3fd59b127421a8.tar.gz
enigma2-0cb206d2c07cb9e4130e13234e3fd59b127421a8.zip
Merge branch 'master' into bug_245_record_playback_fixes
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/AVSwitch.py6
-rw-r--r--lib/python/Components/About.py14
-rwxr-xr-xlib/python/Components/FileList.py1
-rw-r--r--lib/python/Components/Lcd.py17
-rw-r--r--lib/python/Components/NimManager.py16
-rwxr-xr-xlib/python/Components/config.py34
6 files changed, 72 insertions, 16 deletions
diff --git a/lib/python/Components/AVSwitch.py b/lib/python/Components/AVSwitch.py
index bc2a66a4..2658f9ba 100644
--- a/lib/python/Components/AVSwitch.py
+++ b/lib/python/Components/AVSwitch.py
@@ -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()
diff --git a/lib/python/Components/About.py b/lib/python/Components/About.py
index bb2d7568..8e332e33 100644
--- a/lib/python/Components/About.py
+++ b/lib/python/Components/About.py
@@ -19,11 +19,21 @@ class About:
#0120 2005 11 29 01 16
#0123 4567 89 01 23 45
version = splitted[1]
+ image_type = version[0] # 0 = release, 1 = experimental
+ major = version[1]
+ minor = version[2]
+ revision = version[3]
year = version[4:8]
month = version[8:10]
day = version[10:12]
-
- return '-'.join(("dev", year, month, day))
+ date = '-'.join((year, month, day))
+ if image_type == '0':
+ image_type = "Release"
+ version = '.'.join((major, minor, revision))
+ return ' '.join((image_type, version, date))
+ else:
+ image_type = "Experimental"
+ return ' '.join((image_type, date))
file.close()
except IOError:
pass
diff --git a/lib/python/Components/FileList.py b/lib/python/Components/FileList.py
index 54bb1acf..38b08547 100755
--- a/lib/python/Components/FileList.py
+++ b/lib/python/Components/FileList.py
@@ -23,6 +23,7 @@ EXTENSIONS = {
"ts": "movie",
"avi": "movie",
"divx": "movie",
+ "m4v": "movie",
"mpg": "movie",
"mpeg": "movie",
"mkv": "movie",
diff --git a/lib/python/Components/Lcd.py b/lib/python/Components/Lcd.py
index 0e501237..7d27c097 100644
--- a/lib/python/Components/Lcd.py
+++ b/lib/python/Components/Lcd.py
@@ -42,9 +42,18 @@ def InitLcd():
def setLCDinverted(configElement):
ilcd.setInverted(configElement.value);
+ standby_default = 0
+
ilcd = LCD()
- config.lcd.standby = ConfigSlider(default=0, limits=(0, 10))
+ if not ilcd.isOled():
+ config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
+ config.lcd.contrast.addNotifier(setLCDcontrast);
+ else:
+ config.lcd.contrast = ConfigNothing()
+ standby_default = 1
+
+ config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10))
config.lcd.standby.addNotifier(setLCDbright);
config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby)
@@ -53,12 +62,6 @@ def InitLcd():
config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright)
config.lcd.bright.callNotifiersOnSaveAndCancel = True
- if not ilcd.isOled():
- config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
- config.lcd.contrast.addNotifier(setLCDcontrast);
- else:
- config.lcd.contrast = ConfigNothing()
-
config.lcd.invert = ConfigYesNo(default=False)
config.lcd.invert.addNotifier(setLCDinverted);
else:
diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py
index 70cde47c..05204a74 100644
--- a/lib/python/Components/NimManager.py
+++ b/lib/python/Components/NimManager.py
@@ -554,6 +554,13 @@ class NimManager:
def getSatDescription(self, pos):
return self.satellites[pos]
+ def sortFunc(self, x):
+ orbpos = x[0]
+ if orbpos > 1800:
+ return orbpos - 3600
+ else:
+ return orbpos + 1800
+
def readTransponders(self):
# read initial networks from file. we only read files which we are interested in,
# which means only these where a compatible tuner exists.
@@ -565,9 +572,10 @@ class NimManager:
if self.hasNimType("DVB-S"):
print "Reading satellites.xml"
db.readSatellites(self.satList, self.satellites, self.transponders)
-# print "SATLIST", self.satList
-# print "SATS", self.satellites
-# print "TRANSPONDERS", self.transponders
+ self.satList.sort(key = self.sortFunc) # sort by orbpos
+ #print "SATLIST", self.satList
+ #print "SATS", self.satellites
+ #print "TRANSPONDERS", self.transponders
if self.hasNimType("DVB-C"):
print "Reading cables.xml"
@@ -939,7 +947,7 @@ def InitNimManager(nimmgr):
lnb_choices = {
"universal_lnb": _("Universal LNB"),
- "unicable": _("Unicable"),
+# "unicable": _("Unicable"),
"c_band": _("C-Band"),
"user_defined": _("User defined")}
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py
index e249caf4..1f8709b3 100755
--- a/lib/python/Components/config.py
+++ b/lib/python/Components/config.py
@@ -1017,6 +1017,40 @@ 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(ConfigSelection.getValue(self))
+
+ def setValue(self, val):
+ ConfigSelection.setValue(self, 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)