Merge pull request #3102 from SomberNight/2fa_plugin_cant_be_disabled
Disallow disabling TrustedCoin for 2FA wallets
This commit is contained in:
commit
55e6c247bc
|
@ -2853,8 +2853,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
|||
continue
|
||||
try:
|
||||
cb = QCheckBox(descr['fullname'])
|
||||
cb.setEnabled(plugins.is_available(name, self.wallet))
|
||||
cb.setChecked(p is not None and p.is_enabled())
|
||||
plugin_is_loaded = p is not None
|
||||
cb_enabled = (not plugin_is_loaded and plugins.is_available(name, self.wallet)
|
||||
or plugin_is_loaded and p.can_user_disable())
|
||||
cb.setEnabled(cb_enabled)
|
||||
cb.setChecked(plugin_is_loaded and p.is_enabled())
|
||||
grid.addWidget(cb, i, 0)
|
||||
enable_settings_widget(p, name, i)
|
||||
cb.clicked.connect(partial(do_toggle, cb, name, i))
|
||||
|
|
|
@ -253,6 +253,9 @@ class BasePlugin(PrintError):
|
|||
def is_available(self):
|
||||
return True
|
||||
|
||||
def can_user_disable(self):
|
||||
return True
|
||||
|
||||
def settings_dialog(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -332,6 +332,9 @@ class TrustedCoinPlugin(BasePlugin):
|
|||
def is_enabled(self):
|
||||
return True
|
||||
|
||||
def can_user_disable(self):
|
||||
return False
|
||||
|
||||
@hook
|
||||
def get_tx_extra_fee(self, wallet, tx):
|
||||
if type(wallet) != Wallet_2fa:
|
||||
|
|
Loading…
Reference in New Issue