1
0

gui: move reused text to messages.py

This commit is contained in:
SomberNight
2025-03-11 15:08:45 +00:00
parent c7dcfab3fc
commit 75d800a4ea
5 changed files with 12 additions and 17 deletions

View File

@@ -30,12 +30,19 @@ MSG_LIGHTNING_SCB_WARNING = _(
MSG_LIGHTNING_WARNING = MSG_LIGHTNING_EXPERIMENTAL_WARNING + "\n\n" + 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. """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?""" 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 = _( 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).""" """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)."""

View File

@@ -326,10 +326,4 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener):
@pyqtSlot(result=str) @pyqtSlot(result=str)
def channelBackupHelpText(self): def channelBackupHelpText(self):
return ' '.join([ return messages.MSG_LN_EXPLAIN_SCB_BACKUPS
_("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."),
])

View File

@@ -163,7 +163,7 @@ class QEChannelOpener(QObject, AuthMixin):
lnworker = self._wallet.wallet.lnworker lnworker = self._wallet.wallet.lnworker
if lnworker.has_conflicting_backup_with(self._node_pubkey) and not confirm_backup_conflict: 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 return
amount = '!' if self._amount.isMax else self._amount.satsInt amount = '!' if self._amount.isMax else self._amount.satsInt

View File

@@ -170,13 +170,7 @@ class ChannelsList(MyTreeView):
self.lnworker.remove_channel_backup(channel_id) self.lnworker.remove_channel_backup(channel_id)
def export_channel_backup(self, channel_id): def export_channel_backup(self, channel_id):
msg = ' '.join([ msg = messages.MSG_LN_EXPLAIN_SCB_BACKUPS
_("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."),
])
data = self.lnworker.export_channel_backup(channel_id) data = self.lnworker.export_channel_backup(channel_id)
self.main_window.show_qrcode(data, 'channel backup', help_text=msg, self.main_window.show_qrcode(data, 'channel backup', help_text=msg,
show_copy_text_btn=True) show_copy_text_btn=True)

View File

@@ -1401,7 +1401,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
self.show_error(str(e)) self.show_error(str(e))
return return
if self.wallet.lnworker.has_conflicting_backup_with(node_id): 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): if not self.question(msg):
return return
# we need to know the fee before we broadcast, because the txid is required # we need to know the fee before we broadcast, because the txid is required