wizard: "terms of use": add version number
follow-up https://github.com/spesmilo/electrum/pull/9794
This commit is contained in:
@@ -80,11 +80,12 @@ MSG_LN_UTXO_RESERVE = (
|
||||
)
|
||||
|
||||
# not to be translated
|
||||
MSG_TERMS_OF_USE = """
|
||||
1. Electrum is distributed under the MIT licence by Electrum Technologies GmbH. Most notably, this means that the Electrum software is provided as is, and that it comes without warranty.
|
||||
MSG_TERMS_OF_USE = (
|
||||
"""1. Electrum is distributed under the MIT licence by Electrum Technologies GmbH. Most notably, this means that the Electrum software is provided as is, and that it comes without warranty.
|
||||
|
||||
2. We are neither a bank nor a financial service provider. In addition, we do not not store user account data, and we are not an intermediary in the interaction between our software and the Bitcoin blockchain. Therefore, we do not have the possibility to freeze funds or to undo a fraudulent transaction.
|
||||
|
||||
3. We do not provide private user support. All issue resolutions are public, and take place on Github or public forums. If someone posing as 'Electrum support' proposes to help you via a private channel, this person is most likely an imposter trying to steal your bitcoins.
|
||||
"""
|
||||
3. We do not provide private user support. All issue resolutions are public, and take place on Github or public forums. If someone posing as 'Electrum support' proposes to help you via a private channel, this person is most likely an imposter trying to steal your bitcoins."""
|
||||
)
|
||||
TERMS_OF_USE_LATEST_VERSION : int = 1 # bump this if we want users re-prompted due to changes
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ from electrum.keystore import load_keystore
|
||||
from electrum.bip32 import is_xprv
|
||||
|
||||
from electrum.gui.common_qt.i18n import ElectrumTranslator
|
||||
from electrum.gui.messages import TERMS_OF_USE_LATEST_VERSION
|
||||
|
||||
from .util import read_QIcon, ColorScheme, custom_message_box, MessageBoxMixin, WWLabel
|
||||
from .main_window import ElectrumWindow
|
||||
@@ -504,7 +505,7 @@ class ElectrumGui(BaseElectrumGui, Logger):
|
||||
"""Ask the user to accept the terms of use.
|
||||
This is only shown if the user has not accepted them yet.
|
||||
"""
|
||||
if self.config.TERMS_OF_USE_ACCEPTED:
|
||||
if self.config.TERMS_OF_USE_ACCEPTED >= TERMS_OF_USE_LATEST_VERSION:
|
||||
return
|
||||
from electrum.gui.qt.wizard.terms_of_use import QETermsOfUseWizard
|
||||
dialog = QETermsOfUseWizard(self.config, self.app)
|
||||
|
||||
@@ -6,7 +6,7 @@ from PyQt6.QtWidgets import QLabel, QHBoxLayout, QScrollArea
|
||||
|
||||
from electrum.i18n import _
|
||||
from electrum.wizard import TermsOfUseWizard
|
||||
from electrum.gui.qt.util import icon_path
|
||||
from electrum.gui.qt.util import icon_path, WWLabel
|
||||
from electrum.gui import messages
|
||||
from .wizard import QEAbstractWizard, WizardComponent
|
||||
|
||||
@@ -48,9 +48,8 @@ class WCTermsOfUseScreen(WizardComponent):
|
||||
|
||||
self.layout().addLayout(hbox_img)
|
||||
|
||||
self.tos_label = QLabel()
|
||||
self.tos_label = WWLabel()
|
||||
self.tos_label.setText(messages.MSG_TERMS_OF_USE)
|
||||
self.tos_label.setWordWrap(True)
|
||||
self.layout().addWidget(self.tos_label)
|
||||
self._valid = False
|
||||
|
||||
|
||||
@@ -847,7 +847,7 @@ Warning: setting this to too low will result in lots of payment failures."""),
|
||||
QR_READER_FLIP_X = ConfigVar('qrreader_flip_x', default=True, type_=bool)
|
||||
WIZARD_DONT_CREATE_SEGWIT = ConfigVar('nosegwit', default=False, type_=bool)
|
||||
CONFIG_FORGET_CHANGES = ConfigVar('forget_config', default=False, type_=bool)
|
||||
TERMS_OF_USE_ACCEPTED = ConfigVar('terms_of_use_accepted', default=False, type_=bool)
|
||||
TERMS_OF_USE_ACCEPTED = ConfigVar('terms_of_use_accepted', default=0, type_=int)
|
||||
|
||||
# connect to remote submarine swap server
|
||||
SWAPSERVER_URL = ConfigVar('swapserver_url', default='', type_=str)
|
||||
|
||||
@@ -3,6 +3,8 @@ import os
|
||||
|
||||
from typing import List, NamedTuple, Any, Dict, Optional, Tuple, TYPE_CHECKING
|
||||
|
||||
from electrum.gui.messages import TERMS_OF_USE_LATEST_VERSION
|
||||
|
||||
from electrum.i18n import _
|
||||
from electrum.interface import ServerAddr
|
||||
from electrum.keystore import hardware_keystore
|
||||
@@ -784,7 +786,7 @@ class TermsOfUseWizard(AbstractWizard):
|
||||
}
|
||||
|
||||
def accept_terms_of_use(self, _):
|
||||
self._config.TERMS_OF_USE_ACCEPTED = True
|
||||
self._config.TERMS_OF_USE_ACCEPTED = TERMS_OF_USE_LATEST_VERSION
|
||||
|
||||
def start(self, initial_data: dict = None) -> WizardViewState:
|
||||
if initial_data is None:
|
||||
|
||||
Reference in New Issue
Block a user