Browse Source

gui messages: mv one more message to messages.py

patch-4
SomberNight 4 years ago
parent
commit
4e0a20ae46
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/gui/kivy/uix/dialogs/lightning_channels.py
  2. 5
      electrum/gui/messages.py
  3. 8
      electrum/gui/qt/channels_list.py

6
electrum/gui/kivy/uix/dialogs/lightning_channels.py

@ -472,11 +472,7 @@ class ChannelDetailsPopup(Popup, Logger):
closed = chan.get_closing_height()
if closed:
self.closing_txid, closing_height, closing_timestamp = closed
msg = ' '.join([
_("Trampoline routing is enabled, but this channel is with a non-trampoline node."),
_("This channel may still be used for receiving, but it is frozen for sending."),
_("If you want to keep using this channel, you need to disable trampoline routing in your preferences."),
])
msg = messages.MSG_NON_TRAMPOLINE_CHANNEL_FROZEN_WITHOUT_GOSSIP
self.warning = '' if self.app.wallet.lnworker.channel_db or self.app.wallet.lnworker.is_trampoline_peer(chan.node_id) else _('Warning') + ': ' + msg
self.update_action_dropdown()

5
electrum/gui/messages.py

@ -1,4 +1,5 @@
# note: qt and kivy use different i18n methods
# FIXME all these messages *cannot* be localized currently!
def to_rtf(msg):
return '\n'.join(['<p>' + x + '</p>' for x in msg.split('\n\n')])
@ -48,3 +49,7 @@ Are you sure?
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).
"""
MSG_NON_TRAMPOLINE_CHANNEL_FROZEN_WITHOUT_GOSSIP = """Trampoline routing is enabled, but this channel is with a non-trampoline node.
This channel may still be used for receiving, but it is frozen for sending.
If you want to keep using this channel, you need to disable trampoline routing in your preferences."""

8
electrum/gui/qt/channels_list.py

@ -193,11 +193,7 @@ class ChannelsList(MyTreeView):
if self.lnworker.channel_db or self.lnworker.is_trampoline_peer(chan.node_id):
chan.set_frozen_for_sending(b)
else:
msg = ' '.join([
_("Trampoline routing is enabled, but this channel is with a non-trampoline node."),
_("This channel may still be used for receiving, but it is frozen for sending."),
_("If you want to keep using this channel, you need to disable trampoline routing in your preferences."),
])
msg = messages.MSG_NON_TRAMPOLINE_CHANNEL_FROZEN_WITHOUT_GOSSIP
self.main_window.show_warning(msg, title=_('Channel is frozen for sending'))
def create_menu(self, position):
@ -237,7 +233,7 @@ class ChannelsList(MyTreeView):
channel_id.hex(), title=_("Long Channel ID")))
if not chan.is_closed():
if not chan.is_frozen_for_sending():
menu.addAction(_("Freeze (for sending)"), lambda: self.freeze_channel_for_sending(chan, True))
menu.addAction(_("Freeze (for sending)"), lambda: self.freeze_channel_for_sending(chan, True)) #
else:
menu.addAction(_("Unfreeze (for sending)"), lambda: self.freeze_channel_for_sending(chan, False))
if not chan.is_frozen_for_receiving():

Loading…
Cancel
Save