diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-12 18:16:21 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-12 18:16:21 +0800 |
commit | 59d9746849e9ba794a190b04d3d9f444321b82b8 (patch) | |
tree | be6c4370000085fdec4cd378cf07d35c18d6c00f /ethereal/ui_lib.go | |
parent | 2e2f23a0aef637b8b43362bb8a2dba16d5c02c25 (diff) | |
download | go-tangerine-59d9746849e9ba794a190b04d3d9f444321b82b8.tar go-tangerine-59d9746849e9ba794a190b04d3d9f444321b82b8.tar.gz go-tangerine-59d9746849e9ba794a190b04d3d9f444321b82b8.tar.bz2 go-tangerine-59d9746849e9ba794a190b04d3d9f444321b82b8.tar.lz go-tangerine-59d9746849e9ba794a190b04d3d9f444321b82b8.tar.xz go-tangerine-59d9746849e9ba794a190b04d3d9f444321b82b8.tar.zst go-tangerine-59d9746849e9ba794a190b04d3d9f444321b82b8.zip |
Changed naming on exposed QML variables
Diffstat (limited to 'ethereal/ui_lib.go')
-rw-r--r-- | ethereal/ui_lib.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ethereal/ui_lib.go b/ethereal/ui_lib.go index 42c5c9ad2..1d9085fcb 100644 --- a/ethereal/ui_lib.go +++ b/ethereal/ui_lib.go @@ -4,7 +4,9 @@ import ( "path" "github.com/ethereum/eth-go" + "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethutil" + "github.com/ethereum/go-ethereum/javascript" "github.com/go-qml/qml" ) @@ -23,10 +25,21 @@ type UiLib struct { win *qml.Window Db *Debugger DbWindow *DebuggerWindow + + jsEngine *javascript.JSRE } func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib { - return &UiLib{engine: engine, eth: eth, assetPath: assetPath} + return &UiLib{engine: engine, eth: eth, assetPath: assetPath, jsEngine: javascript.NewJSRE(eth)} +} + +func (self *UiLib) ImportTx(rlpTx string) { + tx := ethchain.NewTransactionFromBytes(ethutil.Hex2Bytes(rlpTx)) + self.eth.TxPool().QueueTransaction(tx) +} + +func (self *UiLib) EvalJavascriptFile(path string) { + self.jsEngine.LoadExtFile(path[7:]) } func (ui *UiLib) OpenQml(path string) { |