Files
pay/desktop/NewAccountCreateHDAccount.qml
T

89 lines
2.8 KiB
QML
Raw Permalink Normal View History

2021-11-30 13:51:01 +01: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/>.
*/
2021-10-25 19:42:13 +02:00
import QtQuick 2.11
import QtQuick.Controls 2.11
import QtQuick.Layouts 1.11
import "widgets" as Flowee
2021-10-25 19:42:13 +02:00
ColumnLayout {
id: newAccountCreateHDAccount
spacing: 10
Label {
id: title
2021-11-09 21:34:40 +01:00
text: qsTr("This creates a new empty wallet with smart creation of addresses from a single seed-phrase")
2021-10-25 19:42:13 +02:00
width: parent.width
}
RowLayout {
id: nameRow
Label {
2021-11-09 21:34:40 +01:00
text: qsTr("Name") + ":";
2021-10-25 19:42:13 +02:00
Layout.alignment: Qt.AlignBaseline
}
2021-11-02 19:38:36 +01:00
Flowee.TextField {
2021-10-25 19:42:13 +02:00
id: accountName
}
}
Item {
height: button.height
Layout.fillWidth: true
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.createNewWallet(derivationPath.text, /* password */"", accountName.text);
2021-10-25 19:42:13 +02:00
var accounts = portfolio.accounts;
for (var i = 0; i < accounts.length; ++i) {
var a = accounts[i];
if (a.name === options.name) {
portfolio.current = a;
break;
}
}
root.visible = false;
}
}
}
2021-11-02 19:38:36 +01:00
Flowee.GroupBox {
2021-10-25 19:42:13 +02:00
title: qsTr("Advanced Options")
Layout.fillWidth: true
2021-10-30 15:23:43 +02:00
collapsed: true
2021-10-30 16:12:41 +02:00
columns: 3
2021-10-25 19:42:13 +02:00
/*
2021-11-02 19:35:38 +01:00
Flowee.CheckBox {
2021-10-25 19:42:13 +02:00
id: schnorr
text: qsTr("Default to signing using ECDSA");
tooltipText: qsTr("When enabled, newer style Schnorr signatures are not set as default for this wallet.")
Layout.columnSpan: 2
} */
Label {
2021-10-30 16:12:41 +02:00
text: qsTr("Derivation") + ":"
2021-10-29 18:20:42 +02:00
Layout.fillWidth: false
2021-10-25 19:42:13 +02:00
}
2021-11-02 19:38:36 +01:00
Flowee.TextField {
2021-10-25 19:42:13 +02:00
id: derivationPath
2022-08-18 16:57:28 +02:00
text: "m/44'/0'/0'" // What most wallets use to import by default
2021-11-02 19:29:14 +01:00
color: Pay.checkDerivation(text) ? palette.text : "red"
2021-10-25 19:42:13 +02:00
}
2021-10-30 16:12:41 +02:00
Item { width: 1; height: 1; Layout.fillWidth: true } // spacer
2021-10-25 19:42:13 +02:00
}
}