1
0

wizard: add keepkey to new wizard

This commit is contained in:
Sander van Grieken
2023-08-23 12:30:20 +02:00
parent 48fb4911a3
commit d70831392d
8 changed files with 52 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
from functools import partial
import threading
from typing import TYPE_CHECKING
from PyQt5.QtCore import Qt, QEventLoop, pyqtSignal, QRegExp
from PyQt5.QtGui import QRegExpValidator
@@ -17,6 +17,10 @@ from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
from ..hw_wallet.plugin import only_hook_if_libraries_available
from .keepkey import KeepKeyPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
from electrum.gui.qt.wizard.wallet import WCScriptAndDerivation, WCHWUninitialized, WCHWUnlock, WCHWXPub
if TYPE_CHECKING:
from electrum.gui.qt.wizard.wallet import QENewWalletWizard
PASSPHRASE_HELP_SHORT =_(
"Passphrases allow you to access new wallets, each "
@@ -310,6 +314,21 @@ class Plugin(KeepKeyPlugin, QtPlugin):
from keepkeylib.qt.pinmatrix import PinMatrixWidget
return PinMatrixWidget
@hook
def init_wallet_wizard(self, wizard: 'QENewWalletWizard'):
self.extend_wizard(wizard)
# insert keepkey pages in new wallet wizard
def extend_wizard(self, wizard: 'QENewWalletWizard'):
super().extend_wizard(wizard)
views = {
'keepkey_start': {'gui': WCScriptAndDerivation},
'keepkey_xpub': {'gui': WCHWXPub},
'keepkey_not_initialized': {'gui': WCHWUninitialized},
'keepkey_unlock': {'gui': WCHWUnlock}
}
wizard.navmap_merge(views)
class SettingsDialog(WindowModalDialog):
'''This dialog doesn't require a device be paired with a wallet.