aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/gui.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-11 22:24:35 +0800
committerobscuren <geffobscura@gmail.com>2014-08-11 22:24:35 +0800
commitc59d7a899b0ca121b3f982fa12405629109f1b47 (patch)
tree1859ac54e0f9948927287caeae863b730eb1fbd9 /ethereal/gui.go
parentce8f24e57a3ba31d17c34db284bd3d9efa15e7d8 (diff)
downloadgo-tangerine-c59d7a899b0ca121b3f982fa12405629109f1b47.tar
go-tangerine-c59d7a899b0ca121b3f982fa12405629109f1b47.tar.gz
go-tangerine-c59d7a899b0ca121b3f982fa12405629109f1b47.tar.bz2
go-tangerine-c59d7a899b0ca121b3f982fa12405629109f1b47.tar.lz
go-tangerine-c59d7a899b0ca121b3f982fa12405629109f1b47.tar.xz
go-tangerine-c59d7a899b0ca121b3f982fa12405629109f1b47.tar.zst
go-tangerine-c59d7a899b0ca121b3f982fa12405629109f1b47.zip
Added open js option for repetitive tasks in ethereal
Diffstat (limited to 'ethereal/gui.go')
-rw-r--r--ethereal/gui.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/ethereal/gui.go b/ethereal/gui.go
index 36e147ba9..d2363b5a9 100644
--- a/ethereal/gui.go
+++ b/ethereal/gui.go
@@ -18,6 +18,7 @@ import (
"github.com/ethereum/eth-go/ethreact"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
+ "github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/utils"
"github.com/go-qml/qml"
)
@@ -47,6 +48,8 @@ type Gui struct {
config *ethutil.ConfigManager
miner *ethminer.Miner
+
+ jsEngine *javascript.JSRE
}
// Create GUI, but doesn't start it
@@ -58,7 +61,7 @@ func NewWindow(ethereum *eth.Ethereum, config *ethutil.ConfigManager, clientIden
pub := ethpub.NewPEthereum(ethereum)
- return &Gui{eth: ethereum, txDb: db, pub: pub, logLevel: ethlog.LogLevel(logLevel), Session: session, open: false, clientIdentity: clientIdentity, config: config}
+ return &Gui{eth: ethereum, txDb: db, pub: pub, logLevel: ethlog.LogLevel(logLevel), Session: session, open: false, clientIdentity: clientIdentity, config: config, jsEngine: javascript.NewJSRE(ethereum)}
}
func (gui *Gui) Start(assetPath string) {
@@ -121,6 +124,9 @@ func (gui *Gui) Stop() {
gui.open = false
gui.win.Hide()
}
+
+ gui.jsEngine.Stop()
+
logger.Infoln("Stopped")
}
@@ -464,6 +470,13 @@ func (self *Gui) ImportTx(rlpTx string) {
self.eth.TxPool().QueueTransaction(tx)
}
+func (self *Gui) SearchChange(blockHash, address, storageAddress string) {
+}
+
+func (self *Gui) EvalJavascriptFile(path string) {
+ self.jsEngine.LoadExtFile(path[7:])
+}
+
func (gui *Gui) SetCustomIdentifier(customIdentifier string) {
gui.clientIdentity.SetCustomIdentifier(customIdentifier)
gui.config.Save("id", customIdentifier)