Files

124 lines
3.9 KiB
QML
Raw Permalink Normal View History

2024-12-24 15:09:20 +01:00
/*
* This file is part of the Flowee project
* Copyright (C) 2024-2025 Tom Zander <tom@flowee.org>
2024-12-24 15:09:20 +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.Controls as QQC2;
import QtQuick.Layouts;
2024-12-24 15:09:20 +01:00
import "../mobile" as Mobile;
import "../Flowee" as Flowee;
2024-12-24 15:09:20 +01:00
import Flowee.org.pay;
import Flowee.org.pay.bigtransfer;
Mobile.Page {
id: root
2025-01-09 20:06:18 +01:00
headerText: qsTr("Wallet to Wallet")
2024-12-24 15:09:20 +01:00
ColumnLayout {
width: parent.width
2024-12-24 15:09:20 +01:00
spacing: 10
Flowee.Label {
Layout.fillWidth: true
wrapMode: Text.WordWrap
2025-06-17 22:42:54 +02:00
text: qsTr("Select two wallets to transfer funds simply, using anonymity preserving transactions.")
}
2024-12-24 15:09:20 +01:00
Mobile.TextButton {
text: qsTr("Select Spending Wallet")
subtext: {
var from = transferManager.fromAccount;
if (from === null)
return "";
return from.name
}
onClicked: fromWalletPicker.visible = true
SimpleWalletPicker {
id: fromWalletPicker
text: parent.text
accounts: portfolio.accounts
onSelectedChanged: transferManager.fromAccount = selected;
current: transferManager.fromAccount
}
2024-12-24 15:09:20 +01:00
}
GridLayout {
columns: 2
columnSpacing: 10
rowSpacing: 10
enabled: transferManager.fromAccount !== null
Flowee.Label {
text: qsTr("Addresses") + ":"
}
Flowee.Label {
text: transferManager.addressCount
}
Flowee.Label {
text: qsTr("Coins") + ":"
}
Flowee.Label {
text: transferManager.coinCount
}
}
Mobile.TextButton {
text: qsTr("Destination Wallet")
subtext: {
var to = transferManager.toAccount;
if (to === null)
return "";
return to.name
}
// TODO add an entry "create new HD wallet"
onClicked: toWalletPicker.visible = true;
SimpleWalletPicker {
id: toWalletPicker
text: parent.text
accounts: {
var list = [];
for (let wallet of portfolio.accounts) {
if (wallet === transferManager.fromAccount || !wallet.isHDWallet)
continue;
list.push(wallet);
}
return list;
}
onSelectedChanged: transferManager.toAccount = selected;
current: transferManager.toAccount
}
2024-12-24 15:09:20 +01:00
}
// button to start.
Flowee.Button {
Layout.alignment: Qt.AlignRight
text: qsTr("Prepare...")
2024-12-29 19:13:22 +01:00
enabled: transferManager.inputsOk
onClicked: {
transferManager.prepare();
thePile.push("ShowPrepared.qml", { "transferManager" : transferManager } );
}
}
}
Item {
// data
TransferManager {
id: transferManager
fromAccount: portfolio.current
}
2024-12-24 15:09:20 +01:00
}
}