Better install wizard
Break out the workflow logic of the install wizard into a base class. This means reimplementing with full support in a new GUI is now easy; you just provide ways to request passwords, show messages etc. The API is fully documented in the base class. There are a couple of minor outstanding issues, including that the old messages shown when recovering a wallet are missing. I will come back to that. Ledger wallet might be broken. Other improvements: The install wizard code is now easy to follow and understand. Hardware wallets can now be restored without any need for their accompanying libraries. Various bits of trustedcoin were broken and have been fixed. Many plugin hooks can be removed. I have only started on this.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
from functools import partial
|
||||
from threading import Thread
|
||||
import re
|
||||
|
||||
from PyQt4.QtGui import *
|
||||
from PyQt4.QtCore import *
|
||||
@@ -28,8 +29,9 @@ 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 electrum import wizard
|
||||
|
||||
from trustedcoin import TrustedCoinPlugin, Wallet_2fa
|
||||
from trustedcoin import TrustedCoinPlugin, Wallet_2fa, DISCLAIMER, server
|
||||
|
||||
def need_server(wallet, tx):
|
||||
from electrum.account import BIP32_Account
|
||||
@@ -90,6 +92,11 @@ class Plugin(TrustedCoinPlugin):
|
||||
return WaitingDialog(window, 'Getting billing information...', task,
|
||||
on_finished)
|
||||
|
||||
def show_disclaimer(self, wallet, window):
|
||||
icon = QPixmap(':icons/trustedcoin.png')
|
||||
window.confirm('\n\n'.join(DISCLAIMER), icon=icon)
|
||||
self.set_enabled(wallet, True)
|
||||
|
||||
@hook
|
||||
def abort_send(self, window):
|
||||
wallet = window.wallet
|
||||
@@ -225,10 +232,9 @@ class Plugin(TrustedCoinPlugin):
|
||||
email_e.setFocus(True)
|
||||
|
||||
if not window.exec_():
|
||||
return
|
||||
raise wizard.UserCancelled
|
||||
|
||||
email = str(email_e.text())
|
||||
return email
|
||||
return str(email_e.text())
|
||||
|
||||
|
||||
def setup_google_auth(self, window, _id, otp_secret):
|
||||
|
||||
Reference in New Issue
Block a user