aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/main.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-15 19:27:43 +0800
committerobscuren <geffobscura@gmail.com>2014-08-15 19:27:43 +0800
commit9f4886839fbd3cf4872d721e5be1c1d61bbb64e7 (patch)
treee2b84b8ae13eae85f17c6885f787e72d3316872f /ethereal/main.go
parentdf0c43265e400c3a751ffdcad51e8cfff8b320c7 (diff)
downloadgo-tangerine-9f4886839fbd3cf4872d721e5be1c1d61bbb64e7.tar.gz
go-tangerine-9f4886839fbd3cf4872d721e5be1c1d61bbb64e7.tar.zst
go-tangerine-9f4886839fbd3cf4872d721e5be1c1d61bbb64e7.zip
Moved over to hardcoded v1 of Go QML
Diffstat (limited to 'ethereal/main.go')
-rw-r--r--ethereal/main.go41
1 files changed, 25 insertions, 16 deletions
diff --git a/ethereal/main.go b/ethereal/main.go
index 431307c6f..393308d00 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 {