aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/assets/qml/wallet.qml
diff options
context:
space:
mode:
Diffstat (limited to 'ethereal/assets/qml/wallet.qml')
-rw-r--r--ethereal/assets/qml/wallet.qml78
1 files changed, 75 insertions, 3 deletions
diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml
index bbb147d89..fece8e7d6 100644
--- a/ethereal/assets/qml/wallet.qml
+++ b/ethereal/assets/qml/wallet.qml
@@ -45,6 +45,13 @@ ApplicationWindow {
addPeerWin.visible = true
}
}
+ MenuItem {
+ text: "Show Peers"
+ shortcut: "Ctrl+e"
+ onTriggered: {
+ peerWindow.visible = true
+ }
+ }
}
Menu {
@@ -247,13 +254,12 @@ ApplicationWindow {
}
}
-
property var addressModel: ListModel {
id: addressModel
}
TableView {
id: addressView
- width: parent.width
+ width: parent.width - 200
height: 200
anchors.bottom: logView.top
TableViewColumn{ role: "name"; title: "name" }
@@ -262,6 +268,30 @@ ApplicationWindow {
model: addressModel
}
+ Rectangle {
+ anchors.top: addressView.top
+ anchors.left: addressView.right
+ anchors.leftMargin: 20
+
+ TextField {
+ placeholderText: "Name to register"
+ id: nameToReg
+ width: 150
+ }
+
+ Button {
+ anchors.top: nameToReg.bottom
+ text: "Register"
+ MouseArea{
+ anchors.fill: parent
+ onClicked: {
+ eth.registerName(nameToReg.text)
+ nameToReg.text = ""
+ }
+ }
+ }
+ }
+
property var logModel: ListModel {
id: logModel
@@ -359,6 +389,10 @@ ApplicationWindow {
id: peerImage
anchors.right: parent.right
width: 10; height: 10
+ MouseArea {
+ onDoubleClicked: peerWindow.visible = true
+ anchors.fill: parent
+ }
source: ui.assetPath("network.png")
}
}
@@ -623,6 +657,20 @@ ApplicationWindow {
function setPeers(text) {
peerLabel.text = text
}
+
+ function addPeer(peer) {
+ // We could just append the whole peer object but it cries if you try to alter them
+ peerModel.append({ip: peer.ip, port: peer.port, lastResponse:timeAgo(peer.lastSend), latency: peer.latency, version: peer.version})
+ }
+
+ function resetPeers(){
+ peerModel.clear()
+ }
+
+ function timeAgo(unixTs){
+ var lapsed = (Date.now() - new Date(unixTs*1000)) / 1000
+ return (lapsed + " seconds ago")
+ }
function convertToPretty(unixTs){
var a = new Date(unixTs*1000);
var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
@@ -635,6 +683,31 @@ ApplicationWindow {
var time = date+' '+month+' '+year+' '+hour+':'+min+':'+sec ;
return time;
}
+ // ******************************************
+ // Windows
+ // ******************************************
+ Window {
+ id: peerWindow
+ height: 200
+ width: 700
+ Rectangle {
+ anchors.fill: parent
+ property var peerModel: ListModel {
+ id: peerModel
+ }
+ TableView {
+ anchors.fill: parent
+ id: peerTable
+ model: peerModel
+ TableViewColumn{width: 100; role: "ip" ; title: "IP" }
+ TableViewColumn{width: 60; role: "port" ; title: "Port" }
+ TableViewColumn{width: 140; role: "lastResponse"; title: "Last event" }
+ TableViewColumn{width: 100; role: "latency"; title: "Latency" }
+ TableViewColumn{width: 260; role: "version" ; title: "Version" }
+ }
+ }
+ }
+
// *******************************************
// Components
// *******************************************
@@ -810,7 +883,6 @@ ApplicationWindow {
}
}
}
-
// New Transaction component
Component {
id: newTransaction