aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-04-17 15:05:16 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-04-17 15:05:16 +0000
commitb8b871a579e8f9fc52dbd53bb451fac212775867 (patch)
tree92482e3fa890a9b696d80ff5d5f90881b1f6604f /lib/python
parent7e4013c449a7dbb31fb6a67106b913bf22a61334 (diff)
downloadenigma2-b8b871a579e8f9fc52dbd53bb451fac212775867.tar.gz
enigma2-b8b871a579e8f9fc52dbd53bb451fac212775867.zip
fix some blue screens
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Screens/ScanSetup.py36
-rw-r--r--lib/python/Screens/TimerEdit.py31
2 files changed, 40 insertions, 27 deletions
diff --git a/lib/python/Screens/ScanSetup.py b/lib/python/Screens/ScanSetup.py
index 0b299f7a..b2a53ab0 100644
--- a/lib/python/Screens/ScanSetup.py
+++ b/lib/python/Screens/ScanSetup.py
@@ -390,20 +390,26 @@ class ScanSetup(Screen):
flags = 0
if (nimmanager.getNimType(config.scan.nims.value) == nimmanager.nimType["DVB-S"]):
if currentConfigSelectionElement(config.scan.type) == "single_transponder":
-
- self.addSatTransponder(tlist, config.scan.sat.frequency.value[0],
- config.scan.sat.symbolrate.value[0],
- config.scan.sat.polarization.value,
- config.scan.sat.fec.value,
- config.scan.sat.inversion.value,
- self.satList[config.scan.nims.value][config.scan.satselection[config.scan.nims.value].value][1])
+ l = len(self.satList)
+ if l and l > config.scan.nims.value:
+ nimsats=self.satList[config.scan.nims.value]
+ l = len(config.scan.satselection)
+ if l and l > config.scan.nims.value:
+ selsatidx=config.scan.satselection[config.scan.nims.value].value
+ l = len(nimsats)
+ if l and l > selsatidx:
+ orbpos=nimsats[selsatidx][1]
+ self.addSatTransponder(tlist, config.scan.sat.frequency.value[0],
+ config.scan.sat.symbolrate.value[0],
+ config.scan.sat.polarization.value,
+ config.scan.sat.fec.value,
+ config.scan.sat.inversion.value,
+ orbpos)
elif currentConfigSelectionElement(config.scan.type) == "single_satellite":
getInitialTransponderList(tlist, int(self.satList[config.scan.nims.value][config.scan.satselection[config.scan.nims.value].value][1]))
flags |= eComponentScan.scanNetworkSearch
-
elif currentConfigSelectionElement(config.scan.type) == "multisat":
SatList = nimmanager.getSatListForNim(config.scan.nims.value)
-
for x in self.multiscanlist:
if x[1].parent.value == 0:
print " " + str(x[1].parent.configPath)
@@ -417,7 +423,7 @@ class ScanSetup(Screen):
config.scan.cab.modulation.value,
config.scan.cab.fec.value,
config.scan.cab.inversion.value)
- if currentConfigSelectionElement(config.scan.cab.networkScan) == "yes":
+ if currentConfigSelectionElement(config.scan.cab.networkScan) == "yes":
flags |= eComponentScan.scanNetworkSearch
elif currentConfigSelectionElement(config.scan.typecable) == "complete":
getInitialCableTransponderList(tlist, nimmanager.getCableDescription(config.scan.nims.value))
@@ -444,11 +450,13 @@ class ScanSetup(Screen):
for x in self["config"].list:
x[1].save()
- feid = config.scan.nims.value
- # flags |= eComponentScan.scanSearchBAT
- self.session.openWithCallback(self.doNothing, ServiceScan, [{"transponders": tlist, "feid": feid, "flags": flags}])
+ if len(tlist):
+ feid = config.scan.nims.value
+ # flags |= eComponentScan.scanSearchBAT
+ self.session.openWithCallback(self.doNothing, ServiceScan, [{"transponders": tlist, "feid": feid, "flags": flags}])
+ else:
+ self.session.open(MessageBox, _("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."), MessageBox.TYPE_ERROR)
- #self.close()
def doNothing(self):
pass
diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py
index bbbf6b5f..e6f1edd4 100644
--- a/lib/python/Screens/TimerEdit.py
+++ b/lib/python/Screens/TimerEdit.py
@@ -63,16 +63,18 @@ class TimerEditList(Screen):
self.updateState()
def toggleDisabledState(self):
- t = self["timerlist"].getCurrent()[0]
+ cur=self["timerlist"].getCurrent()
+ if cur:
+ t = cur[0]
- if t.disabled:
- t.enable()
- else:
- t.disable()
+ if t.disabled:
+ t.enable()
+ else:
+ t.disable()
- self.session.nav.RecordTimer.timeChanged(t)
- self.updateState()
- self.refill()
+ self.session.nav.RecordTimer.timeChanged(t)
+ self.updateState()
+ self.refill()
def updateState(self):
if len(self.list) > 0:
@@ -93,12 +95,15 @@ class TimerEditList(Screen):
self.list.sort(cmp = lambda x, y: x[0].begin < y[0].begin)
def showLog(self):
- self.session.openWithCallback(self.finishedEdit, TimerLog, self["timerlist"].getCurrent()[0])
+ cur=self["timerlist"].getCurrent()
+ if cur:
+ self.session.openWithCallback(self.finishedEdit, TimerLog, cur[0])
def openEdit(self):
- self.session.openWithCallback(self.finishedEdit, TimerEntry, self["timerlist"].getCurrent()[0])
- #self.session.open(TimerEdit, self["timerlist"].getCurrent()[0])
-
+ cur=self["timerlist"].getCurrent()
+ if cur:
+ self.session.openWithCallback(self.finishedEdit, TimerEntry, cur[0])
+
def cleanupQuestion(self):
self.session.openWithCallback(self.cleanupTimer, MessageBox, _("Really delete done timers?"))
@@ -110,7 +115,7 @@ class TimerEditList(Screen):
def removeTimer(self):
list = self["timerlist"]
cur = list.getCurrent()
- if cur is not None:
+ if cur:
timer = cur[0]
self.session.nav.RecordTimer.removeEntry(timer)
self.refill()