Added whisper debug interface + whisper fixes

This commit is contained in:
obscuren
2014-12-15 17:14:02 +01:00
parent 993280ec03
commit 01a6db9324
6 changed files with 32 additions and 28 deletions

View File

@ -50,6 +50,7 @@ ApplicationWindow {
addPlugin("./views/miner.qml", {noAdd: true, close: false, section: "ethereum", active: true});
addPlugin("./views/transaction.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/whisper.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/chain.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/pending_tx.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/info.qml", {noAdd: true, close: false, section: "legacy"});

View File

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

View File

@ -377,6 +377,10 @@ func (self *UiLib) ToggleMining() bool {
}
}
func (self *UiLib) ToHex(data string) string {
return "0x" + ethutil.Bytes2Hex([]byte(data))
}
/*
// XXX Refactor me & MOVE
func (self *Ethereum) InstallFilter(filter *core.Filter) (id int) {