|
|
@ -38,6 +38,7 @@ import ( |
|
|
|
"github.com/ethereum/go-ethereum/logger" |
|
|
|
"github.com/ethereum/go-ethereum/logger" |
|
|
|
"github.com/ethereum/go-ethereum/miner" |
|
|
|
"github.com/ethereum/go-ethereum/miner" |
|
|
|
"github.com/ethereum/go-ethereum/p2p" |
|
|
|
"github.com/ethereum/go-ethereum/p2p" |
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/ui/qt/qwhisper" |
|
|
|
"github.com/ethereum/go-ethereum/xeth" |
|
|
|
"github.com/ethereum/go-ethereum/xeth" |
|
|
|
"gopkg.in/qml.v1" |
|
|
|
"gopkg.in/qml.v1" |
|
|
|
) |
|
|
|
) |
|
|
@ -88,6 +89,7 @@ type Gui struct { |
|
|
|
|
|
|
|
|
|
|
|
// The public Ethereum library
|
|
|
|
// The public Ethereum library
|
|
|
|
uiLib *UiLib |
|
|
|
uiLib *UiLib |
|
|
|
|
|
|
|
whisper *qwhisper.Whisper |
|
|
|
|
|
|
|
|
|
|
|
txDb *ethdb.LDBDatabase |
|
|
|
txDb *ethdb.LDBDatabase |
|
|
|
|
|
|
|
|
|
|
@ -138,10 +140,12 @@ func (gui *Gui) Start(assetPath string) { |
|
|
|
gui.engine = qml.NewEngine() |
|
|
|
gui.engine = qml.NewEngine() |
|
|
|
context := gui.engine.Context() |
|
|
|
context := gui.engine.Context() |
|
|
|
gui.uiLib = NewUiLib(gui.engine, gui.eth, assetPath) |
|
|
|
gui.uiLib = NewUiLib(gui.engine, gui.eth, assetPath) |
|
|
|
|
|
|
|
gui.whisper = qwhisper.New(gui.eth.Whisper()) |
|
|
|
|
|
|
|
|
|
|
|
// Expose the eth library and the ui library to QML
|
|
|
|
// Expose the eth library and the ui library to QML
|
|
|
|
context.SetVar("gui", gui) |
|
|
|
context.SetVar("gui", gui) |
|
|
|
context.SetVar("eth", gui.uiLib) |
|
|
|
context.SetVar("eth", gui.uiLib) |
|
|
|
|
|
|
|
context.SetVar("shh", gui.whisper) |
|
|
|
|
|
|
|
|
|
|
|
// Load the main QML interface
|
|
|
|
// Load the main QML interface
|
|
|
|
data, _ := ethutil.Config.Db.Get([]byte("KeyRing")) |
|
|
|
data, _ := ethutil.Config.Db.Get([]byte("KeyRing")) |
|
|
@ -391,6 +395,8 @@ func (gui *Gui) update() { |
|
|
|
gui.setPeerInfo() |
|
|
|
gui.setPeerInfo() |
|
|
|
}() |
|
|
|
}() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gui.whisper.SetView(gui.win.Root().ObjectByName("whisperView")) |
|
|
|
|
|
|
|
|
|
|
|
for _, plugin := range gui.plugins { |
|
|
|
for _, plugin := range gui.plugins { |
|
|
|
guilogger.Infoln("Loading plugin ", plugin.Name) |
|
|
|
guilogger.Infoln("Loading plugin ", plugin.Name) |
|
|
|
|
|
|
|
|
|
|
|