1
0

qml: qualify all signal handler parameters

This commit is contained in:
Sander van Grieken
2023-09-27 21:05:26 +02:00
parent ae446377f8
commit 65d41ccc49
6 changed files with 44 additions and 24 deletions

View File

@@ -310,7 +310,7 @@ Pane {
address: root.address
onFrozenChanged: addressDetailsChanged()
onLabelChanged: addressDetailsChanged()
onAuthRequired: {
onAuthRequired: (method, authMessage) => {
app.handleAuthRequired(addressdetails, method, authMessage)
}
}

View File

@@ -202,7 +202,7 @@ ElDialog {
wallet: Daemon.currentWallet
channelid: dialog.channelid
onAuthRequired: {
onAuthRequired: (method, authMessage) => {
app.handleAuthRequired(channeldetails, method, authMessage)
}
@@ -228,7 +228,7 @@ ElDialog {
dialog.close()
}
onChannelCloseFailed: {
onChannelCloseFailed: (message) => {
errorText.text = message
}
}

View File

@@ -212,16 +212,19 @@ ElDialog {
ChannelOpener {
id: channelopener
wallet: Daemon.currentWallet
onAuthRequired: {
onAuthRequired: (method, authMessage) => {
app.handleAuthRequired(channelopener, method, authMessage)
}
onValidationError: {
onValidationError: (code, message) => {
if (code == 'invalid_nodeid') {
var dialog = app.messageDialog.createObject(app, { title: qsTr('Error'), 'text': message })
var dialog = app.messageDialog.createObject(app, {
title: qsTr('Error'),
text: message
})
dialog.open()
}
}
onConflictingBackup: {
onConflictingBackup: (message) => {
var dialog = app.messageDialog.createObject(app, { 'text': message, 'yesno': true })
dialog.open()
dialog.accepted.connect(function() {
@@ -237,17 +240,17 @@ ElDialog {
})
dialog.open()
}
onChannelOpening: {
onChannelOpening: (peer) => {
console.log('Channel is opening')
app.channelOpenProgressDialog.reset()
app.channelOpenProgressDialog.peer = peer
app.channelOpenProgressDialog.open()
}
onChannelOpenError: {
onChannelOpenError: (message) => {
app.channelOpenProgressDialog.state = 'failed'
app.channelOpenProgressDialog.error = message
}
onChannelOpenSuccess: {
onChannelOpenSuccess: (cid, has_onchain_backup, min_depth, tx_complete) => {
var message = qsTr('Channel established.') + ' '
+ qsTr('This channel will be usable after %1 confirmations').arg(min_depth)
if (!tx_complete) {

View File

@@ -399,7 +399,7 @@ Pane {
id: txdetails
wallet: Daemon.currentWallet
onLabelChanged: root.detailsChanged()
onConfirmRemoveLocalTx: {
onConfirmRemoveLocalTx: (message) => {
var dialog = app.messageDialog.createObject(app, { text: message, yesno: true })
dialog.accepted.connect(function() {
txdetails.removeLocalTx(true)

View File

@@ -264,16 +264,20 @@ Item {
InvoiceParser {
id: invoiceParser
wallet: Daemon.currentWallet
onValidationError: {
var dialog = app.messageDialog.createObject(app, { text: message })
onValidationError: (code, message) => {
var dialog = app.messageDialog.createObject(app, {
text: message
})
dialog.closed.connect(function() {
restartSendDialog()
})
dialog.open()
}
onValidationWarning: {
onValidationWarning: (code, message) => {
if (code == 'no_channels') {
var dialog = app.messageDialog.createObject(app, { text: message })
var dialog = app.messageDialog.createObject(app, {
text: message
})
dialog.closed.connect(function() {
restartSendDialog()
})
@@ -284,18 +288,28 @@ Item {
}
onValidationSuccess: {
closeSendDialog()
var dialog = invoiceDialog.createObject(app, { invoice: invoiceParser, payImmediately: invoiceParser.isLnurlPay })
var dialog = invoiceDialog.createObject(app, {
invoice: invoiceParser,
payImmediately: invoiceParser.isLnurlPay
})
dialog.open()
}
onInvoiceCreateError: console.log(code + ' ' + message)
onInvoiceCreateError: (code, message) => {
console.log(code + ' ' + message)
}
onLnurlRetrieved: {
closeSendDialog()
var dialog = lnurlPayDialog.createObject(app, { invoiceParser: invoiceParser })
var dialog = lnurlPayDialog.createObject(app, {
invoiceParser: invoiceParser
})
dialog.open()
}
onLnurlError: {
var dialog = app.messageDialog.createObject(app, { title: qsTr('Error'), text: message })
onLnurlError: (code, message) => {
var dialog = app.messageDialog.createObject(app, {
title: qsTr('Error'),
text: message }
)
dialog.open()
}
}
@@ -477,7 +491,7 @@ Item {
finalizer: TxFinalizer {
wallet: Daemon.currentWallet
canRbf: true
onFinished: {
onFinished: (signed, saved, complete) => {
if (!complete) {
var msg
if (wallet.isWatchOnly) {

View File

@@ -405,11 +405,14 @@ ApplicationWindow
swaphelper: SwapHelper {
id: _swaphelper
wallet: Daemon.currentWallet
onAuthRequired: {
onAuthRequired: (method, authMessage) => {
app.handleAuthRequired(_swaphelper, method, authMessage)
}
onError: {
var dialog = app.messageDialog.createObject(app, { title: qsTr('Error'), text: message })
onError: (message) => {
var dialog = app.messageDialog.createObject(app, {
title: qsTr('Error'),
text: message
})
dialog.open()
}
}