Browse Source

plugins: trustedcoin fixes

283
ThomasV 9 years ago
parent
commit
9782734f4c
  1. 17
      plugins/trustedcoin/qt.py
  2. 12
      plugins/trustedcoin/trustedcoin.py

17
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)

12
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'])

Loading…
Cancel
Save