don't offer recovery type choice for trezor T
This commit is contained in:
parent
364cfd17ae
commit
5fafd34de7
@ -233,6 +233,10 @@ class TrezorClientBase(GuiMixin, PrintError):
|
||||
def atleast_version(self, major, minor=0, patch=0):
|
||||
return self.firmware_version() >= (major, minor, patch)
|
||||
|
||||
def get_trezor_model(self):
|
||||
"""Returns '1' for Trezor One, 'T' for Trezor T."""
|
||||
return self.features.model
|
||||
|
||||
@staticmethod
|
||||
def wrapper(func):
|
||||
'''Wrap methods to clear any message box they opened.'''
|
||||
|
||||
@ -181,7 +181,7 @@ class QtPlugin(QtPluginBase):
|
||||
if device_id:
|
||||
SettingsDialog(window, self, keystore, device_id).exec_()
|
||||
|
||||
def request_trezor_init_settings(self, wizard, method, device):
|
||||
def request_trezor_init_settings(self, wizard, method, model):
|
||||
vbox = QVBoxLayout()
|
||||
next_enabled = True
|
||||
label = QLabel(_("Enter a label to name your device:"))
|
||||
@ -251,7 +251,7 @@ class QtPlugin(QtPluginBase):
|
||||
vbox.addWidget(cb_phrase)
|
||||
|
||||
# ask for recovery type (random word order OR matrix)
|
||||
if method == TIM_RECOVER:
|
||||
if method == TIM_RECOVER and not model == 'T':
|
||||
gb_rectype = QGroupBox()
|
||||
hbox_rectype = QHBoxLayout()
|
||||
gb_rectype.setLayout(hbox_rectype)
|
||||
@ -271,13 +271,15 @@ class QtPlugin(QtPluginBase):
|
||||
bg_rectype.addButton(rb2)
|
||||
bg_rectype.setId(rb2, RECOVERY_TYPE_MATRIX)
|
||||
hbox_rectype.addWidget(rb2)
|
||||
else:
|
||||
bg_rectype = None
|
||||
|
||||
wizard.exec_layout(vbox, next_enabled=next_enabled)
|
||||
|
||||
if method in [TIM_NEW, TIM_RECOVER]:
|
||||
item = bg_numwords.checkedId()
|
||||
pin = cb_pin.isChecked()
|
||||
recovery_type = bg_rectype.checkedId()
|
||||
recovery_type = bg_rectype.checkedId() if bg_rectype else None
|
||||
else:
|
||||
item = ' '.join(str(clean_text(text)).split())
|
||||
pin = str(pin.text())
|
||||
|
||||
@ -196,9 +196,12 @@ class TrezorPlugin(HW_PluginBase):
|
||||
(TIM_MNEMONIC, _("Upload a BIP39 mnemonic to generate the seed")),
|
||||
(TIM_PRIVKEY, _("Upload a master private key"))
|
||||
]
|
||||
devmgr = self.device_manager()
|
||||
client = devmgr.client_by_id(device_id)
|
||||
model = client.get_trezor_model()
|
||||
def f(method):
|
||||
import threading
|
||||
settings = self.request_trezor_init_settings(wizard, method, self.device)
|
||||
settings = self.request_trezor_init_settings(wizard, method, model)
|
||||
t = threading.Thread(target=self._initialize_device_safe, args=(settings, method, device_id, wizard, handler))
|
||||
t.setDaemon(True)
|
||||
t.start()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user