diff --git a/plugins/trustedcoin/qt.py b/plugins/trustedcoin/qt.py index c716f80e6..5961ddd4a 100644 --- a/plugins/trustedcoin/qt.py +++ b/plugins/trustedcoin/qt.py @@ -1,12 +1,29 @@ from PyQt4.QtGui import * from PyQt4.QtCore import * + from electrum_gui.qt.util import * from electrum_gui.qt.qrcodewidget import QRCodeWidget from electrum_gui.qt.amountedit import AmountEdit from electrum_gui.qt.main_window import StatusBarButton +from electrum.i18n import _ +from electrum.plugins import hook + +from trustedcoin import TrustedCoinPlugin class Plugin(TrustedCoinPlugin): + @hook + def on_new_window(self, window): + wallet = window.wallet + if wallet.storage.get('wallet_type') == '2fa': + button = StatusBarButton(QIcon(":icons/trustedcoin.png"), + _("TrustedCoin"), + partial(self.settings_dialog, window)) + window.statusBar().addPermanentWidget(button) + t = Thread(target=self.request_billing_info, args=(wallet,)) + t.setDaemon(True) + t.start() + def auth_dialog(self, window): d = QDialog(window) d.setModal(1) diff --git a/plugins/trustedcoin/trustedcoin.py b/plugins/trustedcoin/trustedcoin.py index 9451c1811..d50c00807 100644 --- a/plugins/trustedcoin/trustedcoin.py +++ b/plugins/trustedcoin/trustedcoin.py @@ -302,18 +302,6 @@ class TrustedCoinPlugin(BasePlugin): def is_enabled(self): return True - @hook - def on_new_window(self, window): - wallet = window.wallet - if wallet.storage.get('wallet_type') == '2fa': - button = StatusBarButton(QIcon(":icons/trustedcoin.png"), - _("TrustedCoin"), - partial(self.settings_dialog, window)) - window.statusBar().addPermanentWidget(button) - t = Thread(target=self.request_billing_info, args=(wallet,)) - t.setDaemon(True) - t.start() - def request_billing_info(self, wallet): billing_info = server.get(wallet.get_user_id()[1]) billing_address = make_billing_address(wallet, billing_info['billing_index'])