Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop

pull/109/merge
obscuren 10 years ago
commit c302afd411
  1. 3
      ethereal/assets/qml/webapp.qml
  2. 2
      ethereal/flags.go
  3. 7
      ethereal/html_container.go
  4. 30
      utils/cmd.go

@ -191,6 +191,7 @@ ApplicationWindow {
inspector.visible = false inspector.visible = false
}else{ }else{
inspector.visible = true inspector.visible = true
inspector.url = webview.experimental.remoteInspectorUrl
} }
} }
onDoubleClicked: { onDoubleClicked: {
@ -224,7 +225,6 @@ ApplicationWindow {
WebView { WebView {
id: inspector id: inspector
visible: false visible: false
url: webview.experimental.remoteInspectorUrl
anchors { anchors {
left: root.left left: root.left
right: root.right right: root.right
@ -238,7 +238,6 @@ ApplicationWindow {
name: "inspectorShown" name: "inspectorShown"
PropertyChanges { PropertyChanges {
target: inspector target: inspector
url: webview.experimental.remoteInspectorUrl
} }
} }
] ]

@ -36,6 +36,7 @@ var LogLevel int
// flags specific to gui client // flags specific to gui client
var AssetPath string var AssetPath string
//TODO: If we re-use the one defined in cmd.go the binary osx image crashes. If somebody finds out why we can dry this up.
func defaultAssetPath() string { func defaultAssetPath() string {
var assetPath string var assetPath string
// If the current working directory is the go-ethereum dir // If the current working directory is the go-ethereum dir
@ -60,7 +61,6 @@ func defaultAssetPath() string {
} }
return assetPath return assetPath
} }
func defaultDataDir() string { func defaultDataDir() string {
usr, _ := user.Current() usr, _ := user.Current()
return path.Join(usr.HomeDir, ".ethereal") return path.Join(usr.HomeDir, ".ethereal")

@ -8,7 +8,6 @@ import (
"github.com/go-qml/qml" "github.com/go-qml/qml"
"github.com/howeyc/fsnotify" "github.com/howeyc/fsnotify"
"io/ioutil" "io/ioutil"
"log"
"net/url" "net/url"
"os" "os"
"path" "path"
@ -59,7 +58,7 @@ func (app *HtmlApplication) RootFolder() string {
if err != nil { if err != nil {
return "" return ""
} }
return path.Dir(folder.RequestURI()) return path.Dir(ethutil.WindonizePath(folder.RequestURI()))
} }
func (app *HtmlApplication) RecursiveFolders() []os.FileInfo { func (app *HtmlApplication) RecursiveFolders() []os.FileInfo {
files, _ := ioutil.ReadDir(app.RootFolder()) files, _ := ioutil.ReadDir(app.RootFolder())
@ -77,11 +76,13 @@ func (app *HtmlApplication) NewWatcher(quitChan chan bool) {
app.watcher, err = fsnotify.NewWatcher() app.watcher, err = fsnotify.NewWatcher()
if err != nil { if err != nil {
logger.Infoln("Could not create new auto-reload watcher:", err)
return return
} }
err = app.watcher.Watch(app.RootFolder()) err = app.watcher.Watch(app.RootFolder())
if err != nil { if err != nil {
log.Fatal(err) logger.Infoln("Could not start auto-reload watcher:", err)
return
} }
for _, folder := range app.RecursiveFolders() { for _, folder := range app.RecursiveFolders() {
fullPath := app.RootFolder() + "/" + folder.Name() fullPath := app.RootFolder() + "/" + folder.Name()

@ -1,6 +1,7 @@
package utils package utils
import ( import (
"bitbucket.org/kardianos/osext"
"fmt" "fmt"
"github.com/ethereum/eth-go" "github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethcrypto" "github.com/ethereum/eth-go/ethcrypto"
@ -16,6 +17,8 @@ import (
"os" "os"
"os/signal" "os/signal"
"path" "path"
"path/filepath"
"runtime"
"time" "time"
) )
@ -164,7 +167,34 @@ func NewKeyManager(KeyStore string, Datadir string, db ethutil.Database) *ethcry
return keyManager return keyManager
} }
func DefaultAssetPath() string {
var assetPath string
// If the current working directory is the go-ethereum dir
// assume a debug build and use the source directory as
// asset directory.
pwd, _ := os.Getwd()
if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "ethereal") {
assetPath = path.Join(pwd, "assets")
} else {
switch runtime.GOOS {
case "darwin":
// Get Binary Directory
exedir, _ := osext.ExecutableFolder()
assetPath = filepath.Join(exedir, "../Resources")
case "linux":
assetPath = "/usr/share/ethereal"
case "windows":
assetPath = "./assets"
default:
assetPath = "."
}
}
return assetPath
}
func KeyTasks(keyManager *ethcrypto.KeyManager, KeyRing string, GenAddr bool, SecretFile string, ExportDir string, NonInteractive bool) { func KeyTasks(keyManager *ethcrypto.KeyManager, KeyRing string, GenAddr bool, SecretFile string, ExportDir string, NonInteractive bool) {
ethcrypto.InitWords(DefaultAssetPath()) // Init mnemonic word list
var err error var err error
switch { switch {
case GenAddr: case GenAddr:

Loading…
Cancel
Save