1
0

qt: fix detected account select (#8673)

This commit is contained in:
Sander van Grieken
2023-11-02 12:48:21 +01:00
parent e8f5aa50ca
commit 4671c002c9
2 changed files with 10 additions and 3 deletions

View File

@@ -471,6 +471,8 @@ class ChoiceWidget(QWidget):
self.selected_index = -1
self.selected_item = None
self.selected_key = None
self.choices = choices
if message and len(message) > 50:
@@ -498,8 +500,15 @@ class ChoiceWidget(QWidget):
def on_selected(self, button):
self.selected_index = self.group.id(button)
self.selected_item = self.choices[self.selected_index]
self.selected_key = self.choices[self.selected_index][0]
self.itemSelected.emit(self.selected_index)
def select(self, key):
iterator = enumerate(self.choices)
for i, c in iterator:
if key == c[0]:
self.group.button(i).click()
def address_field(addresses):
hbox = QHBoxLayout()

View File

@@ -700,9 +700,7 @@ class WCScriptAndDerivation(WizardComponent, Logger):
script_type = account["script_type"]
if script_type == "p2pkh":
script_type = "standard"
button_index = self.c_values.index(script_type)
button = self.clayout.group.buttons()[button_index]
button.setChecked(True)
self.choice_w.select(script_type)
self.derivation_path_edit.setText(account["derivation_path"])
button.clicked.connect(lambda: Bip39RecoveryDialog(self, get_account_xpub, on_account_select))