Browse Source

bitbox02: rm some dead code

hard-fail-on-bad-server-string
SomberNight 5 years ago
committed by TheCharlatan
parent
commit
0268b63fcb
No known key found for this signature in database GPG Key ID: 9B79B45691DB4173
  1. 5
      electrum/plugins/bitbox02/bitbox02.py
  2. 24
      electrum/plugins/bitbox02/qt.py
  3. 6
      electrum/plugins/coldcard/cmdline.py
  4. 16
      electrum/plugins/coldcard/qt.py

5
electrum/plugins/bitbox02/bitbox02.py

@ -131,8 +131,9 @@ class BitBox02Client(HardwareClientBase):
self.config.set_key("bitbox02", bitbox02_config)
def attestation_warning() -> None:
self.handler.attestation_failed_warning(
"The BitBox02 attestation failed.\nTry reconnecting the BitBox02.\nWarning: The device might not be genuine, if the\n problem persists please contact Shift support."
self.handler.show_error(
"The BitBox02 attestation failed.\nTry reconnecting the BitBox02.\nWarning: The device might not be genuine, if the\n problem persists please contact Shift support.",
blocking=True
)
class NoiseConfig(bitbox_api_protocol.BitBoxNoiseConfig):

24
electrum/plugins/bitbox02/qt.py

@ -89,11 +89,9 @@ class Plugin(BitBox02Plugin, QtPluginBase):
class BitBox02_Handler(QtHandlerBase):
setup_signal = pyqtSignal()
def __init__(self, win):
super(BitBox02_Handler, self).__init__(win, "BitBox02")
self.setup_signal.connect(self.setup_dialog)
def message_dialog(self, msg):
self.clear_dialog()
@ -105,24 +103,6 @@ class BitBox02_Handler(QtHandlerBase):
vbox.addWidget(l)
dialog.show()
def attestation_failed_warning(self, msg):
self.clear_dialog()
self.dialog = dialog = WindowModalDialog(None, "BitBox02 Attestation Failed")
l = QLabel(msg)
vbox = QVBoxLayout(dialog)
vbox.addWidget(l)
okButton = OkButton(dialog)
vbox.addWidget(okButton)
dialog.setLayout(vbox)
dialog.exec_()
return
def get_setup(self):
self.done.clear()
self.setup_signal.emit()
self.done.wait()
return
def name_multisig_account(self):
return QMetaObject.invokeMethod(
self,
@ -157,7 +137,3 @@ class BitBox02_Handler(QtHandlerBase):
dialog.setLayout(vbox)
dialog.exec_()
return name.text().strip()
def setup_dialog(self):
self.show_error(_("Please initialize your BitBox02 while connected."))
return

6
electrum/plugins/coldcard/cmdline.py

@ -28,12 +28,6 @@ class ColdcardCmdLineHandler(CmdLineHandler):
def stop(self):
pass
def show_message(self, msg, on_cancel=None):
print_stderr(msg)
def show_error(self, msg, blocking=False):
print_stderr(msg)
def update_status(self, b):
_logger.info(f'hw device status {b}')

16
electrum/plugins/coldcard/qt.py

@ -77,15 +77,10 @@ class Plugin(ColdcardPlugin, QtPluginBase):
class Coldcard_Handler(QtHandlerBase):
setup_signal = pyqtSignal()
#auth_signal = pyqtSignal(object)
def __init__(self, win):
super(Coldcard_Handler, self).__init__(win, 'Coldcard')
self.setup_signal.connect(self.setup_dialog)
#self.auth_signal.connect(self.auth_dialog)
def message_dialog(self, msg):
self.clear_dialog()
self.dialog = dialog = WindowModalDialog(self.top_level_window(), _("Coldcard Status"))
@ -93,16 +88,7 @@ class Coldcard_Handler(QtHandlerBase):
vbox = QVBoxLayout(dialog)
vbox.addWidget(l)
dialog.show()
def get_setup(self):
self.done.clear()
self.setup_signal.emit()
self.done.wait()
return
def setup_dialog(self):
self.show_error(_('Please initialize your Coldcard while disconnected.'))
return
class CKCCSettingsDialog(WindowModalDialog):

Loading…
Cancel
Save