Updated xeth instances to take extra param for ui.Interface

Please be aware that if any of the instances on xeth.frontend are called
the program will crash due to the default, temporarily, frontend
interface.
This commit is contained in:
obscuren
2015-03-09 13:50:05 +01:00
parent 738d6e20f2
commit 20741a96ac
6 changed files with 5 additions and 153 deletions

View File

@ -58,7 +58,7 @@ type UiLib struct {
}
func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib {
x := xeth.New(eth)
x := xeth.New(eth, nil)
lib := &UiLib{XEth: x, engine: engine, eth: eth, assetPath: assetPath, jsEngine: javascript.NewJSRE(x), filterCallbacks: make(map[int][]int)} //, filters: make(map[int]*xeth.JSFilter)}
lib.filterManager = filter.NewFilterManager(eth.EventMux())
go lib.filterManager.Start()
@ -91,24 +91,6 @@ func (self *UiLib) EvalJavascriptString(str string) string {
return fmt.Sprintf("%v", value)
}
func (ui *UiLib) OpenQml(path string) {
container := NewQmlApplication(path[7:], ui)
app := NewExtApplication(container, ui)
go app.run()
}
func (ui *UiLib) OpenHtml(path string) {
container := NewHtmlApplication(path, ui)
app := NewExtApplication(container, ui)
go app.run()
}
func (ui *UiLib) OpenBrowser() {
ui.OpenHtml("file://" + ui.AssetPath("ext/home.html"))
}
func (ui *UiLib) Muted(content string) {
component, err := ui.engine.LoadFile(ui.AssetPath("qml/muted.qml"))
if err != nil {