aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/assets/qml/views
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-18 07:35:42 +0800
committerobscuren <geffobscura@gmail.com>2014-08-18 07:35:42 +0800
commita8409b0a8bfa7f8434ede495094fd8d892c28c91 (patch)
treef9ed41441280ad919da8be7d82a522209c30995b /ethereal/assets/qml/views
parent5ae3deea86a4916eee07b30195da280957e2fd2f (diff)
downloaddexon-a8409b0a8bfa7f8434ede495094fd8d892c28c91.tar
dexon-a8409b0a8bfa7f8434ede495094fd8d892c28c91.tar.gz
dexon-a8409b0a8bfa7f8434ede495094fd8d892c28c91.tar.bz2
dexon-a8409b0a8bfa7f8434ede495094fd8d892c28c91.tar.lz
dexon-a8409b0a8bfa7f8434ede495094fd8d892c28c91.tar.xz
dexon-a8409b0a8bfa7f8434ede495094fd8d892c28c91.tar.zst
dexon-a8409b0a8bfa7f8434ede495094fd8d892c28c91.zip
Implementing new wallet views
Diffstat (limited to 'ethereal/assets/qml/views')
-rw-r--r--ethereal/assets/qml/views/history.qml7
-rw-r--r--ethereal/assets/qml/views/info.qml2
-rw-r--r--ethereal/assets/qml/views/wallet.qml63
3 files changed, 68 insertions, 4 deletions
diff --git a/ethereal/assets/qml/views/history.qml b/ethereal/assets/qml/views/history.qml
index 94ea29e61..d8c932f8f 100644
--- a/ethereal/assets/qml/views/history.qml
+++ b/ethereal/assets/qml/views/history.qml
@@ -11,14 +11,15 @@ Rectangle {
property var title: "Transactions"
property var menuItem
- property var txModel: ListModel {
- id: txModel
- }
id: historyView
+ visible: false
anchors.fill: parent
objectName: "transactionView"
+ property var txModel: ListModel {
+ id: txModel
+ }
TableView {
id: txTableView
anchors.fill: parent
diff --git a/ethereal/assets/qml/views/info.qml b/ethereal/assets/qml/views/info.qml
index c12977cbe..c4486aa6c 100644
--- a/ethereal/assets/qml/views/info.qml
+++ b/ethereal/assets/qml/views/info.qml
@@ -29,7 +29,7 @@ Rectangle {
text: "Address"
}
TextField {
- text: eth.getKey().address
+ text: eth.key().address
width: 500
}
diff --git a/ethereal/assets/qml/views/wallet.qml b/ethereal/assets/qml/views/wallet.qml
new file mode 100644
index 000000000..22b09640b
--- /dev/null
+++ b/ethereal/assets/qml/views/wallet.qml
@@ -0,0 +1,63 @@
+import QtQuick 2.0
+import QtQuick.Controls 1.0;
+import QtQuick.Layouts 1.0;
+import QtQuick.Dialogs 1.0;
+import QtQuick.Window 2.1;
+import QtQuick.Controls.Styles 1.1
+import Ethereum 1.0
+
+Rectangle {
+ id: root
+ property var title: "Wallet"
+ property var iconFile: "../wallet.png"
+ property var menuItem
+
+ objectName: "walletView"
+ anchors.fill: parent
+
+ function onReady() {
+ menuItem.secondary = eth.numberToHuman(eth.balanceAt(eth.key().address))
+
+ }
+
+ ColumnLayout {
+ spacing: 10
+ y: 40
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+
+ Text {
+ text: "<b>Balance</b>: " + eth.numberToHuman(eth.balanceAt(eth.key().address))
+ font.pixelSize: 24
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ TableView {
+ id: txTableView
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ 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)})
+ }
+ }
+ }
+ }
+
+ }
+}