[GUI] Fixes in transfer form

This commit is contained in:
Nathan Hourt 2015-07-17 16:06:07 -04:00
parent 0fe9276c44
commit e221fabe39
2 changed files with 8 additions and 7 deletions

View file

@ -28,9 +28,10 @@ RowLayout {
Layout.fillWidth: true
TextField {
id: accountNameField
width: parent.width
onEditingFinished: accountDetails.update(text)
onTextChanged: if (account && account.name !== text) accountDetails.update("")
}
Text {
id: accountDetails
@ -57,8 +58,8 @@ RowLayout {
var text = qsTr("Account ID: %1").arg(account.id < 0? qsTr("Loading...")
: account.id)
if (showBalance >= 0) {
text += "\n" + qsTr("Balance: %1 %2").arg(balances[showBalance].amountReal())
.arg(balances[showBalance].type.symbol)
var bal = balances[showBalance]
text += "\n" + qsTr("Balance: %1 %2").arg(String(bal.amountReal())).arg(bal.type.symbol)
}
return text
})

View file

@ -58,13 +58,13 @@ Rectangle {
maximumValue: maxBalance? maxBalance.amountReal() : 0
decimals: maxBalance? maxBalance.type.precision : 0
property Balance maxBalance: senderPicker.balances && senderPicker.showBalance >= 0?
senderPicker.balances[senderPicker.showBalance] : null
property Balance maxBalance: assetField.enabled && senderPicker.showBalance >= 0?
senderPicker.balances[senderPicker.showBalance] : null
}
ComboBox {
id: assetField
Layout.minimumWidth: Scaling.cm(3)
enabled: Boolean(senderPicker.balances)
enabled: senderPicker.balances instanceof Array && senderPicker.balances.length > 0
model: enabled? senderPicker.balances.filter(function(balance) { return balance.amount > 0 })
.map(function(balance) { return balance.type.symbol })
: ["Asset Type"]
@ -76,7 +76,7 @@ Rectangle {
}
Button {
text: qsTr("Transfer")
enabled: senderPicker.account
enabled: senderPicker.account && recipientPicker.account && senderPicker.account !== recipientPicker.account && amountField.value
onClicked: console.log(amountField.value)
}
}