Skip to content

Commit b4e421e

Browse files
committed
qml: Add MultipleSendReview page
1 parent 19b9b2f commit b4e421e

File tree

6 files changed

+180
-5
lines changed

6 files changed

+180
-5
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ QML_RES_QML = \
488488
qml/pages/wallet/CreatePassword.qml \
489489
qml/pages/wallet/CreateWalletWizard.qml \
490490
qml/pages/wallet/DesktopWallets.qml \
491+
qml/pages/wallet/MultipleSendReview.qml \
491492
qml/pages/wallet/RequestPayment.qml \
492493
qml/pages/wallet/Send.qml \
493494
qml/pages/wallet/SendResult.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
<file>pages/wallet/CreatePassword.qml</file>
9191
<file>pages/wallet/CreateWalletWizard.qml</file>
9292
<file>pages/wallet/DesktopWallets.qml</file>
93+
<file>pages/wallet/MultipleSendReview.qml</file>
9394
<file>pages/wallet/RequestPayment.qml</file>
9495
<file>pages/wallet/Send.qml</file>
9596
<file>pages/wallet/SendResult.qml</file>

src/qml/pages/main.qml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ ApplicationWindow {
8585
main.push(createWalletWizard)
8686
}
8787
onSendTransaction: {
88-
main.push(sendReviewPage)
88+
if (multipleRecipientsEnabled) {
89+
main.push(multipleSendReviewPage)
90+
} else {
91+
main.push(sendReviewPage)
92+
}
8993
}
9094
}
9195
}
@@ -113,6 +117,20 @@ ApplicationWindow {
113117
}
114118
}
115119

120+
Component {
121+
id: multipleSendReviewPage
122+
MultipleSendReview {
123+
onBack: {
124+
main.pop()
125+
}
126+
onTransactionSent: {
127+
walletController.selectedWallet.sendRecipient.clear()
128+
main.pop()
129+
sendResult.open()
130+
}
131+
}
132+
}
133+
116134
SendResult {
117135
id: sendResult
118136
closePolicy: Popup.CloseOnPressOutside

src/qml/pages/wallet/DesktopWallets.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Page {
2020
ButtonGroup { id: navigationTabs }
2121

2222
signal addWallet()
23-
signal sendTransaction()
23+
signal sendTransaction(bool multipleRecipientsEnabled)
2424

2525
header: NavigationBar2 {
2626
id: navBar
@@ -136,7 +136,7 @@ Page {
136136
}
137137
Send {
138138
id: sendTab
139-
onTransactionPrepared: root.sendTransaction()
139+
onTransactionPrepared: root.sendTransaction(multipleRecipientsEnabled)
140140
}
141141
RequestPayment {
142142
id: receiveTab
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
// Copyright (c) 2024 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
import QtQuick 2.15
6+
import QtQuick.Controls 2.15
7+
import QtQuick.Layouts 1.15
8+
import org.bitcoincore.qt 1.0
9+
10+
import "../../controls"
11+
import "../../components"
12+
13+
Page {
14+
id: root
15+
background: null
16+
17+
property WalletQmlModel wallet: walletController.selectedWallet
18+
property WalletQmlModelTransaction transaction: walletController.selectedWallet.currentTransaction
19+
20+
signal finished()
21+
signal back()
22+
signal transactionSent()
23+
24+
header: NavigationBar2 {
25+
id: navbar
26+
leftItem: NavButton {
27+
iconSource: "image://images/caret-left"
28+
text: qsTr("Back")
29+
onClicked: {
30+
root.back()
31+
}
32+
}
33+
}
34+
35+
ScrollView {
36+
clip: true
37+
width: parent.width
38+
height: parent.height
39+
contentWidth: width
40+
41+
ColumnLayout {
42+
id: columnLayout
43+
width: 450
44+
anchors.horizontalCenter: parent.horizontalCenter
45+
46+
spacing: 15
47+
48+
CoreText {
49+
id: title
50+
Layout.topMargin: 30
51+
Layout.bottomMargin: 15
52+
text: qsTr("Transaction details")
53+
font.pixelSize: 21
54+
bold: true
55+
}
56+
57+
ListView {
58+
id: inputsList
59+
Layout.fillWidth: true
60+
Layout.preferredHeight: contentHeight
61+
model: root.wallet.recipients
62+
delegate: Item {
63+
id: delegate
64+
height: 55
65+
width: ListView.view.width
66+
67+
required property string address;
68+
required property string label;
69+
required property string amount;
70+
71+
RowLayout {
72+
spacing: 10
73+
anchors.fill: parent
74+
CoreText {
75+
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
76+
Layout.fillWidth: true
77+
horizontalAlignment: Text.AlignLeft
78+
text: label == "" ? address : label
79+
font.pixelSize: 18
80+
elide: Text.ElideMiddle
81+
}
82+
83+
CoreText {
84+
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
85+
text: amount
86+
font.pixelSize: 18
87+
}
88+
}
89+
90+
Separator {
91+
anchors.left: parent.left
92+
anchors.right: parent.right
93+
anchors.bottom: parent.bottom
94+
color: Theme.color.neutral3
95+
}
96+
}
97+
}
98+
99+
RowLayout {
100+
Layout.topMargin: 20
101+
CoreText {
102+
text: qsTr("Total amount")
103+
font.pixelSize: 20
104+
color: Theme.color.neutral9
105+
horizontalAlignment: Text.AlignLeft
106+
}
107+
Item {
108+
Layout.fillWidth: true
109+
}
110+
CoreText {
111+
text: root.transaction.total
112+
font.pixelSize: 20
113+
color: Theme.color.neutral9
114+
}
115+
}
116+
117+
Separator {
118+
Layout.fillWidth: true
119+
color: Theme.color.neutral3
120+
}
121+
122+
RowLayout {
123+
CoreText {
124+
text: qsTr("Fee")
125+
font.pixelSize: 18
126+
Layout.preferredWidth: 110
127+
horizontalAlignment: Text.AlignLeft
128+
}
129+
Item {
130+
Layout.fillWidth: true
131+
}
132+
CoreText {
133+
text: root.transaction.fee
134+
font.pixelSize: 15
135+
}
136+
}
137+
138+
Separator {
139+
Layout.fillWidth: true
140+
color: Theme.color.neutral3
141+
}
142+
143+
ContinueButton {
144+
id: confimationButton
145+
Layout.fillWidth: true
146+
Layout.topMargin: 30
147+
text: qsTr("Send")
148+
onClicked: {
149+
root.wallet.sendTransaction()
150+
root.transactionSent()
151+
}
152+
}
153+
}
154+
}
155+
}

src/qml/pages/wallet/Send.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PageStack {
1818
property WalletQmlModel wallet: walletController.selectedWallet
1919
property SendRecipient recipient: wallet.recipients.current
2020

21-
signal transactionPrepared()
21+
signal transactionPrepared(bool multipleRecipientsEnabled)
2222

2323
Connections {
2424
target: walletController
@@ -293,7 +293,7 @@ PageStack {
293293
text: qsTr("Review")
294294
onClicked: {
295295
if (root.wallet.prepareTransaction()) {
296-
root.transactionPrepared()
296+
root.transactionPrepared(settings.multipleRecipientsEnabled);
297297
}
298298
}
299299
}

0 commit comments

Comments
 (0)