2023-07-17 10:49:06 +02:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Controls.Material
|
2022-11-23 17:09:53 +01:00
|
|
|
|
|
|
|
|
import org.electrum 1.0
|
|
|
|
|
|
|
|
|
|
import "controls"
|
|
|
|
|
|
|
|
|
|
ElDialog {
|
|
|
|
|
id: dialog
|
|
|
|
|
|
|
|
|
|
required property QtObject txcanceller
|
|
|
|
|
|
|
|
|
|
title: qsTr('Cancel Transaction')
|
|
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height
|
|
|
|
|
padding: 0
|
|
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
2023-03-20 19:52:01 +01:00
|
|
|
Flickable {
|
2023-02-09 01:13:05 +01:00
|
|
|
Layout.fillWidth: true
|
2023-03-20 19:52:01 +01:00
|
|
|
Layout.fillHeight: true
|
2023-02-09 01:13:05 +01:00
|
|
|
|
2023-03-20 19:52:01 +01:00
|
|
|
leftMargin: constants.paddingLarge
|
|
|
|
|
rightMargin: constants.paddingLarge
|
2022-11-23 17:09:53 +01:00
|
|
|
|
2023-03-20 19:52:01 +01:00
|
|
|
contentHeight: rootLayout.height
|
|
|
|
|
clip: true
|
|
|
|
|
interactive: height < contentHeight
|
2022-11-23 17:09:53 +01:00
|
|
|
|
2023-03-20 19:52:01 +01:00
|
|
|
GridLayout {
|
|
|
|
|
id: rootLayout
|
|
|
|
|
width: parent.width
|
|
|
|
|
columns: 2
|
2022-11-23 17:09:53 +01:00
|
|
|
|
2023-04-01 15:10:39 +02:00
|
|
|
InfoTextArea {
|
2023-03-20 19:52:01 +01:00
|
|
|
Layout.columnSpan: 2
|
|
|
|
|
Layout.fillWidth: true
|
2023-03-21 09:44:53 +01:00
|
|
|
Layout.bottomMargin: constants.paddingLarge
|
2023-04-01 15:10:39 +02:00
|
|
|
text: qsTr('Cancel an unconfirmed transaction by double-spending its inputs back to your wallet with a higher fee.')
|
2022-11-23 17:09:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
2023-03-20 19:52:01 +01:00
|
|
|
text: qsTr('Old fee')
|
2022-11-23 17:09:53 +01:00
|
|
|
color: Material.accentColor
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-20 19:52:01 +01:00
|
|
|
FormattedAmount {
|
|
|
|
|
amount: txcanceller.oldfee
|
|
|
|
|
}
|
2022-11-23 17:09:53 +01:00
|
|
|
|
2023-03-20 19:52:01 +01:00
|
|
|
Label {
|
|
|
|
|
text: qsTr('Old fee rate')
|
|
|
|
|
color: Material.accentColor
|
|
|
|
|
}
|
2022-11-23 17:09:53 +01:00
|
|
|
|
2023-03-20 19:52:01 +01:00
|
|
|
RowLayout {
|
|
|
|
|
Label {
|
|
|
|
|
id: oldfeeRate
|
|
|
|
|
text: txcanceller.oldfeeRate
|
|
|
|
|
font.family: FixedFont
|
|
|
|
|
}
|
2022-11-23 17:09:53 +01:00
|
|
|
|
2023-03-20 19:52:01 +01:00
|
|
|
Label {
|
2024-02-03 05:13:09 +00:00
|
|
|
text: UI_UNIT_NAME.FEERATE_SAT_PER_VB
|
2023-03-20 19:52:01 +01:00
|
|
|
color: Material.accentColor
|
|
|
|
|
}
|
2022-11-23 17:09:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
2024-01-23 12:50:36 +01:00
|
|
|
Layout.columnSpan: 2
|
|
|
|
|
Layout.topMargin: constants.paddingSmall
|
2023-04-05 15:08:01 +02:00
|
|
|
text: qsTr('New fee')
|
2022-11-23 17:09:53 +01:00
|
|
|
color: Material.accentColor
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-23 12:50:36 +01:00
|
|
|
TextHighlightPane {
|
2023-03-20 19:52:01 +01:00
|
|
|
Layout.columnSpan: 2
|
2024-01-23 12:50:36 +01:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
height: feepicker.height
|
|
|
|
|
|
|
|
|
|
FeePicker {
|
|
|
|
|
id: feepicker
|
|
|
|
|
width: parent.width
|
|
|
|
|
finalizer: dialog.txcanceller
|
2022-11-23 17:09:53 +01:00
|
|
|
|
2023-03-20 19:52:01 +01:00
|
|
|
}
|
|
|
|
|
}
|
2022-11-23 17:09:53 +01:00
|
|
|
|
2023-12-22 17:35:25 +01:00
|
|
|
InfoTextArea {
|
2022-11-23 17:09:53 +01:00
|
|
|
Layout.columnSpan: 2
|
2023-12-22 17:35:25 +01:00
|
|
|
Layout.preferredWidth: parent.width * 3/4
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
Layout.topMargin: constants.paddingLarge
|
|
|
|
|
iconStyle: InfoTextArea.IconStyle.Warn
|
2023-03-20 19:52:01 +01:00
|
|
|
visible: txcanceller.warning != ''
|
|
|
|
|
text: txcanceller.warning
|
|
|
|
|
}
|
2023-02-09 01:13:05 +01:00
|
|
|
|
2023-12-22 16:45:12 +01:00
|
|
|
ToggleLabel {
|
|
|
|
|
id: inputs_label
|
|
|
|
|
Layout.columnSpan: 2
|
|
|
|
|
Layout.topMargin: constants.paddingMedium
|
|
|
|
|
|
2023-03-20 19:52:01 +01:00
|
|
|
visible: txcanceller.valid
|
2023-12-22 16:45:12 +01:00
|
|
|
labelText: qsTr('Inputs (%1)').arg(txcanceller.inputs.length)
|
|
|
|
|
color: Material.accentColor
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
|
model: inputs_label.collapsed || !inputs_label.visible
|
|
|
|
|
? undefined
|
|
|
|
|
: txcanceller.inputs
|
|
|
|
|
delegate: TxInput {
|
|
|
|
|
Layout.columnSpan: 2
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
|
|
idx: index
|
|
|
|
|
model: modelData
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ToggleLabel {
|
|
|
|
|
id: outputs_label
|
2023-03-20 19:52:01 +01:00
|
|
|
Layout.columnSpan: 2
|
2023-12-22 16:45:12 +01:00
|
|
|
Layout.topMargin: constants.paddingMedium
|
|
|
|
|
|
|
|
|
|
visible: txcanceller.valid
|
|
|
|
|
labelText: qsTr('Outputs (%1)').arg(txcanceller.outputs.length)
|
2023-03-20 19:52:01 +01:00
|
|
|
color: Material.accentColor
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Repeater {
|
2023-12-22 16:45:12 +01:00
|
|
|
model: outputs_label.collapsed || !outputs_label.visible
|
|
|
|
|
? undefined
|
|
|
|
|
: txcanceller.outputs
|
|
|
|
|
delegate: TxOutput {
|
2023-03-20 19:52:01 +01:00
|
|
|
Layout.columnSpan: 2
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
2023-05-08 15:24:17 +02:00
|
|
|
allowShare: false
|
2023-12-22 16:45:12 +01:00
|
|
|
allowClickAddress: false
|
|
|
|
|
|
|
|
|
|
idx: index
|
2023-05-08 15:24:17 +02:00
|
|
|
model: modelData
|
2022-11-23 17:09:53 +01:00
|
|
|
}
|
|
|
|
|
}
|
2023-12-22 16:45:12 +01:00
|
|
|
|
2022-11-23 17:09:53 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FlatButton {
|
|
|
|
|
id: confirmButton
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
text: qsTr('Ok')
|
|
|
|
|
icon.source: '../../icons/confirmed.png'
|
|
|
|
|
enabled: txcanceller.valid
|
2023-04-11 12:13:41 +02:00
|
|
|
onClicked: doAccept()
|
2022-11-23 17:09:53 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-28 15:45:06 +01:00
|
|
|
Connections {
|
|
|
|
|
target: txcanceller
|
|
|
|
|
function onTxMined() {
|
2023-04-11 12:13:41 +02:00
|
|
|
dialog.doReject()
|
2022-11-28 15:45:06 +01:00
|
|
|
}
|
|
|
|
|
}
|
2022-11-23 17:09:53 +01:00
|
|
|
}
|