|
|
|
@ -43,7 +43,9 @@ Item { |
|
|
|
|
|
|
|
|
|
|
|
// Android based send dialog if on android |
|
|
|
// Android based send dialog if on android |
|
|
|
var scanner = app.scanDialog.createObject(mainView, { |
|
|
|
var scanner = app.scanDialog.createObject(mainView, { |
|
|
|
hint: qsTr('Scan an Invoice, an Address, an LNURL-pay, a PSBT or a Channel backup'), |
|
|
|
hint: Daemon.currentWallet.isLightning |
|
|
|
|
|
|
|
? qsTr('Scan an Invoice, an Address, an LNURL-pay, a PSBT or a Channel Backup') |
|
|
|
|
|
|
|
: qsTr('Scan an Invoice, an Address, an LNURL-pay or a PSBT') |
|
|
|
}) |
|
|
|
}) |
|
|
|
scanner.onFound.connect(function() { |
|
|
|
scanner.onFound.connect(function() { |
|
|
|
var data = scanner.scanData |
|
|
|
var data = scanner.scanData |
|
|
|
@ -52,7 +54,7 @@ Item { |
|
|
|
app.stack.push(Qt.resolvedUrl('TxDetails.qml'), { rawtx: data }) |
|
|
|
app.stack.push(Qt.resolvedUrl('TxDetails.qml'), { rawtx: data }) |
|
|
|
} else if (Daemon.currentWallet.isValidChannelBackup(data)) { |
|
|
|
} else if (Daemon.currentWallet.isValidChannelBackup(data)) { |
|
|
|
var dialog = app.messageDialog.createObject(app, { |
|
|
|
var dialog = app.messageDialog.createObject(app, { |
|
|
|
title: qsTr('Import Channel backup?'), |
|
|
|
title: qsTr('Import Channel Backup?'), |
|
|
|
yesno: true |
|
|
|
yesno: true |
|
|
|
}) |
|
|
|
}) |
|
|
|
dialog.accepted.connect(function() { |
|
|
|
dialog.accepted.connect(function() { |
|
|
|
@ -508,13 +510,21 @@ Item { |
|
|
|
width: parent.width |
|
|
|
width: parent.width |
|
|
|
height: parent.height |
|
|
|
height: parent.height |
|
|
|
|
|
|
|
|
|
|
|
onTxFound: { |
|
|
|
onTxFound: (data) => { |
|
|
|
app.stack.push(Qt.resolvedUrl('TxDetails.qml'), { rawtx: data }) |
|
|
|
app.stack.push(Qt.resolvedUrl('TxDetails.qml'), { rawtx: data }) |
|
|
|
close() |
|
|
|
close() |
|
|
|
} |
|
|
|
} |
|
|
|
onChannelBackupFound: { |
|
|
|
onChannelBackupFound: (data) => { |
|
|
|
|
|
|
|
if (!Daemon.currentWallet.isLightning) { |
|
|
|
|
|
|
|
var dialog = app.messageDialog.createObject(app, { |
|
|
|
|
|
|
|
title: qsTr('Cannot import Channel Backup, Lightning not enabled.') |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
dialog.open() |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var dialog = app.messageDialog.createObject(app, { |
|
|
|
var dialog = app.messageDialog.createObject(app, { |
|
|
|
title: qsTr('Import Channel backup?'), |
|
|
|
title: qsTr('Import Channel Backup?'), |
|
|
|
yesno: true |
|
|
|
yesno: true |
|
|
|
}) |
|
|
|
}) |
|
|
|
dialog.accepted.connect(function() { |
|
|
|
dialog.accepted.connect(function() { |
|
|
|
|