aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/ui/ui_lib.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-03-27 22:24:56 +0800
committerobscuren <geffobscura@gmail.com>2014-03-27 22:24:56 +0800
commit1257e8b4b30293784d24011ab6f9d8b4498ecfa4 (patch)
tree779f8dd12e7a58b2025d5d55431fdccf966756db /ethereal/ui/ui_lib.go
parente65c4ee93e9dad629997c7839df7a8a0e7cff353 (diff)
parent1323f60c074297c97397d20dd275124da2f5b531 (diff)
downloadgo-tangerine-1257e8b4b30293784d24011ab6f9d8b4498ecfa4.tar
go-tangerine-1257e8b4b30293784d24011ab6f9d8b4498ecfa4.tar.gz
go-tangerine-1257e8b4b30293784d24011ab6f9d8b4498ecfa4.tar.bz2
go-tangerine-1257e8b4b30293784d24011ab6f9d8b4498ecfa4.tar.lz
go-tangerine-1257e8b4b30293784d24011ab6f9d8b4498ecfa4.tar.xz
go-tangerine-1257e8b4b30293784d24011ab6f9d8b4498ecfa4.tar.zst
go-tangerine-1257e8b4b30293784d24011ab6f9d8b4498ecfa4.zip
Merge branch 'master' into develop
Diffstat (limited to 'ethereal/ui/ui_lib.go')
-rw-r--r--ethereal/ui/ui_lib.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/ethereal/ui/ui_lib.go b/ethereal/ui/ui_lib.go
index 3997191fa..4441a7238 100644
--- a/ethereal/ui/ui_lib.go
+++ b/ethereal/ui/ui_lib.go
@@ -16,6 +16,14 @@ type UiLib struct {
engine *qml.Engine
eth *eth.Ethereum
connected bool
+ assetPath string
+}
+
+func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib {
+ if assetPath == "" {
+ assetPath = DefaultAssetPath()
+ }
+ return &UiLib{engine: engine, eth: eth, assetPath: assetPath}
}
// Opens a QML file (external application)
@@ -45,10 +53,10 @@ func (ui *UiLib) ConnectToPeer(addr string) {
}
func (ui *UiLib) AssetPath(p string) string {
- return AssetPath(p)
+ return path.Join(ui.assetPath, p)
}
-func AssetPath(p string) string {
+func DefaultAssetPath() string {
var base string
// If the current working directory is the go-ethereum dir
@@ -72,5 +80,5 @@ func AssetPath(p string) string {
}
}
- return path.Join(base, p)
+ return base
}