From 0a2a22b8225b2fea58fca7668179e3a27f240d34 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 5 Feb 2024 14:39:03 +0100 Subject: [PATCH] qt: use selected_key instead of selected_item[0] for ChoiceWidgets --- electrum/gui/qt/wizard/wallet.py | 12 ++++++------ electrum/plugins/safe_t/qt.py | 2 +- electrum/plugins/trezor/qt.py | 2 +- electrum/plugins/trustedcoin/qt.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/electrum/gui/qt/wizard/wallet.py b/electrum/gui/qt/wizard/wallet.py index 48f001609..dbe4beb50 100644 --- a/electrum/gui/qt/wizard/wallet.py +++ b/electrum/gui/qt/wizard/wallet.py @@ -423,7 +423,7 @@ class WCWalletType(WalletWizardComponent): self._valid = True def apply(self): - self.wizard_data['wallet_type'] = self.choice_w.selected_item[0] + self.wizard_data['wallet_type'] = self.choice_w.selected_key class WCKeystoreType(WalletWizardComponent): @@ -443,7 +443,7 @@ class WCKeystoreType(WalletWizardComponent): self._valid = True def apply(self): - self.wizard_data['keystore_type'] = self.choice_w.selected_item[0] + self.wizard_data['keystore_type'] = self.choice_w.selected_key class WCCreateSeed(WalletWizardComponent): @@ -767,7 +767,7 @@ class WCScriptAndDerivation(WalletWizardComponent, Logger): def apply(self): cosigner_data = self.wizard.current_cosigner(self.wizard_data) - cosigner_data['script_type'] = self.choice_w.selected_item[0] + cosigner_data['script_type'] = self.choice_w.selected_key cosigner_data['derivation_path'] = str(self.derivation_path_edit.text()) @@ -812,10 +812,10 @@ class WCCosignerKeystore(WalletWizardComponent): self.layout().addStretch(1) def apply(self): - self.wizard_data['cosigner_keystore_type'] = self.choice_w.selected_item[0] + self.wizard_data['cosigner_keystore_type'] = self.choice_w.selected_key self.wizard_data['multisig_current_cosigner'] = self.cosigner self.wizard_data['multisig_cosigner_data'][str(self.cosigner)] = { - 'keystore_type': self.choice_w.selected_item[0] + 'keystore_type': self.choice_w.selected_key } @@ -1231,7 +1231,7 @@ class WCChooseHWDevice(WalletWizardComponent, Logger): def apply(self): if self.choice_w: cosigner_data = self.wizard.current_cosigner(self.wizard_data) - cosigner_data['hardware_device'] = self.choice_w.selected_item[0] + cosigner_data['hardware_device'] = self.choice_w.selected_key class WCWalletPasswordHardware(WalletWizardComponent): diff --git a/electrum/plugins/safe_t/qt.py b/electrum/plugins/safe_t/qt.py index 1595d40ad..08142476a 100644 --- a/electrum/plugins/safe_t/qt.py +++ b/electrum/plugins/safe_t/qt.py @@ -562,7 +562,7 @@ class WCSafeTInitMethod(WizardComponent): self._valid = True def apply(self): - self.wizard_data['safe_t_init'] = self.choice_w.selected_item[0] + self.wizard_data['safe_t_init'] = self.choice_w.selected_key class WCSafeTInitParams(WizardComponent): diff --git a/electrum/plugins/trezor/qt.py b/electrum/plugins/trezor/qt.py index 649b31dae..43dfe8a01 100644 --- a/electrum/plugins/trezor/qt.py +++ b/electrum/plugins/trezor/qt.py @@ -843,7 +843,7 @@ class WCTrezorInitMethod(WizardComponent, Logger): self._valid = True def apply(self): - self.wizard_data['trezor_init'] = self.choice_w.selected_item[0] + self.wizard_data['trezor_init'] = self.choice_w.selected_key class WCTrezorInitParams(WizardComponent): diff --git a/electrum/plugins/trustedcoin/qt.py b/electrum/plugins/trustedcoin/qt.py index d3e5c32b7..97d79aee8 100644 --- a/electrum/plugins/trustedcoin/qt.py +++ b/electrum/plugins/trustedcoin/qt.py @@ -357,7 +357,7 @@ class WCChooseSeed(WizardComponent): self._valid = True def apply(self): - self.wizard_data['keystore_type'] = self.choice_w.selected_item[0] + self.wizard_data['keystore_type'] = self.choice_w.selected_key class WCTerms(WizardComponent): @@ -559,7 +559,7 @@ class WCKeepDisable(WizardComponent): self._valid = True def apply(self): - self.wizard_data['trustedcoin_keepordisable'] = self.choice_w.selected_item[0] + self.wizard_data['trustedcoin_keepordisable'] = self.choice_w.selected_key class WCContinueOnline(WizardComponent):