Files
pay/desktop/AccountDetails.qml
T

125 lines
3.5 KiB
QML
Raw Permalink Normal View History

2020-11-04 18:33:50 +01:00
/*
* This file is part of the Flowee project
2021-01-05 14:03:30 +01:00
* Copyright (C) 2020 Tom Zander <tom@flowee.org>
2020-11-04 18:33:50 +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 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
ApplicationWindow {
id: root
visible: true
minimumWidth: 300
minimumHeight: 400
width: 400
height: grid.height + 20
title: qsTr("Account Details")
modality: Qt.NonModal
flags: Qt.Dialog
2021-01-29 10:27:24 +01:00
2020-11-04 18:33:50 +01:00
property QtObject account: null
GridLayout {
id: grid
columns: 2
anchors.fill: parent
anchors.margins: 10
Keys.onPressed: {
if (event.key === Qt.Key_Escape) {
root.visible = false;
event.accepted = true
}
}
Label {
id: header
text: {
// ok we only have one type so far, so this is rather simple...
qsTr("This account is a single-address wallet.")
}
Layout.columnSpan: 2
}
2021-01-29 10:27:24 +01:00
Label { text: qsTr("Name") + ":" }
2020-11-04 18:33:50 +01:00
TextField {
text: root.account.name
focus: true
Layout.fillWidth: true
onAccepted: root.account.name = text
}
2020-11-06 22:15:03 +01:00
Label {
2021-01-29 10:27:24 +01:00
text: qsTr("Balance unconfirmed") + ":"
2020-11-06 22:15:03 +01:00
}
2020-12-26 15:30:29 +01:00
BitcoinAmountLabel {
value: root.account.balanceUnconfirmed
colorize: false
2020-11-06 22:15:03 +01:00
}
Label {
2021-01-29 10:27:24 +01:00
text: qsTr("Balance immature") + ":"
2020-11-06 22:15:03 +01:00
}
2020-12-26 15:30:29 +01:00
BitcoinAmountLabel {
value: root.account.balanceImmature
colorize: false
2020-11-06 22:15:03 +01:00
}
Label {
2021-01-29 10:27:24 +01:00
text: qsTr("Balance other") + ":"
2020-11-06 22:15:03 +01:00
}
2020-12-26 15:30:29 +01:00
BitcoinAmountLabel {
value: root.account.balanceConfirmed
colorize: false
2020-11-06 22:15:03 +01:00
}
2020-11-04 18:33:50 +01:00
Label {
2021-01-31 20:59:53 +01:00
text: qsTr("Available coins") + ":"
2020-11-04 18:33:50 +01:00
}
Label {
text: root.account.unspentOutputCount
}
Label {
2021-01-31 20:59:53 +01:00
text: qsTr("Historical coins") + ":"
2020-11-04 18:33:50 +01:00
}
Label {
text: root.account.historicalOutputCount
}
Label {
2021-01-29 10:27:24 +01:00
text: qsTr("Sync status") + ":"
2020-11-04 18:33:50 +01:00
}
SyncIndicator {
id: syncIndicator
accountBlockHeight: root.account === null ? 0 : root.account.lastBlockSynched
}
Pane {}
Label {
text: syncIndicator.accountBlockHeight + " / " + syncIndicator.globalPos
}
2020-12-26 15:30:29 +01:00
Item {
2020-11-04 18:33:50 +01:00
Layout.columnSpan: 2
2020-12-26 15:30:29 +01:00
width: closeButton.width
height: closeButton.height
2020-11-04 18:33:50 +01:00
Layout.fillHeight: true
Layout.fillWidth: true
2020-12-26 15:30:29 +01:00
Button {
id: closeButton
anchors.right: parent.right
anchors.bottom: parent.bottom
text: qsTr("Close")
onClicked: root.visible = false
}
2020-11-04 18:33:50 +01:00
}
}
}