|
|
|
@ -1,5 +1,5 @@ |
|
|
|
from functools import partial |
|
|
|
from functools import partial |
|
|
|
import threading |
|
|
|
from typing import TYPE_CHECKING |
|
|
|
|
|
|
|
|
|
|
|
from PyQt5.QtCore import Qt, QEventLoop, pyqtSignal, QRegExp |
|
|
|
from PyQt5.QtCore import Qt, QEventLoop, pyqtSignal, QRegExp |
|
|
|
from PyQt5.QtGui import QRegExpValidator |
|
|
|
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 ..hw_wallet.plugin import only_hook_if_libraries_available |
|
|
|
from .keepkey import KeepKeyPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC |
|
|
|
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 =_( |
|
|
|
PASSPHRASE_HELP_SHORT =_( |
|
|
|
"Passphrases allow you to access new wallets, each " |
|
|
|
"Passphrases allow you to access new wallets, each " |
|
|
|
@ -310,6 +314,21 @@ class Plugin(KeepKeyPlugin, QtPlugin): |
|
|
|
from keepkeylib.qt.pinmatrix import PinMatrixWidget |
|
|
|
from keepkeylib.qt.pinmatrix import PinMatrixWidget |
|
|
|
return 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): |
|
|
|
class SettingsDialog(WindowModalDialog): |
|
|
|
'''This dialog doesn't require a device be paired with a wallet. |
|
|
|
'''This dialog doesn't require a device be paired with a wallet. |
|
|
|
|