hw plugins: fix DeviceMgr.select_device
regression from ChoiceWidget refactor
follow-up f7749d62aa
This commit is contained in:
@@ -542,6 +542,7 @@ class ChoiceWidget(QWidget):
|
|||||||
assert isinstance(choices, list)
|
assert isinstance(choices, list)
|
||||||
iterator = enumerate(choices)
|
iterator = enumerate(choices)
|
||||||
for i, c in iterator:
|
for i, c in iterator:
|
||||||
|
assert isinstance(c, tuple), f"{c=!r}"
|
||||||
button = QRadioButton(gb2)
|
button = QRadioButton(gb2)
|
||||||
button.setText(c[1])
|
button.setText(c[1])
|
||||||
vbox2.addWidget(button)
|
vbox2.addWidget(button)
|
||||||
|
|||||||
@@ -1076,7 +1076,8 @@ class DeviceMgr(ThreadJob):
|
|||||||
for info in infos]
|
for info in infos]
|
||||||
self.logger.debug(f"select_device. prompting user for manual selection of {plugin.device}. "
|
self.logger.debug(f"select_device. prompting user for manual selection of {plugin.device}. "
|
||||||
f"num options: {len(infos)}. options: {infos}")
|
f"num options: {len(infos)}. options: {infos}")
|
||||||
c = handler.query_choice(msg, descriptions)
|
choices = list(enumerate(descriptions))
|
||||||
|
c = handler.query_choice(msg, choices)
|
||||||
if c is None:
|
if c is None:
|
||||||
raise UserCancelled()
|
raise UserCancelled()
|
||||||
info = infos[c]
|
info = infos[c]
|
||||||
|
|||||||
Reference in New Issue
Block a user