Fixed issue in peer window

* Fixed issues where new peer window could cause a crash when entering
  an empty string
This commit is contained in:
obscuren 2015-02-13 17:57:46 +01:00
parent 218f437b0c
commit 790de35e7f
3 changed files with 14 additions and 10 deletions

View File

@ -37,7 +37,7 @@ import (
const ( const (
ClientIdentifier = "Ethereum(G)" ClientIdentifier = "Ethereum(G)"
Version = "0.8.2" Version = "0.8.3"
) )
var clilogger = logger.NewLogger("CLI") var clilogger = logger.NewLogger("CLI")

View File

@ -61,11 +61,11 @@ ApplicationWindow {
function activeView(view, menuItem) { function activeView(view, menuItem) {
mainSplit.setView(view, menuItem) mainSplit.setView(view, menuItem)
if (view.hideUrl) { if (view.hideUrl) {
urlPane.visible = false; //urlPane.visible = false;
mainView.anchors.top = rootView.top //mainView.anchors.top = rootView.top
} else { } else {
urlPane.visible = true; //urlPane.visible = true;
mainView.anchors.top = divider.bottom //mainView.anchors.top = divider.bottom
} }
} }
@ -1069,10 +1069,12 @@ ApplicationWindow {
anchors.rightMargin: 10 anchors.rightMargin: 10
placeholderText: "enode://<hex node id>:<IP address>:<port>" placeholderText: "enode://<hex node id>:<IP address>:<port>"
onAccepted: { onAccepted: {
if(addrField.text.length != 0) {
eth.connectToPeer(addrField.text) eth.connectToPeer(addrField.text)
addPeerWin.visible = false addPeerWin.visible = false
} }
} }
}
Button { Button {
id: addPeerButton id: addPeerButton
@ -1081,10 +1083,12 @@ ApplicationWindow {
anchors.rightMargin: 10 anchors.rightMargin: 10
text: "Connect" text: "Connect"
onClicked: { onClicked: {
eth.connectToPeer(addrField.currentText) if(addrField.text.length != 0) {
eth.connectToPeer(addrField.text)
addPeerWin.visible = false addPeerWin.visible = false
} }
} }
}
Component.onCompleted: { Component.onCompleted: {
addrField.focus = true addrField.focus = true
} }

View File

@ -36,7 +36,7 @@ import (
const ( const (
ClientIdentifier = "Mist" ClientIdentifier = "Mist"
Version = "0.8.2" Version = "0.8.3"
) )
var ethereum *eth.Ethereum var ethereum *eth.Ethereum