[GUI] Add some docs in the QML

This commit is contained in:
Nathan Hourt 2015-07-17 16:39:01 -04:00
parent e221fabe39
commit 34a3c17af4
2 changed files with 27 additions and 6 deletions

View file

@ -7,14 +7,21 @@ import Graphene.Client 0.1
import "."
/// A component for choosing an Account from the chain
RowLayout {
property GrapheneApplication app
/// The text to show in the name field when it is empty
property alias placeholderText: accountNameField.placeholderText
/// Index into the balances Array of the balance to show beneath the name field
property int showBalance: -1
/// The Account object the user has selected
property Account account
/// An Array of Balance objects held by account
property var balances: account? Object.keys(account.balances).map(function(key){return account.balances[key]})
: null
property alias placeholderText: accountNameField.placeholderText
property int showBalance: -1
/// Set the name field to have active focus
function setFocus() {
accountNameField.forceActiveFocus()
}

View file

@ -7,15 +7,21 @@ import Graphene.Client 0.1
import "."
/**
* This is the form for transferring some amount of asset from one account to another.
*/
Rectangle {
id: root
anchors.fill: parent
property alias senderAccount: senderPicker.account
property alias receiverAccount: recipientPicker.account
property GrapheneApplication app
signal finished
/// The Account object for the sender
property alias senderAccount: senderPicker.account
/// The Account object for the receiver
property alias receiverAccount: recipientPicker.account
Component.onCompleted: console.log("Made a transfer form")
Component.onDestruction: console.log("Destroyed a transfer form")
@ -26,6 +32,13 @@ Rectangle {
AccountPicker {
id: senderPicker
// The senderPicker is really the heart of the form. Everything else in the form adjusts based on the account
// selected here. The assetField below updates to contain all assets this account has a nonzero balance in.
// The amountField updates based on the asset selected in the assetField to have the appropriate precision and
// to have a maximum value equal to the account's balance in that asset. The transfer button enables only when
// both accounts are set, and a nonzero amount is selected to be transferred.
app: root.app
Layout.fillWidth: true
Layout.minimumWidth: Scaling.cm(5)
Component.onCompleted: setFocus()
@ -37,6 +50,7 @@ Rectangle {
}
AccountPicker {
id: recipientPicker
app: root.app
Layout.fillWidth: true
Layout.minimumWidth: Scaling.cm(5)
placeholderText: qsTr("Recipient")