Files
pay/guis/desktop/NewAccountCreateBasicAccount.qml
T

76 lines
2.3 KiB
QML
Raw Permalink Normal View History

2021-10-15 21:01:40 +02:00
/*
* This file is part of the Flowee project
* Copyright (C) 2021 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/>.
*/
2022-11-26 10:46:57 +01:00
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
2022-11-14 21:19:31 +01:00
import "../Flowee" as Flowee
2021-10-15 21:01:40 +02:00
2021-10-25 19:42:13 +02:00
ColumnLayout {
spacing: 10
2021-10-15 21:01:40 +02:00
Label {
id: title
text: qsTr("This creates a new empty wallet with simple multi-address capability")
2021-10-15 21:01:40 +02:00
width: parent.width
}
RowLayout {
id: nameRow
Label {
2021-11-09 21:34:40 +01:00
text: qsTr("Name") + ":";
2021-10-15 21:01:40 +02:00
Layout.alignment: Qt.AlignBaseline
}
2021-11-02 19:38:36 +01:00
Flowee.TextField {
2021-10-15 21:01:40 +02:00
id: accountName
}
}
2021-10-25 19:42:13 +02:00
Item {
height: button.height
Layout.fillWidth: true
2021-10-15 21:01:40 +02:00
Flowee.Button {
2021-10-25 19:42:13 +02:00
id: button
text: qsTr("Go")
anchors.right: parent.right
onClicked: {
2021-11-02 19:29:14 +01:00
var options = Pay.createNewBasicWallet(accountName.text);
2021-10-25 19:42:13 +02:00
options.forceSingleAddress = singleAddress.checked;
for (let a of portfolio.accounts) {
if (a.id === options.accountId) {
2021-10-25 19:42:13 +02:00
portfolio.current = a;
break;
}
2021-10-15 21:01:40 +02:00
}
2021-10-25 19:42:13 +02:00
root.visible = false;
2021-10-15 21:01:40 +02:00
}
}
}
2021-11-02 19:38:36 +01:00
Flowee.GroupBox {
2021-10-25 19:42:13 +02:00
id: gb
title: qsTr("Advanced Options")
2021-10-30 15:23:43 +02:00
collapsed: true
2021-10-25 19:42:13 +02:00
Layout.fillWidth: true
2021-10-15 21:01:40 +02:00
columns: 1
2021-11-02 19:35:38 +01:00
Flowee.CheckBox {
2021-10-15 21:01:40 +02:00
id: singleAddress
text: qsTr("Force Single Address");
toolTipText: qsTr("When enabled, this wallet will be limited to one address.\nThis ensures only one private key will need to be backed up")
2021-10-15 21:01:40 +02:00
}
}
}