From 9f4886839fbd3cf4872d721e5be1c1d61bbb64e7 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 15 Aug 2014 13:27:43 +0200 Subject: [PATCH] Moved over to hardcoded v1 of Go QML --- ethereal/debugger.go | 2 +- ethereal/ext_app.go | 2 +- ethereal/gui.go | 2 +- ethereal/html_container.go | 2 +- ethereal/main.go | 41 +++++++++++++++++++++++--------------- ethereal/qml_container.go | 2 +- ethereal/ui_lib.go | 2 +- 7 files changed, 31 insertions(+), 22 deletions(-) diff --git a/ethereal/debugger.go b/ethereal/debugger.go index 56f0b47fc2..b7a7c8c02f 100644 --- a/ethereal/debugger.go +++ b/ethereal/debugger.go @@ -11,7 +11,7 @@ import ( "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethvm" "github.com/ethereum/go-ethereum/utils" - "github.com/go-qml/qml" + "gopkg.in/qml.v1" ) type DebuggerWindow struct { diff --git a/ethereal/ext_app.go b/ethereal/ext_app.go index ad826eaa61..5543b0083f 100644 --- a/ethereal/ext_app.go +++ b/ethereal/ext_app.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/eth-go/ethreact" "github.com/ethereum/eth-go/ethstate" "github.com/ethereum/go-ethereum/javascript" - "github.com/go-qml/qml" + "gopkg.in/qml.v1" ) type AppContainer interface { diff --git a/ethereal/gui.go b/ethereal/gui.go index 5cc305977b..066db48b90 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -18,7 +18,7 @@ import ( "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethwire" "github.com/ethereum/go-ethereum/utils" - "github.com/go-qml/qml" + "gopkg.in/qml.v1" ) var logger = ethlog.NewLogger("GUI") diff --git a/ethereal/html_container.go b/ethereal/html_container.go index bbf77402e4..172fff08e6 100644 --- a/ethereal/html_container.go +++ b/ethereal/html_container.go @@ -14,8 +14,8 @@ import ( "github.com/ethereum/eth-go/ethstate" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/go-ethereum/javascript" - "github.com/go-qml/qml" "github.com/howeyc/fsnotify" + "gopkg.in/qml.v1" ) type HtmlApplication struct { diff --git a/ethereal/main.go b/ethereal/main.go index 431307c6f3..393308d00c 100644 --- a/ethereal/main.go +++ b/ethereal/main.go @@ -4,9 +4,10 @@ import ( "os" "runtime" + "github.com/ethereum/eth-go" "github.com/ethereum/eth-go/ethlog" "github.com/ethereum/go-ethereum/utils" - "github.com/go-qml/qml" + "gopkg.in/qml.v1" ) const ( @@ -14,21 +15,9 @@ const ( Version = "0.6.1" ) -func main() { - runtime.GOMAXPROCS(runtime.NumCPU()) - - // This is a bit of a cheat, but ey! - os.Setenv("QTWEBKIT_INSPECTOR_SERVER", "127.0.0.1:99999") - - qml.Init(nil) - - var interrupted = false - utils.RegisterInterrupt(func(os.Signal) { - interrupted = true - }) - - utils.HandleInterrupt() +var ethereum *eth.Ethereum +func run() error { // precedence: code-internal flag default < config file < environment variables < command line Init() // parsing command line @@ -47,7 +36,7 @@ func main() { clientIdentity := utils.NewClientIdentity(ClientIdentifier, Version, Identifier) - ethereum := utils.NewEthereum(db, clientIdentity, keyManager, UseUPnP, OutboundPort, MaxPeer) + ethereum = utils.NewEthereum(db, clientIdentity, keyManager, UseUPnP, OutboundPort, MaxPeer) if ShowGenesis { utils.ShowGenesis(ethereum) @@ -65,6 +54,26 @@ func main() { utils.StartEthereum(ethereum, UseSeed) // gui blocks the main thread gui.Start(AssetPath) + + return nil +} + +func main() { + runtime.GOMAXPROCS(runtime.NumCPU()) + + // This is a bit of a cheat, but ey! + os.Setenv("QTWEBKIT_INSPECTOR_SERVER", "127.0.0.1:99999") + + //qml.Init(nil) + qml.Run(run) + + var interrupted = false + utils.RegisterInterrupt(func(os.Signal) { + interrupted = true + }) + + utils.HandleInterrupt() + // we need to run the interrupt callbacks in case gui is closed // this skips if we got here by actual interrupt stopping the GUI if !interrupted { diff --git a/ethereal/qml_container.go b/ethereal/qml_container.go index 45a6c03271..babb9ceabb 100644 --- a/ethereal/qml_container.go +++ b/ethereal/qml_container.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethstate" "github.com/ethereum/eth-go/ethutil" - "github.com/go-qml/qml" + "gopkg.in/qml.v1" ) type QmlApplication struct { diff --git a/ethereal/ui_lib.go b/ethereal/ui_lib.go index c48a06547e..9220581cdd 100644 --- a/ethereal/ui_lib.go +++ b/ethereal/ui_lib.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/eth-go/ethpipe" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/go-ethereum/javascript" - "github.com/go-qml/qml" + "gopkg.in/qml.v1" ) type memAddr struct {