def replace_gui_handler(self, window: ElectrumWindow, keystore: Hardware_KeyStore): handler = self.create_handler(window) keystore.handler = handler # type: ignore keystore.plugin = self # type: ignore action_label = _('Unnamed') if keystore.label and keystore.label.strip(): action_label = keystore.label.strip() action = QAction(read_QIcon(self.icon_unpaired), action_label, window) action.triggered.connect(partial(self.show_settings_wrapped, window, keystore)) action.setToolTip(_("Hardware Wallet")) window.add_toolbar_action(action) handler.action = action handler.icon_unpaired = self.icon_unpaired handler.icon_paired = self.icon_paired
def show_settings_wrapped(self, window: ElectrumWindow, keystore: Hardware_KeyStore) -> None: if isinstance(window, weakref.ProxyType): window = window.reference() try: self.show_settings_dialog(window, keystore) except Exception as e: assert keystore.handler is not None keystore.handler.show_error(str(e))