|
@ -27,6 +27,7 @@ from functools import partial |
|
|
import threading |
|
|
import threading |
|
|
import sys |
|
|
import sys |
|
|
import os |
|
|
import os |
|
|
|
|
|
from typing import TYPE_CHECKING |
|
|
|
|
|
|
|
|
from PyQt5.QtGui import QPixmap |
|
|
from PyQt5.QtGui import QPixmap |
|
|
from PyQt5.QtCore import QObject, pyqtSignal |
|
|
from PyQt5.QtCore import QObject, pyqtSignal |
|
@ -47,6 +48,10 @@ from electrum.base_wizard import GoBack |
|
|
|
|
|
|
|
|
from .trustedcoin import TrustedCoinPlugin, server |
|
|
from .trustedcoin import TrustedCoinPlugin, server |
|
|
|
|
|
|
|
|
|
|
|
if TYPE_CHECKING: |
|
|
|
|
|
from electrum.gui.qt.main_window import ElectrumWindow |
|
|
|
|
|
from electrum.wallet import Abstract_Wallet |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TOS(QTextEdit): |
|
|
class TOS(QTextEdit): |
|
|
tos_signal = pyqtSignal() |
|
|
tos_signal = pyqtSignal() |
|
@ -84,8 +89,7 @@ class Plugin(TrustedCoinPlugin): |
|
|
super().__init__(parent, config, name) |
|
|
super().__init__(parent, config, name) |
|
|
|
|
|
|
|
|
@hook |
|
|
@hook |
|
|
def on_new_window(self, window): |
|
|
def load_wallet(self, wallet: 'Abstract_Wallet', window: 'ElectrumWindow'): |
|
|
wallet = window.wallet |
|
|
|
|
|
if not isinstance(wallet, self.wallet_class): |
|
|
if not isinstance(wallet, self.wallet_class): |
|
|
return |
|
|
return |
|
|
wallet.handler_2fa = HandlerTwoFactor(self, window) |
|
|
wallet.handler_2fa = HandlerTwoFactor(self, window) |
|
|