1
0

fix trezor initialiation hook (pass window in load_wallet)

This commit is contained in:
ThomasV
2015-06-09 09:58:40 +02:00
parent 70037b89a9
commit f70a996619
10 changed files with 18 additions and 24 deletions

View File

@@ -73,7 +73,7 @@ class Plugin(BasePlugin):
return True
@hook
def load_wallet(self, wallet):
def load_wallet(self, wallet, window):
if self.btchip_is_connected():
if not self.wallet.check_proper_device():
QMessageBox.information(self.window, _('Error'), _("This wallet does not match your BTChip device"), _('OK'))

View File

@@ -95,7 +95,7 @@ class Plugin(BasePlugin):
return self.wallet.wallet_type in ['2of2', '2of3']
@hook
def load_wallet(self, wallet):
def load_wallet(self, wallet, window):
self.wallet = wallet
if not self.is_available():
return

View File

@@ -259,7 +259,7 @@ class Plugin(BasePlugin):
return quote_text
@hook
def load_wallet(self, wallet):
def load_wallet(self, wallet, window):
tx_list = {}
for item in self.wallet.get_history(self.wallet.storage.get("current_account", None)):
tx_hash, conf, value, timestamp, balance = item

View File

@@ -51,7 +51,7 @@ class Plugin(BasePlugin):
self.window.connect(self.window, SIGNAL('labels:pulled'), self.on_pulled)
@hook
def load_wallet(self, wallet):
def load_wallet(self, wallet, window):
self.wallet = wallet
self.wallet_nonce = self.wallet.storage.get("wallet_nonce")

View File

@@ -46,6 +46,7 @@ class Plugin(BasePlugin):
self._is_available = self._init()
self._requires_settings = True
self.wallet = None
self.handler = None
def constructor(self, s):
return TrezorWallet(s)
@@ -82,9 +83,6 @@ class Plugin(BasePlugin):
return False
return True
@hook
def add_plugin(self, wallet):
wallet.plugin = self
@hook
def close_wallet(self):
@@ -94,17 +92,19 @@ class Plugin(BasePlugin):
self.wallet.client.transport.close()
self.wallet = None
@hook
def init_qt_app(self, app):
self.handler = TrezorQtHandler(app)
@hook
def init_cmdline(self):
self.handler = TrezorCmdLineHandler()
@hook
def load_wallet(self, wallet):
def load_wallet(self, wallet, window):
self.wallet = wallet
self.window = window
self.wallet.plugin = self
if self.handler is None:
self.handler = TrezorQtHandler(self.window.app)
if self.trezor_is_connected():
if not self.wallet.check_proper_device():
QMessageBox.information(self.window, _('Error'), _("This wallet does not match your Trezor device"), _('OK'))
@@ -186,7 +186,6 @@ class TrezorWallet(BIP32_HD_Wallet):
self.mpk = None
self.device_checked = False
self.force_watching_only = False
always_hook('add_plugin', self)
def get_action(self):
if not self.accounts:

View File

@@ -322,7 +322,7 @@ class Plugin(BasePlugin):
self.is_billing = False
@hook
def load_wallet(self, wallet):
def load_wallet(self, wallet, window):
self.trustedcoin_button = StatusBarButton( QIcon(":icons/trustedcoin.png"), _("Network"), self.settings_dialog)
self.window.statusBar().addPermanentWidget(self.trustedcoin_button)
self.xpub = self.wallet.master_public_keys.get('x1/')