def choose_sub_device(self, radio):
devices = radio.get_sub_devices()
choices = [x.VARIANT for x in devices]
d = inputdialog.ChoiceDialog(choices)
text = _("The {vendor} {model} has multiple independent sub-devices")
d.label.set_text(text.format(vendor=radio.VENDOR, model=radio.MODEL) +
os.linesep + _("Choose one to import from:"))
r = d.run()
chosen = d.choice.get_active_text()
d.destroy()
if r == gtk.RESPONSE_CANCEL:
raise Exception(_("Cancelled"))
for d in devices:
if d.VARIANT == chosen:
return d
raise Exception(_("Internal Error"))
评论列表
文章目录