Updated window

This commit is contained in:
obscuren 2015-02-13 17:30:37 +01:00
parent 7336dfad02
commit 218f437b0c
1 changed files with 6 additions and 20 deletions

View File

@ -1054,38 +1054,24 @@ ApplicationWindow {
Window { Window {
id: addPeerWin id: addPeerWin
visible: false visible: false
minimumWidth: 300 minimumWidth: 400
maximumWidth: 300 maximumWidth: 400
maximumHeight: 50 maximumHeight: 50
minimumHeight: 50 minimumHeight: 50
title: "Connect to peer" title: "Connect to peer"
ComboBox { TextField {
id: addrField id: addrField
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
anchors.right: addPeerButton.left anchors.right: addPeerButton.left
anchors.leftMargin: 10 anchors.leftMargin: 10
anchors.rightMargin: 10 anchors.rightMargin: 10
placeholderText: "enode://<hex node id>:<IP address>:<port>"
onAccepted: { onAccepted: {
eth.connectToPeer(addrField.currentText) eth.connectToPeer(addrField.text)
addPeerWin.visible = false addPeerWin.visible = false
} }
editable: true
model: ListModel { id: pastPeers }
Component.onCompleted: {
pastPeers.insert(0, {text: "poc-8.ethdev.com:30303"})
/*
var ips = eth.pastPeers()
for(var i = 0; i < ips.length; i++) {
pastPeers.append({text: ips.get(i)})
}
pastPeers.insert(0, {text: "poc-7.ethdev.com:30303"})
*/
}
} }
Button { Button {
@ -1093,7 +1079,7 @@ ApplicationWindow {
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 10 anchors.rightMargin: 10
text: "Add" text: "Connect"
onClicked: { onClicked: {
eth.connectToPeer(addrField.currentText) eth.connectToPeer(addrField.currentText)
addPeerWin.visible = false addPeerWin.visible = false