046da7515d
I just noticed I've been near consistently writing "anonimity" in Flowee Pay, spellcheck tells me it should be "anonymity". Word blindness is fun.
124 lines
3.9 KiB
QML
124 lines
3.9 KiB
QML
/*
|
|
* This file is part of the Flowee project
|
|
* Copyright (C) 2024-2025 Tom Zander <tom@flowee.org>
|
|
*
|
|
* 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;
|
|
import "../mobile" as Mobile;
|
|
import "../Flowee" as Flowee;
|
|
import Flowee.org.pay;
|
|
import Flowee.org.pay.bigtransfer;
|
|
|
|
Mobile.Page {
|
|
id: root
|
|
headerText: qsTr("Wallet to Wallet")
|
|
|
|
ColumnLayout {
|
|
width: parent.width
|
|
spacing: 10
|
|
|
|
Flowee.Label {
|
|
Layout.fillWidth: true
|
|
wrapMode: Text.WordWrap
|
|
text: qsTr("Select two wallets to transfer funds simply, using anonymity preserving transactions.")
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
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
|
|
}
|
|
}
|
|
|
|
// button to start.
|
|
Flowee.Button {
|
|
Layout.alignment: Qt.AlignRight
|
|
text: qsTr("Prepare...")
|
|
|
|
enabled: transferManager.inputsOk
|
|
onClicked: {
|
|
transferManager.prepare();
|
|
thePile.push("ShowPrepared.qml", { "transferManager" : transferManager } );
|
|
}
|
|
}
|
|
}
|
|
|
|
Item {
|
|
// data
|
|
TransferManager {
|
|
id: transferManager
|
|
fromAccount: portfolio.current
|
|
}
|
|
}
|
|
}
|