Browse Source

qml: refactor txaccepted/txcancelled signals to standard accepted/rejected.

master
Sander van Grieken 3 years ago
parent
commit
9bbc354e0e
  1. 10
      electrum/gui/qml/components/ConfirmTxDialog.qml
  2. 9
      electrum/gui/qml/components/CpfpBumpFeeDialog.qml
  3. 2
      electrum/gui/qml/components/OpenChannelDialog.qml
  4. 9
      electrum/gui/qml/components/RbfBumpFeeDialog.qml
  5. 9
      electrum/gui/qml/components/RbfCancelDialog.qml
  6. 6
      electrum/gui/qml/components/TxDetails.qml
  7. 2
      electrum/gui/qml/components/WalletMainView.qml

10
electrum/gui/qml/components/ConfirmTxDialog.qml

@ -17,9 +17,6 @@ ElDialog {
property alias amountLabelText: amountLabel.text
property alias sendButtonText: sendButton.text
signal txcancelled
signal txaccepted
title: qsTr('Confirm Transaction')
// copy these to finalizer
@ -223,12 +220,9 @@ ElDialog {
: qsTr('Pay')
icon.source: '../../icons/confirmed.png'
enabled: finalizer.valid
onClicked: {
txaccepted()
dialog.close()
}
onClicked: doAccept()
}
}
onClosed: txcancelled()
onClosed: doReject()
}

9
electrum/gui/qml/components/CpfpBumpFeeDialog.qml

@ -13,8 +13,6 @@ ElDialog {
required property string txid
required property QtObject cpfpfeebumper
signal txaccepted
title: qsTr('Bump Fee')
iconSource: Qt.resolvedUrl('../../icons/rocket.png')
@ -224,17 +222,14 @@ ElDialog {
text: qsTr('Ok')
icon.source: '../../icons/confirmed.png'
enabled: cpfpfeebumper.valid
onClicked: {
txaccepted()
dialog.close()
}
onClicked: doAccept()
}
}
Connections {
target: cpfpfeebumper
function onTxMined() {
dialog.close()
dialog.doReject()
}
}
}

2
electrum/gui/qml/components/OpenChannelDialog.qml

@ -202,7 +202,7 @@ ElDialog {
var dialog = confirmOpenChannelDialog.createObject(app, {
'satoshis': channelopener.amount
})
dialog.txaccepted.connect(function() {
dialog.accepted.connect(function() {
dialog.finalizer.signAndSend()
})
dialog.open()

9
electrum/gui/qml/components/RbfBumpFeeDialog.qml

@ -13,8 +13,6 @@ ElDialog {
required property string txid
required property QtObject rbffeebumper
signal txaccepted
title: qsTr('Bump Fee')
iconSource: Qt.resolvedUrl('../../icons/rocket.png')
@ -237,17 +235,14 @@ ElDialog {
text: qsTr('Ok')
icon.source: '../../icons/confirmed.png'
enabled: rbffeebumper.valid
onClicked: {
txaccepted()
dialog.close()
}
onClicked: doAccept()
}
}
Connections {
target: rbffeebumper
function onTxMined() {
dialog.close()
dialog.doReject()
}
}
}

9
electrum/gui/qml/components/RbfCancelDialog.qml

@ -13,8 +13,6 @@ ElDialog {
required property string txid
required property QtObject txcanceller
signal txaccepted
title: qsTr('Cancel Transaction')
width: parent.width
@ -207,17 +205,14 @@ ElDialog {
text: qsTr('Ok')
icon.source: '../../icons/confirmed.png'
enabled: txcanceller.valid
onClicked: {
txaccepted()
dialog.close()
}
onClicked: doAccept()
}
}
Connections {
target: txcanceller
function onTxMined() {
dialog.close()
dialog.doReject()
}
}
}

6
electrum/gui/qml/components/TxDetails.qml

@ -440,7 +440,7 @@ Pane {
wallet: Daemon.currentWallet
txid: dialog.txid
}
onTxaccepted: {
onAccepted: {
root.rawtx = rbffeebumper.getNewTx()
if (txdetails.wallet.canSignWithoutCosigner) {
txdetails.sign_and_broadcast()
@ -465,7 +465,7 @@ Pane {
txid: dialog.txid
}
onTxaccepted: {
onAccepted: {
// replaces parent tx with cpfp tx
root.rawtx = cpfpfeebumper.getNewTx()
if (txdetails.wallet.canSignWithoutCosigner) {
@ -491,7 +491,7 @@ Pane {
txid: dialog.txid
}
onTxaccepted: {
onAccepted: {
root.rawtx = txcanceller.getNewTx()
if (txdetails.wallet.canSignWithoutCosigner) {
txdetails.sign_and_broadcast()

2
electrum/gui/qml/components/WalletMainView.qml

@ -328,7 +328,7 @@ Item {
message: invoice.message
})
var canComplete = !Daemon.currentWallet.isWatchOnly && Daemon.currentWallet.canSignWithoutCosigner
dialog.txaccepted.connect(function() {
dialog.accepted.connect(function() {
if (!canComplete) {
if (Daemon.currentWallet.isWatchOnly) {
dialog.finalizer.save()

Loading…
Cancel
Save