1
0

always_hook. fix trezor handler. fixes #1146

This commit is contained in:
ThomasV
2015-04-18 14:59:46 +02:00
parent 8f94039355
commit 21b2fcbe85
5 changed files with 38 additions and 30 deletions

View File

@@ -36,7 +36,7 @@ import PyQt4.QtCore as QtCore
from electrum.i18n import _, set_language
from electrum.util import print_error, print_msg
from electrum.plugins import run_hook
from electrum.plugins import run_hook, always_hook
from electrum import WalletStorage, Wallet
from electrum.bitcoin import MIN_RELAY_TX_FEE
@@ -73,6 +73,8 @@ class ElectrumGui:
if app is None:
self.app = QApplication(sys.argv)
self.app.installEventFilter(self.efilter)
# let plugins know that we are using the qt gui
always_hook('init_qt_app', self.app)
def build_tray_menu(self):
@@ -222,7 +224,7 @@ class ElectrumGui:
else:
self.go_full()
# plugins that need to change the GUI do it here
# plugins interact with main window
run_hook('init_qt', self)
w.load_wallet(wallet)

View File

@@ -15,7 +15,7 @@ from amountedit import AmountEdit
import sys
import threading
from electrum.plugins import run_hook
from electrum.plugins import always_hook
from electrum.mnemonic import prepare_seed
MSG_ENTER_ANYTHING = _("Please enter a wallet seed, a master public key, a list of Bitcoin addresses, or a list of private keys")
@@ -385,7 +385,7 @@ class InstallWizard(QDialog):
self.waiting_dialog(wallet.synchronize)
else:
f = run_hook('get_wizard_action', self, wallet, action)
f = always_hook('get_wizard_action', self, wallet, action)
if not f:
raise BaseException('unknown wizard action', action)
r = f(wallet, self)
@@ -452,7 +452,7 @@ class InstallWizard(QDialog):
else:
self.storage.put('wallet_type', t)
wallet = run_hook('installwizard_restore', self, self.storage)
wallet = always_hook('installwizard_restore', self, self.storage)
if not wallet:
return