Browse Source

qml: ui close channel dialog

master
Sander van Grieken 3 years ago
parent
commit
cf005a0f2a
  1. 145
      electrum/gui/qml/components/CloseChannelDialog.qml

145
electrum/gui/qml/components/CloseChannelDialog.qml

@ -26,68 +26,104 @@ ElDialog {
closePolicy: Popup.NoAutoClose closePolicy: Popup.NoAutoClose
GridLayout { padding: 0
id: layout
ColumnLayout {
width: parent.width width: parent.width
height: parent.height height: parent.height
columns: 2 spacing: 0
Label { GridLayout {
text: qsTr('Channel name') id: layout
color: Material.accentColor Layout.preferredWidth: parent.width
} Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge
columns: 2
Label { Label {
text: channeldetails.name Layout.fillWidth: true
} text: qsTr('Channel name')
color: Material.accentColor
}
Label { Label {
text: qsTr('Short channel ID') Layout.fillWidth: true
color: Material.accentColor text: channeldetails.name
} }
Label { Label {
text: channeldetails.short_cid text: qsTr('Short channel ID')
} color: Material.accentColor
}
InfoTextArea { Label {
Layout.columnSpan: 2 text: channeldetails.short_cid
text: qsTr(channeldetails.message_force_close) }
}
ColumnLayout { Item { Layout.preferredHeight: constants.paddingMedium; Layout.preferredWidth: 1; Layout.columnSpan: 2 }
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter
ButtonGroup { InfoTextArea {
id: closetypegroup Layout.columnSpan: 2
Layout.preferredWidth: parent.width * 3/4
Layout.alignment: Qt.AlignHCenter
text: qsTr(channeldetails.message_force_close)
} }
RadioButton { ColumnLayout {
ButtonGroup.group: closetypegroup Layout.columnSpan: 2
property string closetype: 'cooperative' Layout.alignment: Qt.AlignHCenter
checked: true
enabled: !closing && channeldetails.canCoopClose ButtonGroup {
text: qsTr('Cooperative close') id: closetypegroup
} }
RadioButton {
ButtonGroup.group: closetypegroup RadioButton {
property string closetype: 'remote_force' ButtonGroup.group: closetypegroup
enabled: !closing && channeldetails.canForceClose property string closetype: 'cooperative'
text: qsTr('Request Force-close') checked: true
enabled: !closing && channeldetails.canCoopClose
text: qsTr('Cooperative close')
}
RadioButton {
ButtonGroup.group: closetypegroup
property string closetype: 'remote_force'
enabled: !closing && channeldetails.canForceClose
text: qsTr('Request Force-close')
}
RadioButton {
ButtonGroup.group: closetypegroup
property string closetype: 'local_force'
enabled: !closing && channeldetails.canForceClose
text: qsTr('Local Force-close')
}
} }
RadioButton {
ButtonGroup.group: closetypegroup ColumnLayout {
property string closetype: 'local_force' Layout.columnSpan: 2
enabled: !closing && channeldetails.canForceClose Layout.alignment: Qt.AlignHCenter
text: qsTr('Local Force-close') Label {
id: errorText
visible: !closing && errorText
wrapMode: Text.Wrap
Layout.preferredWidth: layout.width
}
Label {
text: qsTr('Closing...')
visible: closing
}
BusyIndicator {
visible: closing
}
} }
} }
Button { Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
FlatButton {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true
text: qsTr('Close') text: qsTr('Close')
icon.source: '../../icons/closebutton.png'
enabled: !closing enabled: !closing
onClicked: { onClicked: {
closing = true closing = true
@ -96,25 +132,6 @@ ElDialog {
} }
ColumnLayout {
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter
Label {
id: errorText
visible: !closing && errorText
wrapMode: Text.Wrap
Layout.preferredWidth: layout.width
}
Label {
text: qsTr('Closing...')
visible: closing
}
BusyIndicator {
visible: closing
}
}
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
} }
ChannelDetails { ChannelDetails {

Loading…
Cancel
Save