1
0

qml: port cancel normal swap feature from desktop client

This commit is contained in:
Sander van Grieken
2023-09-18 16:13:32 +02:00
parent cffbe44c07
commit bbfe5225b6
2 changed files with 100 additions and 19 deletions

View File

@@ -35,7 +35,7 @@ ElDialog {
text: swaphelper.userinfo
iconStyle: swaphelper.state == SwapHelper.Started
? InfoTextArea.IconStyle.Spinner
: swaphelper.state == SwapHelper.Failed
: swaphelper.state == SwapHelper.Failed || swaphelper.state == SwapHelper.Cancelled
? InfoTextArea.IconStyle.Error
: swaphelper.state == SwapHelper.Success
? InfoTextArea.IconStyle.Done
@@ -251,15 +251,31 @@ ElDialog {
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
FlatButton {
ButtonContainer {
Layout.columnSpan: 2
Layout.fillWidth: true
text: qsTr('Ok')
icon.source: Qt.resolvedUrl('../../icons/confirmed.png')
enabled: swaphelper.valid && (swaphelper.state == SwapHelper.ServiceReady || swaphelper.state == SwapHelper.Failed)
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Ok')
icon.source: Qt.resolvedUrl('../../icons/confirmed.png')
visible: !swaphelper.canCancel
enabled: swaphelper.valid && (swaphelper.state == SwapHelper.ServiceReady || swaphelper.state == SwapHelper.Failed)
onClicked: {
swaphelper.executeSwap()
onClicked: {
swaphelper.executeSwap()
}
}
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Cancel')
icon.source: Qt.resolvedUrl('../../icons/closebutton.png')
visible: swaphelper.canCancel
onClicked: {
swaphelper.cancelNormalSwap()
}
}
}
}