diff --git a/lib/python/Components/InputDevice.py b/lib/python/Components/InputDevice.py index 33bad1f942d..f35d87e603c 100644 --- a/lib/python/Components/InputDevice.py +++ b/lib/python/Components/InputDevice.py @@ -15,11 +15,6 @@ MODULE_NAME = __name__.split(".")[-1] -REMOTE_MODEL = 0 -REMOTE_RCTYPE = 1 -REMOTE_NAME = 2 -REMOTE_DISPLAY_NAME = 3 - config.inputDevices = ConfigSubsection() @@ -197,6 +192,11 @@ def loadKeyboard(self, index): class RemoteControl: + REMOTE_MODEL = 0 + REMOTE_RCTYPE = 1 + REMOTE_NAME = 2 + REMOTE_DISPLAY_NAME = 3 + knownCompatibleRemotes = [ ("gb0", "gb1", "gb2", "gb3", "gb4"), ("ini0", "ini1", "ini2", "ini3", "ini4", "ini5", "ini6", "ini7", "ini8"), @@ -226,9 +226,9 @@ def __init__(self): default = "0" for index, remote in enumerate(self.remotes): index = str(index) - rcChoices.append((index, remote[REMOTE_DISPLAY_NAME])) - if self.model == remote[REMOTE_MODEL] and self.rcType == remote[REMOTE_RCTYPE] and self.rcName in [x.strip() for x in remote[REMOTE_NAME].split(",")]: - print(f"[InputDevice] Default remote control identified as '{remote[REMOTE_DISPLAY_NAME]}'. (model='{self.model}', rcName='{self.rcName}', rcType='{self.rcType}')") + rcChoices.append((index, remote[self.REMOTE_DISPLAY_NAME])) + if self.model == remote[self.REMOTE_MODEL] and self.rcType == remote[self.REMOTE_RCTYPE] and self.rcName in [x.strip() for x in remote[self.REMOTE_NAME].split(",")]: + print(f"[InputDevice] Default remote control identified as '{remote[self.REMOTE_DISPLAY_NAME]}'. (model='{self.model}', rcName='{self.rcName}', rcType='{self.rcType}')") default = index config.inputDevices.remotesIndex = ConfigSelection(choices=rcChoices, default=default) self.remote = self.loadRemoteControl(BoxInfo.getItem("RCMapping")) diff --git a/lib/python/Screens/Information.py b/lib/python/Screens/Information.py index bd77e6de03f..2c3c4465d31 100644 --- a/lib/python/Screens/Information.py +++ b/lib/python/Screens/Information.py @@ -18,7 +18,7 @@ from Components.config import config from Components.Console import Console from Components.Harddisk import Harddisk, harddiskmanager -from Components.InputDevice import REMOTE_DISPLAY_NAME, REMOTE_NAME, REMOTE_RCTYPE, remoteControl +from Components.InputDevice import remoteControl from Components.Label import Label from Components.Network import iNetwork from Components.NimManager import nimmanager @@ -1403,13 +1403,13 @@ def findPackageRevision(package, packageList): if self.extraSpacing: info.append("") rcIndex = int(config.inputDevices.remotesIndex.value) - info.append(formatLine("P1", _("RC identification"), f"{remoteControl.remotes[rcIndex][REMOTE_DISPLAY_NAME]} (Index: {rcIndex})")) - rcName = remoteControl.remotes[rcIndex][REMOTE_NAME] + info.append(formatLine("P1", _("RC identification"), f"{remoteControl.remotes[rcIndex][remoteControl.REMOTE_DISPLAY_NAME]} (Index: {rcIndex})")) + rcName = remoteControl.remotes[rcIndex][remoteControl.REMOTE_NAME] info.append(formatLine("P1", _("RC selected name"), rcName)) boxName = BoxInfo.getItem("rcname") if boxName != rcName: info.append(formatLine("P1", _("RC default name"), boxName)) - rcType = remoteControl.remotes[rcIndex][REMOTE_RCTYPE] + rcType = remoteControl.remotes[rcIndex][remoteControl.REMOTE_RCTYPE] info.append(formatLine("P1", _("RC selected type"), rcType)) boxType = BoxInfo.getItem("rctype") if boxType != rcType: @@ -1499,8 +1499,8 @@ def findPackageRevision(package, packageList): if hddList: for hdd in hddList: hdd = hdd[1] - capacity = hdd.diskSize() * 1000000 - info.append(formatLine("P1", hdd.model(), f"{scaleNumber(capacity)} ({scaleNumber(capacity, 'Iec')})")) + diskSize = hdd.diskSize() * 1000000 + info.append(formatLine("P1", hdd.model(), f"{scaleNumber(diskSize)} ({scaleNumber(diskSize, 'Iec')})")) else: info.append(formatLine("H", _("No hard disks detected."))) info.append("") @@ -1944,8 +1944,8 @@ def displayInformation(self): diskSize = stat.f_blocks * stat.f_frsize diskFree = stat.f_bfree * stat.f_frsize diskUsed = diskSize - diskFree - info.append(formatLine("P2", _("Mountpoint"), partition.mountpoint)) - info.append(formatLine("P2", _("Capacity"), f"{scaleNumber(diskSize)} ({scaleNumber(diskSize, 'Iec')})")) + info.append(formatLine("P2", _("Mount"), partition.mountpoint)) + info.append(formatLine("P2", _("Size"), f"{scaleNumber(diskSize)} ({scaleNumber(diskSize, 'Iec')})")) info.append(formatLine("P2", _("Used"), f"{scaleNumber(diskUsed)} ({scaleNumber(diskUsed, 'Iec')})")) info.append(formatLine("P2", _("Free"), f"{scaleNumber(diskFree)} ({scaleNumber(diskFree, 'Iec')})")) break @@ -1958,7 +1958,7 @@ def displayInformation(self): info.append(formatLine("S1", hdd.getDeviceName(), hdd.bus())) info.append(formatLine("P2", _("Model"), hdd.model())) diskSize = hdd.diskSize() * 1000000 - info.append(formatLine("P2", _("Capacity"), f"{scaleNumber(diskSize)} ({scaleNumber(diskSize, 'Iec')})")) + info.append(formatLine("P2", _("Size"), f"{scaleNumber(diskSize)} ({scaleNumber(diskSize, 'Iec')})")) info.append(formatLine("P2", _("Sleeping"), (_("Yes") if hdd.isSleeping() else _("No")))) for partition in partitions: if partition.device and join("/dev", partition.device).startswith(hdd.getDeviceName()): @@ -1967,8 +1967,8 @@ def displayInformation(self): diskSize = stat.f_blocks * stat.f_frsize diskFree = stat.f_bfree * stat.f_frsize diskUsed = diskSize - diskFree - info.append(formatLine("P3", _("Mountpoint"), partition.mountpoint)) - info.append(formatLine("P3", _("Capacity"), f"{scaleNumber(diskSize)} ({scaleNumber(diskSize, 'Iec')})")) + info.append(formatLine("P3", _("Mount"), partition.mountpoint)) + info.append(formatLine("P3", _("Size"), f"{scaleNumber(diskSize)} ({scaleNumber(diskSize, 'Iec')})")) info.append(formatLine("P3", _("Used"), f"{scaleNumber(diskUsed)} ({scaleNumber(diskUsed, 'Iec')})")) info.append(formatLine("P3", _("Free"), f"{scaleNumber(diskFree)} ({scaleNumber(diskFree, 'Iec')})")) else: @@ -1985,7 +1985,7 @@ def displayInformation(self): info.append(formatLine("S1", data[5])) if data[0]: info.append(formatLine("P2", _("Network address"), data[0])) - info.append(formatLine("P2", _("Capacity"), data[1])) + info.append(formatLine("P2", _("Size"), data[1])) info.append(formatLine("P2", _("Used"), f"{data[2]} ({data[4]})")) info.append(formatLine("P2", _("Free"), data[3])) else: