diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-16 00:14:02 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-16 00:14:02 +0800 |
commit | 01a6db93241a01e98a0467b628423c9b5b1361cb (patch) | |
tree | defc185c17bd88e32c021748ba7a19748496dac7 /cmd/mist | |
parent | 993280ec03a8bd8e108da7e222c98efa8482084b (diff) | |
download | go-tangerine-01a6db93241a01e98a0467b628423c9b5b1361cb.tar.gz go-tangerine-01a6db93241a01e98a0467b628423c9b5b1361cb.tar.zst go-tangerine-01a6db93241a01e98a0467b628423c9b5b1361cb.zip |
Added whisper debug interface + whisper fixes
Diffstat (limited to 'cmd/mist')
-rw-r--r-- | cmd/mist/assets/qml/main.qml | 1 | ||||
-rw-r--r-- | cmd/mist/gui.go | 8 | ||||
-rw-r--r-- | cmd/mist/ui_lib.go | 4 |
3 files changed, 12 insertions, 1 deletions
diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 9f1f214a6..285757080 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -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"}); diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go index 40499ad7f..ba031e6c3 100644 --- a/cmd/mist/gui.go +++ b/cmd/mist/gui.go @@ -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) diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go index d34b527ce..68f333563 100644 --- a/cmd/mist/ui_lib.go +++ b/cmd/mist/ui_lib.go @@ -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) { |