Rename and changed peer window

This commit is contained in:
obscuren 2014-09-17 15:58:44 +02:00
parent e4cc365e89
commit 01863ebff0
7 changed files with 56 additions and 17 deletions

View File

@ -19,7 +19,7 @@ ApplicationWindow {
height: 600 height: 600
minimumHeight: 300 minimumHeight: 300
title: "Ether Browser" title: "Mist"
// This signal is used by the filter API. The filter API connects using this signal handler from // This signal is used by the filter API. The filter API connects using this signal handler from
// the different QML files and plugins. // the different QML files and plugins.
@ -853,16 +853,20 @@ ApplicationWindow {
Window { Window {
id: addPeerWin id: addPeerWin
visible: false visible: false
minimumWidth: 230 minimumWidth: 300
maximumWidth: 230 maximumWidth: 300
maximumHeight: 50 maximumHeight: 50
minimumHeight: 50 minimumHeight: 50
title: "Add peer"
/*
TextField { 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.leftMargin: 10 anchors.leftMargin: 10
anchors.rightMargin: 10
placeholderText: "address:port" placeholderText: "address:port"
text: "54.76.56.74:30303" text: "54.76.56.74:30303"
onAccepted: { onAccepted: {
@ -870,13 +874,40 @@ ApplicationWindow {
addPeerWin.visible = false addPeerWin.visible = false
} }
} }
Button { */
anchors.left: addrField.right ComboBox {
id: addrField
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 5 anchors.left: parent.left
anchors.right: addPeerButton.left
anchors.leftMargin: 10
anchors.rightMargin: 10
onAccepted: {
eth.connectToPeer(addrField.currentText)
addPeerWin.visible = false
}
editable: true
model: ListModel { id: pastPeers }
Component.onCompleted: {
var ips = eth.pastPeers()
for(var i = 0; i < ips.length; i++) {
pastPeers.append({text: ips.get(i)})
}
pastPeers.insert(0, {text: "54.76.56.74:30303"})
}
}
Button {
id: addPeerButton
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 10
text: "Add" text: "Add"
onClicked: { onClicked: {
eth.connectToPeer(addrField.text) eth.connectToPeer(addrField.currentText)
addPeerWin.visible = false addPeerWin.visible = false
} }
} }

View File

@ -44,7 +44,7 @@ func defaultAssetPath() string {
// assume a debug build and use the source directory as // assume a debug build and use the source directory as
// asset directory. // asset directory.
pwd, _ := os.Getwd() pwd, _ := os.Getwd()
if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "ethereal") { if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "Mist") {
assetPath = path.Join(pwd, "assets") assetPath = path.Join(pwd, "assets")
} else { } else {
switch runtime.GOOS { switch runtime.GOOS {
@ -53,7 +53,7 @@ func defaultAssetPath() string {
exedir, _ := osext.ExecutableFolder() exedir, _ := osext.ExecutableFolder()
assetPath = filepath.Join(exedir, "../Resources") assetPath = filepath.Join(exedir, "../Resources")
case "linux": case "linux":
assetPath = "/usr/share/ethereal" assetPath = "/usr/share/mist"
case "windows": case "windows":
assetPath = "./assets" assetPath = "./assets"
default: default:
@ -64,7 +64,7 @@ func defaultAssetPath() string {
} }
func defaultDataDir() string { func defaultDataDir() string {
usr, _ := user.Current() usr, _ := user.Current()
return path.Join(usr.HomeDir, ".ethereal") return path.Join(usr.HomeDir, ".mist")
} }
var defaultConfigFile = path.Join(defaultDataDir(), "conf.ini") var defaultConfigFile = path.Join(defaultDataDir(), "conf.ini")

View File

@ -491,7 +491,9 @@ func (gui *Gui) setStatsPane() {
runtime.ReadMemStats(&memStats) runtime.ReadMemStats(&memStats)
statsPane := gui.getObjectByName("statsPane") statsPane := gui.getObjectByName("statsPane")
statsPane.Set("text", fmt.Sprintf(`###### Ethereal 0.6.4 (%s) ####### statsPane.Set("text", fmt.Sprintf(`###### Mist 0.6.4 (%s) #######
eth %d (p2p = %d)
CPU: # %d CPU: # %d
Goroutines: # %d Goroutines: # %d
@ -502,7 +504,9 @@ Heap Alloc: %d
CGNext: %x CGNext: %x
NumGC: %d NumGC: %d
`, runtime.Version(), runtime.NumCPU, runtime.NumGoroutine(), runtime.NumCgoCall(), `, runtime.Version(),
eth.ProtocolVersion, eth.P2PVersion,
runtime.NumCPU, runtime.NumGoroutine(), runtime.NumCgoCall(),
memStats.Alloc, memStats.HeapAlloc, memStats.Alloc, memStats.HeapAlloc,
memStats.NextGC, memStats.NumGC, memStats.NextGC, memStats.NumGC,
)) ))

View File

@ -11,8 +11,8 @@ import (
) )
const ( const (
ClientIdentifier = "Ethereal" ClientIdentifier = "Mist"
Version = "0.6.6" Version = "0.6.7"
) )
var ethereum *eth.Ethereum var ethereum *eth.Ethereum

View File

@ -72,6 +72,10 @@ func (self *UiLib) LookupDomain(domain string) string {
} }
} }
func (self *UiLib) PastPeers() *ethutil.List {
return ethutil.NewList(eth.PastPeers())
}
func (self *UiLib) ImportTx(rlpTx string) { func (self *UiLib) ImportTx(rlpTx string) {
tx := ethchain.NewTransactionFromBytes(ethutil.Hex2Bytes(rlpTx)) tx := ethchain.NewTransactionFromBytes(ethutil.Hex2Bytes(rlpTx))
self.eth.TxPool().QueueTransaction(tx) self.eth.TxPool().QueueTransaction(tx)

View File

@ -42,7 +42,7 @@ func (jsre *JSRE) LoadExtFile(path string) {
} }
func (jsre *JSRE) LoadIntFile(file string) { func (jsre *JSRE) LoadIntFile(file string) {
assetPath := path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "ethereal", "assets", "ext") assetPath := path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "Mist", "assets", "ext")
jsre.LoadExtFile(path.Join(assetPath, file)) jsre.LoadExtFile(path.Join(assetPath, file))
} }

View File

@ -189,7 +189,7 @@ func DefaultAssetPath() string {
// assume a debug build and use the source directory as // assume a debug build and use the source directory as
// asset directory. // asset directory.
pwd, _ := os.Getwd() pwd, _ := os.Getwd()
if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "ethereal") { if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "Mist") {
assetPath = path.Join(pwd, "assets") assetPath = path.Join(pwd, "assets")
} else { } else {
switch runtime.GOOS { switch runtime.GOOS {
@ -198,7 +198,7 @@ func DefaultAssetPath() string {
exedir, _ := osext.ExecutableFolder() exedir, _ := osext.ExecutableFolder()
assetPath = filepath.Join(exedir, "../Resources") assetPath = filepath.Join(exedir, "../Resources")
case "linux": case "linux":
assetPath = "/usr/share/ethereal" assetPath = "/usr/share/mist"
case "windows": case "windows":
assetPath = "./assets" assetPath = "./assets"
default: default: