2022-12-05 18:34:53 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the Flowee project
|
2025-02-04 21:20:35 +01:00
|
|
|
* Copyright (C) 2022-2025 Tom Zander <tom@flowee.org>
|
2022-12-05 18:34:53 +01:00
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
2025-06-18 17:48:29 +02:00
|
|
|
import QtQuick.Controls.Basic as QQC2
|
2022-12-05 18:34:53 +01:00
|
|
|
import "../Flowee" as Flowee
|
2026-03-14 21:14:42 +01:00
|
|
|
import Flowee.org.pay
|
2022-12-05 18:34:53 +01:00
|
|
|
|
|
|
|
|
Page {
|
2022-12-05 21:24:32 +01:00
|
|
|
id: root
|
|
|
|
|
headerText: qsTr("Approve Payment")
|
2022-12-05 18:34:53 +01:00
|
|
|
|
2023-02-08 14:30:14 +01:00
|
|
|
property QtObject sendAllAction: QQC2.Action {
|
|
|
|
|
checkable: true
|
|
|
|
|
checked: payment.details[0].maxSelected
|
2025-07-08 20:34:08 +02:00
|
|
|
text: qsTr("Select All", "all money in wallet")
|
2023-02-08 14:30:14 +01:00
|
|
|
onTriggered: {
|
|
|
|
|
payment.details[0].maxSelected = checked
|
|
|
|
|
if (payment.isValid)
|
2026-03-14 21:14:42 +01:00
|
|
|
payment.prepare() // auto-prepare doesn't act on changes done on the details.
|
2023-02-08 14:30:14 +01:00
|
|
|
}
|
|
|
|
|
}
|
2023-05-31 15:20:11 +02:00
|
|
|
property QtObject showTargetAddress: QQC2.Action {
|
|
|
|
|
checkable: true
|
2023-12-22 18:52:05 +01:00
|
|
|
checked: true
|
2023-05-31 15:20:11 +02:00
|
|
|
text: qsTr("Show Address", "to show a bitcoincash address")
|
|
|
|
|
}
|
2025-07-08 20:34:08 +02:00
|
|
|
property QtObject makeRepeating: QQC2.Action {
|
|
|
|
|
text: qsTr("Schedule Payment")
|
|
|
|
|
enabled: payment.isValid
|
|
|
|
|
onTriggered: {
|
2026-03-14 21:14:42 +01:00
|
|
|
var repeatingCopy = payment.copyToRepeating(root)
|
2025-07-09 16:35:54 +02:00
|
|
|
repeatingCopy.payment.userComment = qsTr("Scheduled Payment") // try to reuse string from RepeatPaymentDetails.qml
|
2025-07-08 20:34:08 +02:00
|
|
|
thePile.push("RepeatPaymentDetails.qml", { "savedPayment": repeatingCopy,
|
|
|
|
|
"withScheduleButton": true,
|
2025-07-08 20:54:56 +02:00
|
|
|
"acceptHandler": function handler() {
|
2026-03-14 21:14:42 +01:00
|
|
|
var mainView = thePile.get(0)
|
|
|
|
|
mainView.currentIndex = 0 // go to the 'Home' tab.
|
|
|
|
|
thePile.pop()
|
|
|
|
|
thePile.pop() // remove current page too
|
2025-07-08 20:54:56 +02:00
|
|
|
}
|
2026-03-14 21:14:42 +01:00
|
|
|
})
|
2025-07-08 20:34:08 +02:00
|
|
|
}
|
|
|
|
|
}
|
2023-05-31 15:20:11 +02:00
|
|
|
property QtObject editPrice: QQC2.Action {
|
|
|
|
|
text: qsTr("Edit Amount", "Edit amount of money to send")
|
|
|
|
|
onTriggered: {
|
2026-03-14 21:14:42 +01:00
|
|
|
root.closeHeaderMenu()
|
2023-05-31 15:20:11 +02:00
|
|
|
// this action can only ever be used to start editing.
|
2026-03-14 21:14:42 +01:00
|
|
|
root.allowEditAmount = true
|
2023-05-31 15:20:11 +02:00
|
|
|
priceInput.fiatFollowsSats = false
|
2023-10-18 11:43:23 +02:00
|
|
|
priceInput.takeFocus()
|
2023-05-31 15:20:11 +02:00
|
|
|
}
|
2023-08-30 12:50:40 +02:00
|
|
|
checked: root.allowEditAmount
|
2023-05-31 15:20:11 +02:00
|
|
|
}
|
2023-03-13 17:52:26 +01:00
|
|
|
menuItems: {
|
|
|
|
|
// only have menu items as long as we are effectively
|
|
|
|
|
// showing this page and not some overlay.
|
2026-03-14 21:14:42 +01:00
|
|
|
var items = []
|
2024-12-22 14:41:46 +01:00
|
|
|
if (payment.broadcastStatus === Payment.NotStarted) {
|
2023-05-31 15:20:11 +02:00
|
|
|
// a QR _with_ a bch-amount will turn off editing of amount-to-send
|
|
|
|
|
if (allowEditAmount)
|
2026-03-14 21:14:42 +01:00
|
|
|
items.push(sendAllAction)
|
2023-05-31 15:20:11 +02:00
|
|
|
else
|
2026-03-14 21:14:42 +01:00
|
|
|
items.push(editPrice)
|
|
|
|
|
items.push(showTargetAddress)
|
|
|
|
|
items.push(makeRepeating)
|
2023-05-31 15:20:11 +02:00
|
|
|
}
|
2026-03-14 21:14:42 +01:00
|
|
|
return items
|
2023-03-13 17:52:26 +01:00
|
|
|
}
|
2023-05-31 15:20:11 +02:00
|
|
|
// if true, show widgets to edit the amount-to-send
|
|
|
|
|
property bool allowEditAmount: true
|
2023-02-06 21:55:54 +01:00
|
|
|
|
2024-12-22 14:41:46 +01:00
|
|
|
function start(paymentAddress) {
|
2026-03-14 21:14:42 +01:00
|
|
|
let success = payment.pasteTargetAddress(paymentAddress)
|
2024-12-22 14:41:46 +01:00
|
|
|
if (!success) {
|
2025-03-03 16:18:15 +01:00
|
|
|
scannedUrlFaultyDialog.scanResult = paymentAddress
|
2026-03-14 21:14:42 +01:00
|
|
|
scannedUrlFaultyDialog.open()
|
2024-12-22 14:41:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// should the price be included in the QR code, don't show editing widgets.
|
2026-03-14 21:14:42 +01:00
|
|
|
root.allowEditAmount = payment.paymentAmount <= 0
|
2025-05-20 20:44:58 +02:00
|
|
|
if (root.allowEditAmount) {
|
2026-03-14 21:14:42 +01:00
|
|
|
priceInput.takeFocus()
|
|
|
|
|
payment.instaPay = false
|
2025-05-20 20:44:58 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2026-03-14 21:14:42 +01:00
|
|
|
root.takeFocus()
|
2025-05-20 20:44:58 +02:00
|
|
|
}
|
2024-12-22 14:41:46 +01:00
|
|
|
}
|
|
|
|
|
|
2022-12-05 21:24:32 +01:00
|
|
|
Item { // data
|
2022-12-05 18:34:53 +01:00
|
|
|
Payment {
|
|
|
|
|
id: payment
|
2022-12-07 14:22:11 +01:00
|
|
|
account: portfolio.current
|
2022-12-07 18:30:02 +01:00
|
|
|
fiatPrice: Fiat.price
|
2023-02-08 14:30:14 +01:00
|
|
|
autoPrepare: true
|
2023-05-16 15:32:33 +02:00
|
|
|
instaPay: true
|
2025-02-17 16:23:24 +01:00
|
|
|
onApprovedByUser: {
|
2026-03-14 21:14:42 +01:00
|
|
|
root.fullScreen = true
|
|
|
|
|
broadcastPage.start()
|
2025-02-17 16:23:24 +01:00
|
|
|
}
|
2023-02-06 21:55:54 +01:00
|
|
|
}
|
2023-06-05 18:12:29 +02:00
|
|
|
Flowee.Dialog {
|
|
|
|
|
id: scannedUrlFaultyDialog
|
|
|
|
|
title: qsTr("Invalid QR code")
|
2024-12-22 14:41:46 +01:00
|
|
|
property string scanResult: ""
|
2023-06-05 18:12:29 +02:00
|
|
|
standardButtons: QQC2.DialogButtonBox.Close
|
2026-03-14 21:14:42 +01:00
|
|
|
onRejected: thePile.pop()
|
2023-06-05 18:12:29 +02:00
|
|
|
contentComponent: dialogForFaultyUrl
|
|
|
|
|
}
|
|
|
|
|
Component {
|
|
|
|
|
id: dialogForFaultyUrl
|
|
|
|
|
Column {
|
|
|
|
|
width: parent.width
|
|
|
|
|
spacing: 10
|
|
|
|
|
Flowee.Label {
|
|
|
|
|
id: mainText
|
|
|
|
|
width: parent.width
|
|
|
|
|
text: qsTr("I don't understand the scanned code. I'm sorry, I can't start a payment.")
|
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
|
}
|
|
|
|
|
Flowee.Label {
|
|
|
|
|
text: qsTr("details")
|
|
|
|
|
font.italic: true
|
|
|
|
|
color: palette.link
|
|
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
2025-03-03 16:18:15 +01:00
|
|
|
onClicked: detailsLabel.visible = !detailsLabel.visible
|
2023-06-05 18:12:29 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Flowee.Label {
|
|
|
|
|
id: detailsLabel
|
2026-03-14 21:14:42 +01:00
|
|
|
text: qsTr("Scanned text: <pre>%1</pre>").arg(scannedUrlFaultyDialog.scanResult)
|
2023-06-05 18:12:29 +02:00
|
|
|
visible: false
|
|
|
|
|
font.pixelSize: mainText.pixelSize * 0.8
|
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
|
width: parent.width
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-05 18:34:53 +01:00
|
|
|
}
|
|
|
|
|
|
2023-03-11 22:44:27 +01:00
|
|
|
PriceInputWidget {
|
2023-05-31 15:20:11 +02:00
|
|
|
id: priceInput // when the price / amount is editable
|
2023-03-12 14:26:13 +01:00
|
|
|
paymentBackend: payment
|
2023-03-11 22:44:27 +01:00
|
|
|
width: parent.width
|
2023-05-31 15:20:11 +02:00
|
|
|
x: allowEditAmount ? 0 : 0 - width
|
2025-09-22 23:46:07 +02:00
|
|
|
fiatFollowsSats: Pay.preferSatsPayments
|
2023-05-31 15:20:11 +02:00
|
|
|
|
|
|
|
|
Behavior on x { NumberAnimation { } }
|
|
|
|
|
}
|
|
|
|
|
Item {
|
|
|
|
|
id: priceFeedback // when the price / amount is given by the scanned QR
|
|
|
|
|
width: parent.width
|
|
|
|
|
x: allowEditAmount ? 0 - width : 0
|
|
|
|
|
y: 10
|
|
|
|
|
height: col.height
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
id: col
|
|
|
|
|
width: parent.width
|
|
|
|
|
Flowee.Label {
|
|
|
|
|
id: fiatPrice
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
text: Fiat.formattedPrice(payment.paymentAmountFiat)
|
|
|
|
|
font.pixelSize: 38
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Flowee.BitcoinAmountLabel {
|
|
|
|
|
value: payment.paymentAmount
|
|
|
|
|
colorize: false
|
|
|
|
|
showFiat: false
|
|
|
|
|
font.pixelSize: mainWindow.font.pixelSize * 0.8
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Behavior on x { NumberAnimation { } }
|
2022-12-20 15:18:05 +01:00
|
|
|
}
|
|
|
|
|
|
2022-12-05 18:34:53 +01:00
|
|
|
Flowee.Label {
|
2022-12-05 21:24:32 +01:00
|
|
|
id: commentLabel
|
2023-08-30 12:50:40 +02:00
|
|
|
text: qsTr("Payment description")
|
|
|
|
|
visible: userComment.visible
|
|
|
|
|
y: {
|
|
|
|
|
if (!userComment.visible)
|
2026-03-14 21:14:42 +01:00
|
|
|
return 0
|
2023-08-30 12:50:40 +02:00
|
|
|
if (root.allowEditAmount) { // the numpad is on
|
|
|
|
|
/*
|
|
|
|
|
position based on available space and how many items
|
|
|
|
|
need to be visible.
|
|
|
|
|
If invisible, place at -100
|
|
|
|
|
*/
|
|
|
|
|
let space = walletNameBackground.y - (priceInput.y + priceInput.height)
|
|
|
|
|
if (destinationAddress.visible)
|
|
|
|
|
space -= destinationAddress.height + 10
|
2026-03-14 21:14:42 +01:00
|
|
|
space -= userComment.height + 10
|
2023-08-30 12:50:40 +02:00
|
|
|
if (space < height + 10)
|
2026-03-14 21:14:42 +01:00
|
|
|
return -100
|
|
|
|
|
return priceInput.y + priceInput.height + 10
|
2023-08-30 12:50:40 +02:00
|
|
|
}
|
2026-03-14 21:14:42 +01:00
|
|
|
return walletNameBackground.y + walletNameBackground.height + 10
|
2023-08-30 12:50:40 +02:00
|
|
|
}
|
2022-12-05 18:34:53 +01:00
|
|
|
}
|
|
|
|
|
Flowee.Label {
|
2022-12-05 21:24:32 +01:00
|
|
|
id: userComment
|
2022-12-05 18:34:53 +01:00
|
|
|
text: payment.userComment
|
2023-08-30 12:50:40 +02:00
|
|
|
visible: text !== "" && !errorLabel.visible
|
2022-12-07 14:22:11 +01:00
|
|
|
color: palette.highlight
|
2022-12-05 21:24:32 +01:00
|
|
|
font.italic: true
|
2023-08-30 12:50:40 +02:00
|
|
|
y: {
|
|
|
|
|
if (!visible)
|
2026-03-14 21:14:42 +01:00
|
|
|
return 0
|
2023-08-30 12:50:40 +02:00
|
|
|
if (commentLabel.y < 0)
|
2026-03-14 21:14:42 +01:00
|
|
|
return priceInput.y + priceInput.height + 10
|
|
|
|
|
return commentLabel.y + commentLabel.height + 6
|
2023-08-30 12:50:40 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Flowee.Label {
|
|
|
|
|
id: destinationAddressHeader
|
|
|
|
|
text: qsTr("Destination Address")
|
|
|
|
|
visible: destinationAddress.visible
|
|
|
|
|
|
|
|
|
|
y: {
|
|
|
|
|
if (!visible)
|
2026-03-14 21:14:42 +01:00
|
|
|
return 0
|
2023-08-30 12:50:40 +02:00
|
|
|
if (root.allowEditAmount) { // the numpad is on
|
|
|
|
|
let space = walletNameBackground.y - (priceInput.y + priceInput.height)
|
|
|
|
|
if (userComment.visible)
|
|
|
|
|
space -= userComment.height + 10
|
|
|
|
|
if (commentLabel.visible)
|
|
|
|
|
space -= commentLabel.height + 10
|
2026-03-14 21:14:42 +01:00
|
|
|
space -= destinationAddress.height + 10
|
2023-08-30 12:50:40 +02:00
|
|
|
if (space < height + 10)
|
2026-03-14 21:14:42 +01:00
|
|
|
return -100
|
2023-08-30 12:50:40 +02:00
|
|
|
if (userComment.visible)
|
2026-03-14 21:14:42 +01:00
|
|
|
return userComment.y + userComment.height + 10
|
|
|
|
|
return priceInput.y + priceInput.height + 10
|
2023-08-30 12:50:40 +02:00
|
|
|
}
|
|
|
|
|
if (userComment.visible)
|
2026-03-14 21:14:42 +01:00
|
|
|
return userComment.y + userComment.height + 10
|
|
|
|
|
return walletNameBackground.y + walletNameBackground.height + 10
|
2023-08-30 12:50:40 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Flowee.LabelWithClipboard {
|
|
|
|
|
id: destinationAddress
|
|
|
|
|
text: payment.niceAddress
|
|
|
|
|
width: parent.width
|
|
|
|
|
visible: showTargetAddress.checked && !errorLabel.visible
|
|
|
|
|
font.pixelSize: mainWindow.font.pixelSize * 0.9
|
|
|
|
|
y: {
|
|
|
|
|
if (!visible)
|
2026-03-14 21:14:42 +01:00
|
|
|
return 0
|
2023-08-30 12:50:40 +02:00
|
|
|
if (destinationAddressHeader.y < 0){
|
|
|
|
|
if (userComment.visible)
|
2026-03-14 21:14:42 +01:00
|
|
|
return userComment.y + userComment.height + 10
|
|
|
|
|
return priceInput.y + priceInput.height + 10
|
2023-08-30 12:50:40 +02:00
|
|
|
}
|
2026-03-14 21:14:42 +01:00
|
|
|
return destinationAddressHeader.y + destinationAddressHeader.height + 6
|
2023-08-30 12:50:40 +02:00
|
|
|
}
|
2022-12-05 18:34:53 +01:00
|
|
|
}
|
2023-02-06 21:55:54 +01:00
|
|
|
|
2023-05-17 23:26:54 +02:00
|
|
|
Rectangle {
|
|
|
|
|
visible: errorLabel.text !== ""
|
|
|
|
|
color: mainWindow.errorRedBg
|
|
|
|
|
radius: 10
|
|
|
|
|
width: parent.width
|
2023-02-06 21:55:54 +01:00
|
|
|
anchors.bottom: walletNameBackground.top
|
2023-03-11 22:44:27 +01:00
|
|
|
anchors.bottomMargin: 6
|
2023-05-17 23:26:54 +02:00
|
|
|
height: errorLabel.height + 20
|
|
|
|
|
|
|
|
|
|
Flowee.Label {
|
|
|
|
|
id: errorLabel
|
|
|
|
|
text: payment.error
|
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
|
x: 10
|
|
|
|
|
y: 10
|
|
|
|
|
width: parent.width - 20
|
|
|
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
|
|
|
}
|
2023-05-18 21:52:51 +02:00
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
// just here to catch mouse clicks.
|
|
|
|
|
}
|
2022-12-07 14:22:11 +01:00
|
|
|
}
|
2022-12-05 21:24:32 +01:00
|
|
|
|
2023-03-13 10:24:15 +01:00
|
|
|
AccountSelectorWidget {
|
2023-02-06 21:55:54 +01:00
|
|
|
id: walletNameBackground
|
2024-02-13 14:26:29 +01:00
|
|
|
y: {
|
|
|
|
|
var y = priceInput.height
|
|
|
|
|
if (commentLabel.visible && !root.allowEditAmount && commentLabel.y > 0)
|
|
|
|
|
y += commentLabel.height + userComment.height + 6 + 10
|
|
|
|
|
else if (userComment.visible)
|
|
|
|
|
y += userComment.height + 10
|
|
|
|
|
|
|
|
|
|
if (destinationAddressHeader.visible && !root.allowEditAmount && destinationAddressHeader.y > 0)
|
|
|
|
|
y += destinationAddressHeader.height + destinationAddress.height + 6
|
|
|
|
|
else if (destinationAddress.visible)
|
|
|
|
|
y += destinationAddress.height + 10
|
2026-03-14 21:14:42 +01:00
|
|
|
y += 10
|
2024-02-13 14:26:29 +01:00
|
|
|
|
2026-03-14 21:14:42 +01:00
|
|
|
var altY = parent.height
|
2024-02-13 14:26:29 +01:00
|
|
|
altY -= 10 + slideToApprove.height + 25
|
|
|
|
|
altY -= numericKeyboard.contentHeight + height + 10
|
|
|
|
|
|
2026-03-14 21:14:42 +01:00
|
|
|
return Math.max(y, altY)
|
2024-02-13 14:26:29 +01:00
|
|
|
}
|
2024-10-05 21:30:39 +02:00
|
|
|
onSelectedAccountChanged: payment.account = selectedAccount
|
2023-03-13 16:58:05 +01:00
|
|
|
|
2023-08-30 12:50:40 +02:00
|
|
|
balanceActions: {
|
|
|
|
|
if (editPrice.checked)
|
2026-03-14 21:14:42 +01:00
|
|
|
return [ sendAllAction ]
|
|
|
|
|
return []
|
2023-08-30 12:50:40 +02:00
|
|
|
}
|
2022-12-05 21:24:32 +01:00
|
|
|
}
|
|
|
|
|
|
2023-03-11 22:44:27 +01:00
|
|
|
NumericKeyboardWidget {
|
2022-12-05 21:24:32 +01:00
|
|
|
id: numericKeyboard
|
|
|
|
|
anchors.bottom: slideToApprove.top
|
2022-12-07 14:22:11 +01:00
|
|
|
anchors.bottomMargin: 15
|
2024-02-13 14:26:29 +01:00
|
|
|
anchors.top: walletNameBackground.bottom
|
2022-12-05 21:24:32 +01:00
|
|
|
width: parent.width
|
2024-02-13 14:26:29 +01:00
|
|
|
height: implicitHeight
|
2023-02-06 21:55:54 +01:00
|
|
|
enabled: !payment.details[0].maxSelected
|
2023-05-31 15:20:11 +02:00
|
|
|
x: allowEditAmount ? 0 : 0 - width
|
2023-06-27 18:57:50 +02:00
|
|
|
dataInput: priceInput
|
2023-05-31 15:20:11 +02:00
|
|
|
|
|
|
|
|
Behavior on x { NumberAnimation { } }
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-07 14:22:11 +01:00
|
|
|
SlideToApprove {
|
2022-12-05 21:24:32 +01:00
|
|
|
id: slideToApprove
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.bottomMargin: 10
|
2022-12-07 14:22:11 +01:00
|
|
|
width: parent.width
|
|
|
|
|
enabled: payment.isValid && payment.txPrepared
|
2026-02-06 11:55:09 +01:00
|
|
|
onActivated: payment.markUserApproved()
|
2023-06-28 22:46:22 +02:00
|
|
|
visible: payment.account.isDecrypted || !payment.account.needsPinToPay
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-02 20:23:29 +02:00
|
|
|
Flickable {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
contentWidth: width
|
|
|
|
|
contentHeight: warningsColumn.implicitHeight
|
2023-09-06 13:17:35 +02:00
|
|
|
enabled: warningsColumn.implicitHeight > 0
|
2023-09-02 20:23:29 +02:00
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
id: warningsColumn
|
|
|
|
|
width: parent.width
|
|
|
|
|
Repeater {
|
|
|
|
|
model: payment.warnings
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
y: 8
|
|
|
|
|
width: root.width - 16
|
|
|
|
|
height: Math.max(75, Math.max(warningIcon.height, warningText.height) + 20)
|
|
|
|
|
radius: 20
|
|
|
|
|
color: palette.alternateBase
|
|
|
|
|
border.width: 1
|
|
|
|
|
border.color: palette.midlight
|
|
|
|
|
|
|
|
|
|
Rectangle { // placeholder icon
|
|
|
|
|
id: warningIcon
|
|
|
|
|
x: 20
|
|
|
|
|
width: 40
|
|
|
|
|
height: 40
|
|
|
|
|
radius: 20
|
|
|
|
|
color: mainWindow.errorRedBg
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Flowee.Label {
|
|
|
|
|
id: warningText
|
|
|
|
|
text: modelData
|
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
|
anchors.left: warningIcon.right
|
|
|
|
|
anchors.leftMargin: 10
|
2023-09-05 19:09:46 +02:00
|
|
|
anchors.right: closeIcon.left
|
2023-09-02 20:23:29 +02:00
|
|
|
anchors.rightMargin: 10
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
}
|
|
|
|
|
Flowee.CloseIcon {
|
2023-09-05 19:09:46 +02:00
|
|
|
id: closeIcon
|
2023-09-02 20:23:29 +02:00
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.margins: 10
|
2026-03-14 21:14:42 +01:00
|
|
|
onClicked: payment.clearWarnings()
|
2023-09-02 20:23:29 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-28 22:46:22 +02:00
|
|
|
Item {
|
|
|
|
|
id: decryptButton
|
|
|
|
|
visible: !slideToApprove.visible
|
|
|
|
|
anchors.fill: slideToApprove
|
|
|
|
|
|
|
|
|
|
Image {
|
|
|
|
|
id: lockIcon
|
2026-03-14 21:14:42 +01:00
|
|
|
source: "qrc:/lock" + (Pay.useDarkSkin ? "-light.svg" : ".svg")
|
2023-06-28 22:46:22 +02:00
|
|
|
x: 10
|
|
|
|
|
y: 5
|
|
|
|
|
width: 50
|
|
|
|
|
height: 50
|
|
|
|
|
smooth: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Flowee.Button {
|
|
|
|
|
height: parent.height - 10
|
|
|
|
|
width: parent.width - 80
|
|
|
|
|
x: 70
|
|
|
|
|
y: 5
|
|
|
|
|
text: qsTr("Unlock Wallet")
|
|
|
|
|
onClicked: thePile.push(unlockInPage)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: unlockInPage
|
|
|
|
|
Page {
|
|
|
|
|
headerText: payment.account.name
|
|
|
|
|
UnlockWalletPanel {
|
2023-06-30 22:27:27 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
|
anchors.margins: 10
|
|
|
|
|
|
2023-06-28 22:46:22 +02:00
|
|
|
account: payment.account
|
|
|
|
|
Connections {
|
|
|
|
|
target: payment.account
|
|
|
|
|
function onIsDecryptedChanged() {
|
|
|
|
|
if (payment.account.isDecrypted)
|
|
|
|
|
thePile.pop()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-05 21:24:32 +01:00
|
|
|
}
|
|
|
|
|
|
2022-12-07 18:30:02 +01:00
|
|
|
Flowee.BroadcastFeedback {
|
2022-12-07 14:22:11 +01:00
|
|
|
id: broadcastPage
|
2025-02-04 21:20:35 +01:00
|
|
|
bitcoinAmount: payment.paymentAmount
|
|
|
|
|
fiatPrice: payment.fiatPrice
|
2025-02-04 22:33:08 +01:00
|
|
|
targetAddress: payment.niceAddress
|
2025-02-04 21:20:35 +01:00
|
|
|
status: payment.broadcastStatus
|
2026-02-06 11:55:09 +01:00
|
|
|
personalNote: payment.userComment
|
2025-03-16 22:14:20 +01:00
|
|
|
processNote: function process(note) {
|
|
|
|
|
payment.userComment = note
|
|
|
|
|
}
|
2022-12-07 14:22:11 +01:00
|
|
|
|
2023-03-13 13:33:45 +01:00
|
|
|
onCloseButtonPressed: {
|
2026-03-14 21:14:42 +01:00
|
|
|
var mainView = thePile.get(0)
|
|
|
|
|
mainView.currentIndex = 0 // go to the 'Home' tab.
|
|
|
|
|
thePile.pop()
|
2023-03-13 13:33:45 +01:00
|
|
|
}
|
2022-12-07 14:22:11 +01:00
|
|
|
}
|
2022-12-05 18:34:53 +01:00
|
|
|
}
|