diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-20 16:00:02 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-20 16:00:02 +0800 |
commit | ecc2c609d4dfe210c66c9316cf5b060f9b3a4ff0 (patch) | |
tree | 7646add8e4c6ce26accdf00a271383fd06511156 /ethereal/assets/qml/views/wallet.qml | |
parent | a8409b0a8bfa7f8434ede495094fd8d892c28c91 (diff) | |
download | go-tangerine-ecc2c609d4dfe210c66c9316cf5b060f9b3a4ff0.tar go-tangerine-ecc2c609d4dfe210c66c9316cf5b060f9b3a4ff0.tar.gz go-tangerine-ecc2c609d4dfe210c66c9316cf5b060f9b3a4ff0.tar.bz2 go-tangerine-ecc2c609d4dfe210c66c9316cf5b060f9b3a4ff0.tar.lz go-tangerine-ecc2c609d4dfe210c66c9316cf5b060f9b3a4ff0.tar.xz go-tangerine-ecc2c609d4dfe210c66c9316cf5b060f9b3a4ff0.tar.zst go-tangerine-ecc2c609d4dfe210c66c9316cf5b060f9b3a4ff0.zip |
Implemented QML message filtering
Diffstat (limited to 'ethereal/assets/qml/views/wallet.qml')
-rw-r--r-- | ethereal/assets/qml/views/wallet.qml | 138 |
1 files changed, 120 insertions, 18 deletions
diff --git a/ethereal/assets/qml/views/wallet.qml b/ethereal/assets/qml/views/wallet.qml index 22b09640b..9afb1f89e 100644 --- a/ethereal/assets/qml/views/wallet.qml +++ b/ethereal/assets/qml/views/wallet.qml @@ -17,43 +17,145 @@ Rectangle { function onReady() { menuItem.secondary = eth.numberToHuman(eth.balanceAt(eth.key().address)) + } + ListModel { + id: denomModel + ListElement { text: "Wei" ; zeros: "" } + ListElement { text: "Ada" ; zeros: "000" } + ListElement { text: "Babbage" ; zeros: "000000" } + ListElement { text: "Shannon" ; zeros: "000000000" } + ListElement { text: "Szabo" ; zeros: "000000000000" } + ListElement { text: "Finney" ; zeros: "000000000000000" } + ListElement { text: "Ether" ; zeros: "000000000000000000" } + ListElement { text: "Einstein" ;zeros: "000000000000000000000" } + ListElement { text: "Douglas" ; zeros: "000000000000000000000000000000000000000000" } } ColumnLayout { spacing: 10 y: 40 - anchors { - left: parent.left - right: parent.right - } + anchors.fill: parent Text { + id: balance text: "<b>Balance</b>: " + eth.numberToHuman(eth.balanceAt(eth.key().address)) font.pixelSize: 24 anchors { horizontalCenter: parent.horizontalCenter + top: parent.top + topMargin: 20 } } - TableView { - id: txTableView + Rectangle { + id: newTxPane + color: "#ececec" + border.color: "#cccccc" + border.width: 1 anchors { + top: balance.bottom + topMargin: 10 left: parent.left + leftMargin: 5 right: parent.right + rightMargin: 5 + } + height: 100 + + RowLayout { + id: amountFields + spacing: 10 + anchors { + top: parent.top + topMargin: 20 + left: parent.left + leftMargin: 20 + } + + Text { + text: "Ξ " + } + + // There's something off with the row layout where textfields won't listen to the width setting + Rectangle { + width: 50 + height: 20 + TextField { + id: txValue + width: parent.width + placeholderText: "0.00" + } + } + + ComboBox { + id: valueDenom + currentIndex: 6 + model: denomModel + } + } - TableViewColumn{ role: "num" ; title: "#" ; width: 30 } - TableViewColumn{ role: "from" ; title: "From" ; width: 280 } - TableViewColumn{ role: "to" ; title: "To" ; width: 280 } - TableViewColumn{ role: "value" ; title: "Amount" ; width: 100 } - - model: ListModel { - id: txModel - Component.onCompleted: { - var messages = JSON.parse(eth.messages({latest: -1, from: "e6716f9544a56c530d868e4bfbacb172315bdead"})) - for(var i = 0; i < messages.length; i++) { - var message = messages[i]; - this.insert(0, {num: i, from: message.from, to: message.to, value: eth.numberToHuman(message.value)}) + + RowLayout { + id: toFields + spacing: 10 + anchors { + top: amountFields.bottom + topMargin: 5 + left: parent.left + leftMargin: 20 + } + + Text { + text: "To" + } + + Rectangle { + width: 200 + height: 20 + TextField { + id: txTo + width: parent.width + placeholderText: "Address or name" + } + } + + Button { + text: "Send" + onClicked: { + var value = txValue.text + denomModel.get(valueDenom.currentIndex).zeros; + var gasPrice = "10000000000000" + var res = eth.transact(eth.key().privateKey, txTo.text, value, "500", gasPrice, "") + console.log(res) + } + } + } + } + + Rectangle { + anchors { + left: parent.left + right: parent.right + top: newTxPane.bottom + topMargin: 10 + bottom: parent.bottom + } + TableView { + id: txTableView + anchors.fill : parent + TableViewColumn{ role: "num" ; title: "#" ; width: 30 } + TableViewColumn{ role: "from" ; title: "From" ; width: 280 } + TableViewColumn{ role: "to" ; title: "To" ; width: 280 } + TableViewColumn{ role: "value" ; title: "Amount" ; width: 100 } + + model: ListModel { + id: txModel + Component.onCompleted: { + var messages = JSON.parse(eth.messages({latest: -1, from: "e6716f9544a56c530d868e4bfbacb172315bdead"})) + for(var i = 0; i < messages.length; i++) { + var message = messages[i]; + this.insert(0, {num: i, from: message.from, to: message.to, value: eth.numberToHuman(message.value)}) + } } } } |