electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 9782734f4ca2b28a6ee58d6d70cc5470ebd001a6
parent 042f8ef832ff969532b0915cb5b77cc58fcea60e
Author: ThomasV <thomasv@electrum.org>
Date:   Thu, 26 Nov 2015 14:15:54 +0100

plugins: trustedcoin fixes

Diffstat:
Mplugins/trustedcoin/qt.py | 17+++++++++++++++++
Mplugins/trustedcoin/trustedcoin.py | 12------------
2 files changed, 17 insertions(+), 12 deletions(-)

diff --git 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 @@ -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'])