Files

83 lines
2.7 KiB
QML
Raw Permalink Normal View History

2021-10-15 21:01:40 +02:00
/*
* This file is part of the Flowee project
2024-05-03 22:15:51 +02:00
* Copyright (C) 2021, 2024 Tom Zander <tom@flowee.org>
2021-10-15 21:01:40 +02: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/>.
*/
2024-05-03 22:15:51 +02:00
2022-11-26 10:46:57 +01:00
import QtQuick
import QtQuick.Layouts
2022-11-14 21:19:31 +01:00
import "../Flowee" as Flowee
2021-10-15 21:01:40 +02:00
2024-05-03 22:15:51 +02:00
Item {
implicitWidth: columnWidth // columnWidth is defined by loader in NewAccountPane
height: col.height
// ColumnLayoud is trying to outsmart us and when I supply implicitWidth it ends up giving
// one that is based on its content instead of the one I specifically told it to use.
// Which is why we wrap the columnLayout in an Item.
ColumnLayout {
id: col
spacing: 10
2021-10-15 21:01:40 +02:00
width: parent.width
2024-05-03 22:15:51 +02:00
Flowee.Label {
id: title
2024-10-14 12:08:43 +02:00
text: qsTr("Create a new empty wallet with simple multi-address capability ")
2024-05-03 22:15:51 +02:00
Layout.fillWidth: true
font.bold: true
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
2021-10-15 21:01:40 +02:00
}
2024-05-03 22:15:51 +02:00
RowLayout {
id: nameRow
spacing: 6
Flowee.Label {
text: qsTr("Name") + ":";
Layout.alignment: Qt.AlignBaseline
}
Flowee.TextField {
id: accountName
Layout.fillWidth: true
}
2021-10-15 21:01:40 +02:00
}
2024-05-03 22:15:51 +02:00
Flowee.CheckBox {
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")
checked: true
}
2021-10-15 21:01:40 +02:00
Flowee.Button {
2021-10-25 19:42:13 +02:00
id: button
text: qsTr("Go")
2024-05-03 22:15:51 +02:00
Layout.alignment: Qt.AlignRight
2021-10-25 19:42:13 +02:00
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
}
2024-05-03 22:15:51 +02:00
newAccountsPane.visible = false;
2021-10-15 21:01:40 +02:00
}
}
}
}