fixes bug #445
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 16 Feb 2010 13:53:12 +0000 (14:53 +0100)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Fri, 12 Mar 2010 22:47:49 +0000 (23:47 +0100)
show diseqc settings in NimSelection

data/skin_default.xml
lib/python/Screens/Satconfig.py

index 56d53dc..0114349 100755 (executable)
@@ -626,14 +626,14 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
        </screen>
        <!-- Nim selection -->
        <screen name="NimSelection" position="center,center" size="400,330" title="Choose Tuner">
-               <widget source="nimlist" render="Listbox" position="0,0" size="380,300" scrollbarMode="showOnDemand">
+               <widget source="nimlist" render="Listbox" position="0,0" size="380,360" scrollbarMode="showOnDemand">
                        <convert type="TemplatedMultiContent">
                                {"template": [
                                                MultiContentEntryText(pos = (10, 5), size = (360, 30), flags = RT_HALIGN_LEFT, text = 1), # index 1 is the nim name,
-                                               MultiContentEntryText(pos = (50, 30), size = (320, 30), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is a description of the nim settings,
+                                               MultiContentEntryText(pos = (50, 30), size = (320, 50), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is a description of the nim settings,
                                        ],
                                 "fonts": [gFont("Regular", 20), gFont("Regular", 15)],
-                                "itemHeight": 70
+                                "itemHeight": 80
                                }
                        </convert>
                </widget>
index 047bde2..647307d 100644 (file)
@@ -498,17 +498,25 @@ class NimSelection(Screen):
                                                text = _("nothing connected")
                                        elif nimConfig.configMode.value == "simple":
                                                if nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
-                                                       text = _("Sats") + ": " 
+                                                       text = {"single": _("Single"), "toneburst_a_b": _("Toneburst A/B"), "diseqc_a_b": _("DiSEqC A/B"), "diseqc_a_b_c_d": _("DiSEqC A/B/C/D")}[nimConfig.diseqcMode.value] + "\n"
+                                                       text += _("Sats") + ": " 
+                                                       satnames = []
                                                        if nimConfig.diseqcA.orbital_position != 3601:
-                                                               text += nimmanager.getSatName(int(nimConfig.diseqcA.value))
+                                                               satnames.append(nimmanager.getSatName(int(nimConfig.diseqcA.value)))
                                                        if nimConfig.diseqcMode.value in ("toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"):
                                                                if nimConfig.diseqcB.orbital_position != 3601:
-                                                                       text += "," + nimmanager.getSatName(int(nimConfig.diseqcB.value))
+                                                                       satnames.append(nimmanager.getSatName(int(nimConfig.diseqcB.value)))
                                                        if nimConfig.diseqcMode.value == "diseqc_a_b_c_d":
                                                                if nimConfig.diseqcC.orbital_position != 3601:
-                                                                       text += "," + nimmanager.getSatName(int(nimConfig.diseqcC.value))
+                                                                       satnames.append(nimmanager.getSatName(int(nimConfig.diseqcC.value)))
                                                                if nimConfig.diseqcD.orbital_position != 3601:
-                                                                       text += "," + nimmanager.getSatName(int(nimConfig.diseqcD.value))
+                                                                       satnames.append(nimmanager.getSatName(int(nimConfig.diseqcD.value)))
+                                                       if len(satnames) <= 2:
+                                                               text += ", ".join(satnames)
+                                                       elif len(satnames) > 2:
+                                                               # we need a newline here, since multi content lists don't support automtic line wrapping
+                                                               text += ", ".join(satnames[:2]) + ",\n"
+                                                               text += "         " + ", ".join(satnames[2:])
                                                elif nimConfig.diseqcMode.value == "positioner":
                                                        text = _("Positioner") + ":"
                                                        if nimConfig.positionerMode.value == "usals":