mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-05 05:15:12 +00:00
enable trezor plugin if about to create/restore wallet
This commit is contained in:
parent
8a7f81a9de
commit
e4a6a2962e
1 changed files with 16 additions and 0 deletions
|
@ -36,6 +36,7 @@ class Plugin(BasePlugin):
|
||||||
def __init__(self, gui, name):
|
def __init__(self, gui, name):
|
||||||
BasePlugin.__init__(self, gui, name)
|
BasePlugin.__init__(self, gui, name)
|
||||||
self._is_available = self._init()
|
self._is_available = self._init()
|
||||||
|
self.wallet = None
|
||||||
|
|
||||||
def _init(self):
|
def _init(self):
|
||||||
return TREZOR
|
return TREZOR
|
||||||
|
@ -43,9 +44,24 @@ class Plugin(BasePlugin):
|
||||||
def is_available(self):
|
def is_available(self):
|
||||||
return self._is_available
|
return self._is_available
|
||||||
|
|
||||||
|
def set_enabled(self, enabled):
|
||||||
|
self.wallet.storage.put('use_' + self.name, enabled)
|
||||||
|
|
||||||
|
def is_enabled(self):
|
||||||
|
if not self.is_available():
|
||||||
|
return False
|
||||||
|
|
||||||
|
if not self.wallet:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return self.wallet.storage.get('use_' + self.name) is True
|
||||||
|
|
||||||
def enable(self):
|
def enable(self):
|
||||||
return BasePlugin.enable(self)
|
return BasePlugin.enable(self)
|
||||||
|
|
||||||
|
def load_wallet(self, wallet):
|
||||||
|
self.wallet = wallet
|
||||||
|
|
||||||
def add_wallet_types(self, wallet_types):
|
def add_wallet_types(self, wallet_types):
|
||||||
wallet_types.append(('trezor', _("Trezor wallet"), TrezorWallet))
|
wallet_types.append(('trezor', _("Trezor wallet"), TrezorWallet))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue