gui: move reused text to messages.py
This commit is contained in:
@@ -30,12 +30,19 @@ MSG_LIGHTNING_SCB_WARNING = _(
|
||||
|
||||
MSG_LIGHTNING_WARNING = MSG_LIGHTNING_EXPERIMENTAL_WARNING + "\n\n" + MSG_LIGHTNING_SCB_WARNING
|
||||
|
||||
MGS_CONFLICTING_BACKUP_INSTANCE = _(
|
||||
MSG_CONFLICTING_BACKUP_INSTANCE = _(
|
||||
"""Another instance of this wallet (same seed) has an open channel with the same remote node. If you create this channel, you will not be able to use both wallets at the same time.
|
||||
|
||||
Are you sure?"""
|
||||
)
|
||||
|
||||
MSG_LN_EXPLAIN_SCB_BACKUPS = "".join([
|
||||
_("Channel backups can be imported in another instance of the same wallet."), " ",
|
||||
_("In the Electrum mobile app, use the 'Send' button to scan this QR code."), " ",
|
||||
"\n\n",
|
||||
_("Please note that channel backups cannot be used to restore your channels."), " ",
|
||||
_("If you lose your wallet file, the only thing you can do with a backup is to request your channel to be closed, so that your funds will be sent on-chain."),
|
||||
])
|
||||
|
||||
MSG_CAPITAL_GAINS = _(
|
||||
"""This summary covers only on-chain transactions (no lightning!). Capital gains are computed by attaching an acquisition price to each UTXO in the wallet, and uses the order of blockchain events (not FIFO)."""
|
||||
|
||||
@@ -326,10 +326,4 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener):
|
||||
|
||||
@pyqtSlot(result=str)
|
||||
def channelBackupHelpText(self):
|
||||
return ' '.join([
|
||||
_("Channel backups can be imported in another instance of the same wallet."),
|
||||
_("In the Electrum mobile app, use the 'Send' button to scan this QR code."),
|
||||
'\n\n',
|
||||
_("Please note that channel backups cannot be used to restore your channels."),
|
||||
_("If you lose your wallet file, the only thing you can do with a backup is to request your channel to be closed, so that your funds will be sent on-chain."),
|
||||
])
|
||||
return messages.MSG_LN_EXPLAIN_SCB_BACKUPS
|
||||
|
||||
@@ -163,7 +163,7 @@ class QEChannelOpener(QObject, AuthMixin):
|
||||
|
||||
lnworker = self._wallet.wallet.lnworker
|
||||
if lnworker.has_conflicting_backup_with(self._node_pubkey) and not confirm_backup_conflict:
|
||||
self.conflictingBackup.emit(messages.MGS_CONFLICTING_BACKUP_INSTANCE)
|
||||
self.conflictingBackup.emit(messages.MSG_CONFLICTING_BACKUP_INSTANCE)
|
||||
return
|
||||
|
||||
amount = '!' if self._amount.isMax else self._amount.satsInt
|
||||
|
||||
@@ -170,13 +170,7 @@ class ChannelsList(MyTreeView):
|
||||
self.lnworker.remove_channel_backup(channel_id)
|
||||
|
||||
def export_channel_backup(self, channel_id):
|
||||
msg = ' '.join([
|
||||
_("Channel backups can be imported in another instance of the same wallet."),
|
||||
_("In the Electrum mobile app, use the 'Send' button to scan this QR code."),
|
||||
'\n\n',
|
||||
_("Please note that channel backups cannot be used to restore your channels."),
|
||||
_("If you lose your wallet file, the only thing you can do with a backup is to request your channel to be closed, so that your funds will be sent on-chain."),
|
||||
])
|
||||
msg = messages.MSG_LN_EXPLAIN_SCB_BACKUPS
|
||||
data = self.lnworker.export_channel_backup(channel_id)
|
||||
self.main_window.show_qrcode(data, 'channel backup', help_text=msg,
|
||||
show_copy_text_btn=True)
|
||||
|
||||
@@ -1401,7 +1401,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
|
||||
self.show_error(str(e))
|
||||
return
|
||||
if self.wallet.lnworker.has_conflicting_backup_with(node_id):
|
||||
msg = messages.MGS_CONFLICTING_BACKUP_INSTANCE
|
||||
msg = messages.MSG_CONFLICTING_BACKUP_INSTANCE
|
||||
if not self.question(msg):
|
||||
return
|
||||
# we need to know the fee before we broadcast, because the txid is required
|
||||
|
||||
Reference in New Issue
Block a user