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:
committed by
accumulator
parent
45944d280d
commit
0428fc7c0a
@@ -135,9 +135,10 @@ Pane {
|
|||||||
icon.source: '../../icons/share.png'
|
icon.source: '../../icons/share.png'
|
||||||
icon.color: 'transparent'
|
icon.color: 'transparent'
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var dialog = app.genericShareDialog.createObject(root,
|
var dialog = app.genericShareDialog.createObject(root, {
|
||||||
{ title: qsTr('Channel node ID'), text: channeldetails.pubkey }
|
title: qsTr('Channel node ID'),
|
||||||
)
|
text: channeldetails.pubkey
|
||||||
|
})
|
||||||
dialog.open()
|
dialog.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,6 +160,18 @@ Pane {
|
|||||||
columns: 2
|
columns: 2
|
||||||
rowSpacing: constants.paddingSmall
|
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 {
|
ChannelBar {
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -222,7 +235,7 @@ Pane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr('Can Receive')
|
text: qsTr('Can receive')
|
||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,6 +337,14 @@ Pane {
|
|||||||
id: channeldetails
|
id: channeldetails
|
||||||
wallet: Daemon.currentWallet
|
wallet: Daemon.currentWallet
|
||||||
channelid: root.channelid
|
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 {
|
Component {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener):
|
|||||||
channelCloseSuccess = pyqtSignal()
|
channelCloseSuccess = pyqtSignal()
|
||||||
channelCloseFailed = pyqtSignal([str], arguments=['message'])
|
channelCloseFailed = pyqtSignal([str], arguments=['message'])
|
||||||
isClosingChanged = pyqtSignal()
|
isClosingChanged = pyqtSignal()
|
||||||
|
trampolineFrozenInGossipMode = pyqtSignal()
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
@@ -214,6 +215,7 @@ class QEChannelDetails(AuthMixin, QObject, QtEventListener):
|
|||||||
self.channelChanged.emit()
|
self.channelChanged.emit()
|
||||||
else:
|
else:
|
||||||
self._logger.debug(messages.MSG_NON_TRAMPOLINE_CHANNEL_FROZEN_WITHOUT_GOSSIP)
|
self._logger.debug(messages.MSG_NON_TRAMPOLINE_CHANNEL_FROZEN_WITHOUT_GOSSIP)
|
||||||
|
self.trampolineFrozenInGossipMode.emit()
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def freezeForReceiving(self):
|
def freezeForReceiving(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user