1
0

qml: add explanatory infomessage when sending capacity is significantly less than local balance.

Show message when attempting unfreeze of gossip channel in trampoline mode
This commit is contained in:
Sander van Grieken
2023-05-31 11:11:54 +02:00
committed by accumulator
parent 45944d280d
commit 0428fc7c0a
2 changed files with 27 additions and 4 deletions

View File

@@ -135,9 +135,10 @@ Pane {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
onClicked: {
var dialog = app.genericShareDialog.createObject(root,
{ title: qsTr('Channel node ID'), text: channeldetails.pubkey }
)
var dialog = app.genericShareDialog.createObject(root, {
title: qsTr('Channel node ID'),
text: channeldetails.pubkey
})
dialog.open()
}
}
@@ -159,6 +160,18 @@ Pane {
columns: 2
rowSpacing: constants.paddingSmall
InfoTextArea {
Layout.columnSpan: 2
Layout.fillWidth: true
Layout.bottomMargin: constants.paddingMedium
visible: channeldetails.canSend.msatsInt < 0.5 * channeldetails.localCapacity.msatsInt
&& channeldetails.localCapacity.msatsInt > 0.2 * channeldetails.capacity.msatsInt
iconStyle: InfoTextArea.IconStyle.Warn
compact: true
text: [qsTr('The amount available for sending is considerably lower than the local balance.'),
qsTr('This can occur when mempool fees are high.')].join(' ')
}
ChannelBar {
Layout.columnSpan: 2
Layout.fillWidth: true
@@ -222,7 +235,7 @@ Pane {
}
Label {
text: qsTr('Can Receive')
text: qsTr('Can receive')
color: Material.accentColor
}
@@ -324,6 +337,14 @@ Pane {
id: channeldetails
wallet: Daemon.currentWallet
channelid: root.channelid
onTrampolineFrozenInGossipMode: {
var dialog = app.messageDialog.createObject(root, {
title: qsTr('Cannot unfreeze channel'),
text: [qsTr('Non-Trampoline channels cannot be used for sending while in trampoline mode.'),
qsTr('Disable trampoline mode to enable sending from this channel.')].join(' ')
})
dialog.open()
}
}
Component {

View File

@@ -27,6 +27,7 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener):
channelCloseSuccess = pyqtSignal()
channelCloseFailed = pyqtSignal([str], arguments=['message'])
isClosingChanged = pyqtSignal()
trampolineFrozenInGossipMode = pyqtSignal()
def __init__(self, parent=None):
super().__init__(parent)
@@ -214,6 +215,7 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener):
self.channelChanged.emit()
else:
self._logger.debug(messages.MSG_NON_TRAMPOLINE_CHANNEL_FROZEN_WITHOUT_GOSSIP)
self.trampolineFrozenInGossipMode.emit()
@pyqtSlot()
def freezeForReceiving(self):