add support for up to 128 LNBs
[enigma2.git] / lib / python / Screens / Satconfig.py
1 from enigma import eDVBDB
2 from Screen import Screen
3 from Components.SystemInfo import SystemInfo
4 from Components.ActionMap import ActionMap
5 from Components.ConfigList import ConfigListScreen
6 from Components.MenuList import MenuList
7 from Components.NimManager import nimmanager
8 from Components.config import getConfigListEntry, config, ConfigNothing, ConfigSelection, updateConfigElement
9 from Components.Sources.List import List
10 from Screens.MessageBox import MessageBox
11
12 from time import mktime, localtime
13 from datetime import datetime
14
15 class NimSetup(Screen, ConfigListScreen):
16         def createSimpleSetup(self, list, mode):
17                 if mode == "single":
18                         list.append(getConfigListEntry(_("Satellite"), self.nimConfig.diseqcA))
19                 else:
20                         list.append(getConfigListEntry(_("Port A"), self.nimConfig.diseqcA))
21
22                 if mode in ["toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"]:
23                         list.append(getConfigListEntry(_("Port B"), self.nimConfig.diseqcB))
24                         if mode == "diseqc_a_b_c_d":
25                                 list.append(getConfigListEntry(_("Port C"), self.nimConfig.diseqcC))
26                                 list.append(getConfigListEntry(_("Port D"), self.nimConfig.diseqcD))
27
28         def createPositionerSetup(self, list):
29                 nim = self.nimConfig
30                 list.append(getConfigListEntry(_("Longitude"), nim.longitude))
31                 list.append(getConfigListEntry(" ", nim.longitudeOrientation))
32                 list.append(getConfigListEntry(_("Latitude"), nim.latitude))
33                 list.append(getConfigListEntry(" ", nim.latitudeOrientation))
34                 if SystemInfo["CanMeasureFrontendInputPower"]:
35                         self.advancedPowerMeasurement = getConfigListEntry(_("Use Power Measurement"), nim.powerMeasurement)
36                         list.append(self.advancedPowerMeasurement)
37                         if nim.powerMeasurement.value:
38                                 list.append(getConfigListEntry(_("Power threshold in mA"), nim.powerThreshold))
39                                 self.turningSpeed = getConfigListEntry(_("Rotor turning speed"), nim.turningSpeed)
40                                 list.append(self.turningSpeed)
41                                 if nim.turningSpeed.value == "fast epoch":
42                                         self.turnFastEpochBegin = getConfigListEntry(_("Begin time"), nim.fastTurningBegin)
43                                         self.turnFastEpochEnd = getConfigListEntry(_("End time"), nim.fastTurningEnd)
44                                         list.append(self.turnFastEpochBegin)
45                                         list.append(self.turnFastEpochEnd)
46                 else:
47                         if nim.powerMeasurement.value:
48                                 nim.powerMeasurement.value = False
49                                 nim.powerMeasurement.save()
50                 
51         def createConfigMode(self):
52                 if self.nim.isCompatible("DVB-S"):
53                         choices = { "nothing": _("nothing connected"),
54                                                 "simple": _("simple"),
55                                                 "advanced": _("advanced")}
56                         #if len(nimmanager.getNimListOfType(nimmanager.getNimType(self.slotid), exception = x)) > 0:
57                         #       choices["equal"] = _("equal to")
58                         #       choices["satposdepends"] = _("second cable of motorized LNB")
59                         if len(nimmanager.canEqualTo(self.slotid)) > 0:
60                                 choices["equal"] = _("equal to")
61                         if len(nimmanager.canDependOn(self.slotid)) > 0:
62                                 choices["satposdepends"] = _("second cable of motorized LNB")
63                         if len(nimmanager.canConnectTo(self.slotid)) > 0:
64                                 choices["loopthrough"] = _("loopthrough to")
65                         self.nimConfig.configMode.setChoices(choices)
66                                                         
67         def createSetup(self):
68                 print "Creating setup"
69                 self.list = [ ]
70
71                 self.configMode = None
72                 self.diseqcModeEntry = None
73                 self.advancedSatsEntry = None
74                 self.advancedLnbsEntry = None
75                 self.advancedDiseqcMode = None
76                 self.advancedUsalsEntry = None
77                 self.advancedLof = None
78                 self.advancedPowerMeasurement = None
79                 self.turningSpeed = None
80                 self.turnFastEpochBegin = None
81                 self.turnFastEpochEnd = None
82                 self.uncommittedDiseqcCommand = None
83                 self.cableScanType = None
84                 self.have_advanced = False
85
86                 if self.nim.isCompatible("DVB-S"):
87                         self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
88                         self.list.append(self.configMode)
89
90                         if self.nimConfig.configMode.value == "simple":                 #simple setup
91                                 self.diseqcModeEntry = getConfigListEntry(_("DiSEqC Mode"), self.nimConfig.diseqcMode)
92                                 self.list.append(self.diseqcModeEntry)
93                                 if self.nimConfig.diseqcMode.value in ["single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"]:
94                                         self.createSimpleSetup(self.list, self.nimConfig.diseqcMode.value)
95                                 if self.nimConfig.diseqcMode.value == "positioner":
96                                         self.createPositionerSetup(self.list)
97                         elif self.nimConfig.configMode.value == "equal":
98                                 choices = []
99                                 nimlist = nimmanager.canEqualTo(self.nim.slot)
100                                 for id in nimlist:
101                                         #choices.append((str(id), str(chr(65 + id))))
102                                         choices.append((str(id), nimmanager.getNimDescription(id)))
103                                 self.nimConfig.connectedTo.setChoices(choices)
104                                 #self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
105                                 self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
106                         elif self.nimConfig.configMode.value == "satposdepends":
107                                 choices = []
108                                 nimlist = nimmanager.canDependOn(self.nim.slot)
109                                 for id in nimlist:
110                                         #choices.append((str(id), str(chr(65 + id))))
111                                         choices.append((str(id), nimmanager.getNimDescription(id)))
112                                 self.nimConfig.connectedTo.setChoices(choices)
113                                 #self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
114                                 self.list.append(getConfigListEntry(_("Tuner"), self.nimConfig.connectedTo))
115                         elif self.nimConfig.configMode.value == "loopthrough":
116                                 choices = []
117                                 print "connectable to:", nimmanager.canConnectTo(self.slotid)
118                                 connectable = nimmanager.canConnectTo(self.slotid)
119                                 for id in connectable:
120                                         choices.append((str(id), nimmanager.getNimDescription(id)))
121                                 self.nimConfig.connectedTo.setChoices(choices)
122                                 #self.nimConfig.connectedTo = updateConfigElement(self.nimConfig.connectedTo, ConfigSelection(choices = choices))
123                                 self.list.append(getConfigListEntry(_("Connected to"), self.nimConfig.connectedTo))
124                         elif self.nimConfig.configMode.value == "nothing":
125                                 pass
126                         elif self.nimConfig.configMode.value == "advanced": # advanced
127                                 # SATs
128                                 self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
129                                 self.list.append(self.advancedSatsEntry)
130                                 cur_orb_pos = self.nimConfig.advanced.sats.orbital_position
131                                 satlist = self.nimConfig.advanced.sat.keys()
132                                 if cur_orb_pos is not None:
133                                         if cur_orb_pos not in satlist:
134                                                 cur_orb_pos = satlist[0]
135                                         currSat = self.nimConfig.advanced.sat[cur_orb_pos]
136                                         self.fillListWithAdvancedSatEntrys(currSat)
137                                 self.have_advanced = True
138                 elif self.nim.isCompatible("DVB-C"):
139                         self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
140                         self.list.append(self.configMode)
141                         if self.nimConfig.configMode.value == "enabled":
142                                 self.cableScanType=getConfigListEntry(_("Used service scan type"), self.nimConfig.cable.scan_type)
143                                 self.list.append(self.cableScanType)
144                                 if self.nimConfig.cable.scan_type.value == "provider":
145                                         self.list.append(getConfigListEntry(_("Provider to scan"), self.nimConfig.cable.scan_provider))
146                                 else:
147                                         if self.nimConfig.cable.scan_type.value == "bands":
148                                                 self.list.append(getConfigListEntry(_("Scan band EU VHF I"), self.nimConfig.cable.scan_band_EU_VHF_I))
149                                                 self.list.append(getConfigListEntry(_("Scan band EU MID"), self.nimConfig.cable.scan_band_EU_MID))
150                                                 self.list.append(getConfigListEntry(_("Scan band EU VHF III"), self.nimConfig.cable.scan_band_EU_VHF_III))
151                                                 self.list.append(getConfigListEntry(_("Scan band EU UHF IV"), self.nimConfig.cable.scan_band_EU_UHF_IV))
152                                                 self.list.append(getConfigListEntry(_("Scan band EU UHF V"), self.nimConfig.cable.scan_band_EU_UHF_V))
153                                                 self.list.append(getConfigListEntry(_("Scan band EU SUPER"), self.nimConfig.cable.scan_band_EU_SUPER))
154                                                 self.list.append(getConfigListEntry(_("Scan band EU HYPER"), self.nimConfig.cable.scan_band_EU_HYPER))
155                                                 self.list.append(getConfigListEntry(_("Scan band US LOW"), self.nimConfig.cable.scan_band_US_LOW))
156                                                 self.list.append(getConfigListEntry(_("Scan band US MID"), self.nimConfig.cable.scan_band_US_MID))
157                                                 self.list.append(getConfigListEntry(_("Scan band US HIGH"), self.nimConfig.cable.scan_band_US_HIGH))
158                                                 self.list.append(getConfigListEntry(_("Scan band US SUPER"), self.nimConfig.cable.scan_band_US_SUPER))
159                                                 self.list.append(getConfigListEntry(_("Scan band US HYPER"), self.nimConfig.cable.scan_band_US_HYPER))
160                                         elif self.nimConfig.cable.scan_type.value == "steps":
161                                                 self.list.append(getConfigListEntry(_("Frequency scan step size(khz)"), self.nimConfig.cable.scan_frequency_steps))
162                                         self.list.append(getConfigListEntry(_("Scan QAM16"), self.nimConfig.cable.scan_mod_qam16))
163                                         self.list.append(getConfigListEntry(_("Scan QAM32"), self.nimConfig.cable.scan_mod_qam32))
164                                         self.list.append(getConfigListEntry(_("Scan QAM64"), self.nimConfig.cable.scan_mod_qam64))
165                                         self.list.append(getConfigListEntry(_("Scan QAM128"), self.nimConfig.cable.scan_mod_qam128))
166                                         self.list.append(getConfigListEntry(_("Scan QAM256"), self.nimConfig.cable.scan_mod_qam256))
167                                         self.list.append(getConfigListEntry(_("Scan SR6900"), self.nimConfig.cable.scan_sr_6900))
168                                         self.list.append(getConfigListEntry(_("Scan SR6875"), self.nimConfig.cable.scan_sr_6875))
169                                         self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext1))
170                                         self.list.append(getConfigListEntry(_("Scan additional SR"), self.nimConfig.cable.scan_sr_ext2))
171                         self.have_advanced = False
172                 elif self.nim.isCompatible("DVB-T"):
173                         self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
174                         self.list.append(self.configMode)
175                         self.have_advanced = False
176                         if self.nimConfig.configMode.value == "enabled":
177                                 self.list.append(getConfigListEntry(_("Terrestrial provider"), self.nimConfig.terrestrial))
178                                 self.list.append(getConfigListEntry(_("Enable 5V for active antenna"), self.nimConfig.terrestrial_5V))
179                 else:
180                         self.have_advanced = False
181                 self["config"].list = self.list
182                 self["config"].l.setList(self.list)
183
184         def newConfig(self):
185                 checkList = (self.configMode, self.diseqcModeEntry, self.advancedSatsEntry, \
186                         self.advancedLnbsEntry, self.advancedDiseqcMode, self.advancedUsalsEntry, \
187                         self.advancedLof, self.advancedPowerMeasurement, self.turningSpeed, \
188                         self.uncommittedDiseqcCommand, self.cableScanType)
189                 for x in checkList:
190                         if self["config"].getCurrent() == x:
191                                 self.createSetup()
192
193         def run(self):
194                 if self.have_advanced and self.nim.config_mode == "advanced":
195                         self.fillAdvancedList()
196                 for x in self.list:
197                         if x in [self.turnFastEpochBegin, self.turnFastEpochEnd]:
198                                 # workaround for storing only hour*3600+min*60 value in configfile
199                                 # not really needed.. just for cosmetics..
200                                 tm = localtime(x[1].value)
201                                 dt = datetime(1970, 1, 1, tm.tm_hour, tm.tm_min)
202                                 x[1].value = int(mktime(dt.timetuple()))
203                         x[1].save()
204                 nimmanager.sec.update()
205                 self.saveAll()
206
207         def fillListWithAdvancedSatEntrys(self, Sat):
208                 lnbnum = int(Sat.lnb.value)
209                 currLnb = self.nimConfig.advanced.lnb[lnbnum]
210                 
211                 if isinstance(currLnb, ConfigNothing):
212                         currLnb = None
213
214                 self.list.append(getConfigListEntry(_("Voltage mode"), Sat.voltage))
215                 self.list.append(getConfigListEntry(_("Tone mode"), Sat.tonemode))
216                 if currLnb and currLnb.diseqcMode.value == "1_2":
217                         if lnbnum < 125:
218                                 self.advancedUsalsEntry = getConfigListEntry(_("Use usals for this sat"), Sat.usals)
219                                 self.list.append(self.advancedUsalsEntry)
220                                 if not Sat.usals.value:
221                                         self.list.append(getConfigListEntry(_("Stored position"), Sat.rotorposition))
222
223                 # LNBs
224                 self.advancedLnbsEntry = getConfigListEntry(_("LNB"), Sat.lnb)
225                 self.list.append(self.advancedLnbsEntry)
226                 if currLnb:
227                         if lnbnum < 125:
228                                 self.advancedDiseqcMode = getConfigListEntry(_("DiSEqC mode"), currLnb.diseqcMode)
229                                 self.list.append(self.advancedDiseqcMode)
230                         if currLnb.diseqcMode.value != "none":
231                                 self.list.append(getConfigListEntry(_("Toneburst"), currLnb.toneburst))
232                                 self.list.append(getConfigListEntry(_("Committed DiSEqC command"), currLnb.commitedDiseqcCommand))
233                                 self.list.append(getConfigListEntry(_("Fast DiSEqC"), currLnb.fastDiseqc))
234                                 self.list.append(getConfigListEntry(_("Sequence repeat"), currLnb.sequenceRepeat))
235                                 if currLnb.diseqcMode.value == "1_0":
236                                         self.list.append(getConfigListEntry(_("Command order"), currLnb.commandOrder1_0))
237                                 else:
238                                         if currLnb.uncommittedDiseqcCommand.index:
239                                                 if currLnb.commandOrder.value == "ct":
240                                                         currLnb.commandOrder.value = "cut"
241                                                 elif currLnb.commandOrder.value == "tc":
242                                                         currLnb.commandOrder.value = "tcu"
243                                         else:
244                                                 if currLnb.commandOrder.index & 1:
245                                                         currLnb.commandOrder.value = "tc"
246                                                 else:
247                                                         currLnb.commandOrder.value = "ct"
248                                         self.list.append(getConfigListEntry(_("Command order"), currLnb.commandOrder))
249                                         self.uncommittedDiseqcCommand = getConfigListEntry(_("Uncommitted DiSEqC command"), currLnb.uncommittedDiseqcCommand)
250                                         self.list.append(self.uncommittedDiseqcCommand)
251                                         self.list.append(getConfigListEntry(_("DiSEqC repeats"), currLnb.diseqcRepeats))
252                                 if currLnb.diseqcMode.value == "1_2":
253                                         self.list.append(getConfigListEntry(_("Longitude"), currLnb.longitude))
254                                         self.list.append(getConfigListEntry(" ", currLnb.longitudeOrientation))
255                                         self.list.append(getConfigListEntry(_("Latitude"), currLnb.latitude))
256                                         self.list.append(getConfigListEntry(" ", currLnb.latitudeOrientation))
257                                         if SystemInfo["CanMeasureFrontendInputPower"]:
258                                                 self.advancedPowerMeasurement = getConfigListEntry(_("Use Power Measurement"), currLnb.powerMeasurement)
259                                                 self.list.append(self.advancedPowerMeasurement)
260                                                 if currLnb.powerMeasurement.value:
261                                                         self.list.append(getConfigListEntry(_("Power threshold in mA"), currLnb.powerThreshold))
262                                                         self.turningSpeed = getConfigListEntry(_("Rotor turning speed"), currLnb.turningSpeed)
263                                                         self.list.append(self.turningSpeed)
264                                                         if currLnb.turningSpeed.value == "fast epoch":
265                                                                 self.turnFastEpochBegin = getConfigListEntry(_("Begin time"), currLnb.fastTurningBegin)
266                                                                 self.turnFastEpochEnd = getConfigListEntry(_("End time"), currLnb.fastTurningEnd)
267                                                                 self.list.append(self.turnFastEpochBegin)
268                                                                 self.list.append(self.turnFastEpochEnd)
269                                         else:
270                                                 if currLnb.powerMeasurement.value:
271                                                         currLnb.powerMeasurement.value = False
272                                                         currLnb.powerMeasurement.save()
273                         self.advancedLof = getConfigListEntry(_("LOF"), currLnb.lof)
274                         self.list.append(self.advancedLof)
275                         if currLnb.lof.value == "user_defined":
276                                 self.list.append(getConfigListEntry(_("LOF/L"), currLnb.lofl))
277                                 self.list.append(getConfigListEntry(_("LOF/H"), currLnb.lofh))
278                                 self.list.append(getConfigListEntry(_("Threshold"), currLnb.threshold))
279 #                       self.list.append(getConfigListEntry(_("12V Output"), currLnb.output_12v))
280                         self.list.append(getConfigListEntry(_("Increased voltage"), currLnb.increased_voltage))
281
282         def fillAdvancedList(self):
283                 self.list = [ ]
284                 self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode)
285                 self.list.append(self.configMode)
286                 self.advancedSatsEntry = getConfigListEntry(_("Satellite"), self.nimConfig.advanced.sats)
287                 self.list.append(self.advancedSatsEntry)
288                 for x in self.nimConfig.advanced.sat.keys():
289                         Sat = self.nimConfig.advanced.sat[x]
290                         self.fillListWithAdvancedSatEntrys(Sat)
291                 self["config"].list = self.list
292
293         def keySave(self):
294                 old_configured_sats = nimmanager.getConfiguredSats()
295                 self.run()
296                 new_configured_sats = nimmanager.getConfiguredSats()
297                 self.unconfed_sats = old_configured_sats - new_configured_sats
298                 self.satpos_to_remove = None
299                 self.deleteConfirmed(False)
300
301         def deleteConfirmed(self, confirmed):
302                 if confirmed:
303                         eDVBDB.getInstance().removeServices(-1, -1, -1, self.satpos_to_remove)
304
305                 if self.satpos_to_remove is not None:
306                         self.unconfed_sats.remove(self.satpos_to_remove)
307
308                 self.satpos_to_remove = None
309                 for orbpos in self.unconfed_sats:
310                         self.satpos_to_remove = orbpos
311                         orbpos = self.satpos_to_remove
312                         try:
313                                 # why we need this cast?
314                                 sat_name = str(nimmanager.getSatDescription(orbpos))
315                         except:
316                                 if orbpos > 1800: # west
317                                         orbpos = 3600 - orbpos
318                                         h = _("W")
319                                 else:
320                                         h = _("E")
321                                 sat_name = ("%d.%d" + h) % (orbpos / 10, orbpos % 10)
322                         self.session.openWithCallback(self.deleteConfirmed, MessageBox, _("Delete no more configured satellite\n%s?") %(sat_name))
323                         break
324                 if not self.satpos_to_remove:
325                         self.close()
326
327         def __init__(self, session, slotid):
328                 Screen.__init__(self, session)
329                 self.list = [ ]
330
331                 ConfigListScreen.__init__(self, self.list)
332
333                 self["actions"] = ActionMap(["SetupActions"],
334                 {
335                         "ok": self.keySave,
336                         "cancel": self.keyCancel,
337                 }, -2)
338
339                 self.slotid = slotid
340                 self.nim = nimmanager.nim_slots[slotid]
341                 self.nimConfig = self.nim.config
342                 self.createConfigMode()
343                 self.createSetup()
344
345         def keyLeft(self):
346                 ConfigListScreen.keyLeft(self)
347                 self.newConfig()
348
349         def keyRight(self):
350                 ConfigListScreen.keyRight(self)
351                 self.newConfig()
352                 
353         def saveAll(self):
354                 if self.nim.isCompatible("DVB-S"):
355                         # reset connectedTo to all choices to properly store the default value
356                         choices = []
357                         nimlist = nimmanager.getNimListOfType("DVB-S", self.slotid)
358                         for id in nimlist:
359                                 choices.append((str(id), nimmanager.getNimDescription(id)))
360                         self.nimConfig.connectedTo.setChoices(choices)
361                 for x in self["config"].list:
362                         x[1].save()
363                         
364         def cancelConfirm(self, result):
365                 if not result:
366                         return
367
368                 for x in self["config"].list:
369                         x[1].cancel()
370                 # we need to call saveAll to reset the connectedTo choices
371                 self.saveAll()
372                 self.close()
373                         
374 class NimSelection(Screen):
375         def __init__(self, session):
376                 Screen.__init__(self, session)
377                 
378                 self.list = [None] * nimmanager.getSlotCount()
379                 self["nimlist"] = List(self.list)
380                 self.updateList()
381
382                 self["actions"] = ActionMap(["OkCancelActions"],
383                 {
384                         "ok": self.okbuttonClick ,
385                         "cancel": self.close
386                 }, -2)
387
388         def okbuttonClick(self):
389                 nim = self["nimlist"].getCurrent()
390                 nim = nim and nim[3]
391                 if nim is not None and not nim.empty:
392                         self.session.openWithCallback(self.updateList, NimSetup, nim.slot)
393
394         def updateList(self):
395                 self.list = [ ]
396                 for x in nimmanager.nim_slots:
397                         slotid = x.slot
398                         nimConfig = nimmanager.getNimConfig(x.slot)
399                         text = nimConfig.configMode.value
400                         if x.isCompatible("DVB-S"):
401                                 if nimConfig.configMode.value in ["loopthrough", "equal", "satposdepends"]:
402                                         text = { "loopthrough": _("loopthrough to"),
403                                                          "equal": _("equal to"),
404                                                          "satposdepends": _("second cable of motorized LNB") } [nimConfig.configMode.value]
405                                         text += " " + _("Tuner") + " " + ["A", "B", "C", "D"][int(nimConfig.connectedTo.value)]
406                                 elif nimConfig.configMode.value == "nothing":
407                                         text = _("nothing connected")
408                                 elif nimConfig.configMode.value == "simple":
409                                         if nimConfig.diseqcMode.value in ["single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"]:
410                                                 text = _("Sats") + ": " + nimmanager.getSatName(int(nimConfig.diseqcA.value))
411                                                 if nimConfig.diseqcMode.value in ["toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"]:
412                                                         text += "," + nimmanager.getSatName(int(nimConfig.diseqcB.value))
413                                                 if nimConfig.diseqcMode.value == "diseqc_a_b_c_d":
414                                                         text += "," + nimmanager.getSatName(int(nimConfig.diseqcC.value))
415                                                         text += "," + nimmanager.getSatName(int(nimConfig.diseqcD.value))
416                                         elif nimConfig.diseqcMode.value == "positioner":
417                                                 text = _("Positioner") + ":"
418                                                 if nimConfig.positionerMode.value == "usals":
419                                                         text += _("USALS")
420                                                 elif nimConfig.positionerMode.value == "manual":
421                                                         text += _("manual")
422                                         else:   
423                                                 text = _("simple")
424                                 elif nimConfig.configMode.value == "advanced":
425                                         text = _("advanced")
426                         elif x.isCompatible("DVB-T") or x.isCompatible("DVB-C"):
427                                 if nimConfig.configMode.value == "nothing":
428                                         text = _("nothing connected")
429                                 elif nimConfig.configMode.value == "enabled":
430                                         text = _("enabled")
431                                 
432                         self.list.append((slotid, x.friendly_full_description, text, x))
433                 self["nimlist"].updateList(self.list)