qt: fix detected account select (#8673)
This commit is contained in:
@@ -471,6 +471,8 @@ class ChoiceWidget(QWidget):
|
|||||||
|
|
||||||
self.selected_index = -1
|
self.selected_index = -1
|
||||||
self.selected_item = None
|
self.selected_item = None
|
||||||
|
self.selected_key = None
|
||||||
|
|
||||||
self.choices = choices
|
self.choices = choices
|
||||||
|
|
||||||
if message and len(message) > 50:
|
if message and len(message) > 50:
|
||||||
@@ -498,8 +500,15 @@ class ChoiceWidget(QWidget):
|
|||||||
def on_selected(self, button):
|
def on_selected(self, button):
|
||||||
self.selected_index = self.group.id(button)
|
self.selected_index = self.group.id(button)
|
||||||
self.selected_item = self.choices[self.selected_index]
|
self.selected_item = self.choices[self.selected_index]
|
||||||
|
self.selected_key = self.choices[self.selected_index][0]
|
||||||
self.itemSelected.emit(self.selected_index)
|
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):
|
def address_field(addresses):
|
||||||
hbox = QHBoxLayout()
|
hbox = QHBoxLayout()
|
||||||
|
|||||||
@@ -700,9 +700,7 @@ class WCScriptAndDerivation(WizardComponent, Logger):
|
|||||||
script_type = account["script_type"]
|
script_type = account["script_type"]
|
||||||
if script_type == "p2pkh":
|
if script_type == "p2pkh":
|
||||||
script_type = "standard"
|
script_type = "standard"
|
||||||
button_index = self.c_values.index(script_type)
|
self.choice_w.select(script_type)
|
||||||
button = self.clayout.group.buttons()[button_index]
|
|
||||||
button.setChecked(True)
|
|
||||||
self.derivation_path_edit.setText(account["derivation_path"])
|
self.derivation_path_edit.setText(account["derivation_path"])
|
||||||
|
|
||||||
button.clicked.connect(lambda: Bip39RecoveryDialog(self, get_account_xpub, on_account_select))
|
button.clicked.connect(lambda: Bip39RecoveryDialog(self, get_account_xpub, on_account_select))
|
||||||
|
|||||||
Reference in New Issue
Block a user