qml: only show channel ratio bar when appropriate
This commit is contained in:
@@ -61,6 +61,7 @@ Pane {
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: channeldetails.short_cid
|
||||
}
|
||||
|
||||
@@ -77,11 +78,13 @@ Pane {
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: !channeldetails.isBackup
|
||||
text: qsTr('Initiator')
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: !channeldetails.isBackup
|
||||
text: channeldetails.initiator
|
||||
}
|
||||
|
||||
@@ -146,6 +149,9 @@ Pane {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: constants.paddingLarge
|
||||
Layout.bottomMargin: constants.paddingXLarge
|
||||
visible: channeldetails.stateCode != ChannelDetails.Redeemed
|
||||
&& channeldetails.stateCode != ChannelDetails.Closed
|
||||
&& !channeldetails.isBackup
|
||||
capacity: channeldetails.capacity
|
||||
localCapacity: channeldetails.localCapacity
|
||||
remoteCapacity: channeldetails.remoteCapacity
|
||||
|
||||
@@ -107,7 +107,7 @@ ItemDelegate {
|
||||
|
||||
ChannelBar {
|
||||
Layout.fillWidth: true
|
||||
visible: !_closed
|
||||
visible: !_closed && !model.is_backup
|
||||
capacity: model.capacity
|
||||
localCapacity: model.local_capacity
|
||||
remoteCapacity: model.remote_capacity
|
||||
|
||||
@@ -99,6 +99,10 @@ class QEChannelDetails(QObject, QtEventListener):
|
||||
def state(self):
|
||||
return self._channel.get_state_for_GUI()
|
||||
|
||||
@pyqtProperty(int, notify=channelChanged)
|
||||
def stateCode(self):
|
||||
return self._channel.get_state()
|
||||
|
||||
@pyqtProperty(str, notify=channelChanged)
|
||||
def initiator(self):
|
||||
if self._channel.is_backup():
|
||||
|
||||
Reference in New Issue
Block a user