make the sdr type dropdown show beautiful names

This commit is contained in:
Jakob Ketterl
2021-04-17 17:42:08 +02:00
parent 4993a56235
commit 68739724d4
20 changed files with 73 additions and 16 deletions

View File

@ -48,10 +48,11 @@ class SdrDeviceListController(AuthorizationMixin, WebpageController):
)
state_info = ", ".join(
s for s in [
s
for s in [
str(source.getState()),
None if source.isEnabled() else "Disabled",
"Failed" if source.isFailed() else None
"Failed" if source.isFailed() else None,
]
if s is not None
)
@ -276,7 +277,11 @@ class NewSdrDeviceController(SettingsFormController):
Section(
"New device settings",
TextInput("name", "Device name", validator=RequiredValidator()),
DropdownInput("type", "Device type", [Option(name, name) for name in SdrDeviceDescription.getTypes()]),
DropdownInput(
"type",
"Device type",
[Option(sdr_type, name) for sdr_type, name in SdrDeviceDescription.getTypes().items()],
),
TextInput("id", "Device ID", validator=RequiredValidator()),
)
]