From ebb714fa1b6ee865f37057258061fbb8a743d64b Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 25 Nov 2022 18:43:39 +0100 Subject: [PATCH] qml: feebump button in TxDetails next to tx fee, remove RbF flag --- electrum/gui/qml/components/TxDetails.qml | 52 +++++++++-------------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/electrum/gui/qml/components/TxDetails.qml b/electrum/gui/qml/components/TxDetails.qml index 159f937ae..7bc97167c 100644 --- a/electrum/gui/qml/components/TxDetails.qml +++ b/electrum/gui/qml/components/TxDetails.qml @@ -141,9 +141,24 @@ Pane { font.family: FixedFont } Label { + Layout.fillWidth: true text: Config.baseUnit color: Material.accentColor } + FlatButton { + icon.source: '../../icons/warning.png' + icon.color: 'transparent' + text: qsTr('Bump fee') + visible: txdetails.canBump || txdetails.canCpfp + onClicked: { + if (txdetails.canBump) { + var dialog = rbfBumpFeeDialog.createObject(root, { txid: root.txid }) + } else { + var dialog = cpfpBumpFeeDialog.createObject(root, { txid: root.txid }) + } + dialog.open() + } + } } Label { @@ -200,15 +215,6 @@ Pane { text: txdetails.txpos } - Label { - text: qsTr('RbF') - color: Material.accentColor - } - - Label { - text: txdetails.isFinal ? qsTr('No') : qsTr('Yes') - } - Label { text: qsTr('Label') Layout.columnSpan: 2 @@ -345,7 +351,7 @@ Pane { } RowLayout { - visible: !txdetails.isMined && !txdetails.isUnrelated + visible: txdetails.canSign || txdetails.canBroadcast FlatButton { Layout.fillWidth: true Layout.preferredWidth: 1 @@ -390,26 +396,6 @@ Pane { } } - FlatButton { - Layout.fillWidth: true - text: qsTr('Bump fee') - visible: txdetails.canBump - onClicked: { - var dialog = rbfBumpFeeDialog.createObject(root, { txid: root.txid }) - dialog.open() - } - } - - FlatButton { - Layout.fillWidth: true - text: qsTr('Bump fee (CPFP)') - visible: txdetails.canCpfp - onClicked: { - var dialog = cpfpBumpFeeDialog.createObject(root, { txid: root.txid }) - dialog.open() - } - } - FlatButton { Layout.fillWidth: true text: qsTr('Cancel Tx') @@ -466,6 +452,7 @@ Pane { onTxaccepted: { root.rawtx = rbffeebumper.getNewTx() + // TODO: sign & send when possible? } onClosed: destroy() } @@ -482,7 +469,9 @@ Pane { } onTxaccepted: { - root.rawtx = cpfpfeebumper.getNewTx() // TODO: don't replace tx, but push new window + // replaces parent tx with cpfp tx + root.rawtx = cpfpfeebumper.getNewTx() + // TODO: sign & send when possible? } onClosed: destroy() } @@ -500,6 +489,7 @@ Pane { onTxaccepted: { root.rawtx = txcanceller.getNewTx() + // TODO: sign & send when possible? } onClosed: destroy() }