Browse Source

fix trezor statusbar

283 2.4.1
ThomasV 10 years ago
parent
commit
94ecf8dd7d
  1. 8
      plugins/trezor.py

8
plugins/trezor.py

@ -22,7 +22,7 @@ from electrum.util import print_error, print_msg
from electrum.wallet import pw_decode, bip32_private_derivation, bip32_root from electrum.wallet import pw_decode, bip32_private_derivation, bip32_root
from electrum_gui.qt.util import * from electrum_gui.qt.util import *
from electrum_gui.qt.main_window import StatusBarButton from electrum_gui.qt.main_window import StatusBarButton, ElectrumWindow
try: try:
from trezorlib.client import types from trezorlib.client import types
@ -130,7 +130,8 @@ class Plugin(BasePlugin):
self.window = window self.window = window
self.wallet.plugin = self self.wallet.plugin = self
self.trezor_button = StatusBarButton(QIcon(":icons/trezor.png"), _("Trezor"), self.settings_dialog) self.trezor_button = StatusBarButton(QIcon(":icons/trezor.png"), _("Trezor"), self.settings_dialog)
self.window.statusBar().addPermanentWidget(self.trezor_button) if type(window) is ElectrumWindow:
self.window.statusBar().addPermanentWidget(self.trezor_button)
if self.handler is None: if self.handler is None:
self.handler = TrezorQtHandler(self.window.app) self.handler = TrezorQtHandler(self.window.app)
try: try:
@ -145,7 +146,8 @@ class Plugin(BasePlugin):
@hook @hook
def close_wallet(self): def close_wallet(self):
self.window.statusBar().removeWidget(self.trezor_button) if type(self.window) is ElectrumWindow:
self.window.statusBar().removeWidget(self.trezor_button)
@hook @hook
def installwizard_load_wallet(self, wallet, window): def installwizard_load_wallet(self, wallet, window):

Loading…
Cancel
Save