diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-22 08:52:47 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-22 08:52:47 +0800 |
commit | 2b967558cebcef9d3ef9719cbb28a5e596982a5d (patch) | |
tree | e0b45a4d2123c70a9f6216ffb0a493018b06154c /wallet.qml | |
parent | 3e8b27c9dc78ffeeefae987e67730fae17707df4 (diff) | |
download | go-tangerine-2b967558cebcef9d3ef9719cbb28a5e596982a5d.tar.gz go-tangerine-2b967558cebcef9d3ef9719cbb28a5e596982a5d.tar.zst go-tangerine-2b967558cebcef9d3ef9719cbb28a5e596982a5d.zip |
Working out UI
Diffstat (limited to 'wallet.qml')
-rw-r--r-- | wallet.qml | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/wallet.qml b/wallet.qml index f9bd8ec76..e6cb32b18 100644 --- a/wallet.qml +++ b/wallet.qml @@ -2,6 +2,7 @@ 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 GoExtensions 1.0 ApplicationWindow { @@ -60,20 +61,36 @@ ApplicationWindow { } TableView { + id: blockTable width: parent.width - height: 100 - anchors.bottom: parent.bottom anchors.top: splitView.bottom + anchors.bottom: logView.top TableViewColumn{ role: "number" ; title: "#" ; width: 100 } TableViewColumn{ role: "hash" ; title: "Hash" ; width: 560 } model: blockModel onDoubleClicked: { - console.log(eth.getBlock(blockModel.get(row).hash)) + popup.visible = true + popup.block = eth.getBlock(blockModel.get(row).hash) + popup.hashLabel.text = popup.block.hash } } + property var logModel: ListModel { + id: logModel + } + + TableView { + id: logView + width: parent.width + height: 150 + anchors.bottom: parent.bottom + TableViewColumn{ role: "description" ; title: "log" } + + model: logModel + } + FileDialog { id: openAppDialog title: "Open QML Application" @@ -86,6 +103,13 @@ ApplicationWindow { RowLayout { anchors.fill: parent Button { + id: connectButton + onClicked: ui.connect() + text: "Connect" + } + Button { + anchors.left: connectButton.right + anchors.leftMargin: 5 onClicked: openAppDialog.open() text: "Import App" } @@ -107,10 +131,26 @@ ApplicationWindow { } } + Window { + id: popup + visible: false + property var block + Label { + id: hashLabel + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + } + } + function addBlock(block) { blockModel.insert(0, {number: block.number, hash: block.hash}) } + function addLog(str) { + console.log(str) + logModel.insert(0, {description: str}) + } + function setPeers(text) { peerLabel.text = text } |