From 79259c916ddb7fb9bbd2515dabb84b4f9025b4e3 Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 8 Jul 2014 14:05:42 +0200 Subject: [PATCH 1/6] Use relative image paths to help with windows builds --- ethereal/assets/qml/wallet.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml index 4b252f2009..33e1cc24c6 100644 --- a/ethereal/assets/qml/wallet.qml +++ b/ethereal/assets/qml/wallet.qml @@ -100,7 +100,7 @@ ApplicationWindow { anchors.right: parent.right height: 200 Image { - source: ui.assetPath("tx.png") + source: "../tx.png" anchors.horizontalCenter: parent.horizontalCenter MouseArea { anchors.fill: parent @@ -110,7 +110,7 @@ ApplicationWindow { } } Image { - source: ui.assetPath("new.png") + source: "../new.png" anchors.horizontalCenter: parent.horizontalCenter MouseArea { anchors.fill: parent @@ -120,7 +120,7 @@ ApplicationWindow { } } Image { - source: ui.assetPath("net.png") + source: "../net.png" anchors.horizontalCenter: parent.horizontalCenter MouseArea { anchors.fill: parent @@ -131,7 +131,7 @@ ApplicationWindow { } Image { - source: ui.assetPath("heart.png") + source: "../heart.png" anchors.horizontalCenter: parent.horizontalCenter MouseArea { anchors.fill: parent From 7f9e614b5da75b948a0ba474e37254cb3f27ef0b Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 8 Jul 2014 14:25:30 +0200 Subject: [PATCH 2/6] Forgot two images --- ethereal/assets/qml/wallet.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml index 33e1cc24c6..c783cde830 100644 --- a/ethereal/assets/qml/wallet.qml +++ b/ethereal/assets/qml/wallet.qml @@ -436,7 +436,7 @@ ApplicationWindow { onDoubleClicked: peerWindow.visible = true anchors.fill: parent } - source: ui.assetPath("network.png") + source: "../network.png" } } @@ -624,7 +624,7 @@ ApplicationWindow { width: 150 fillMode: Image.PreserveAspectFit smooth: true - source: ui.assetPath("facet.png") + source: "../facet.png" x: 10 y: 10 } From 61d5d107b6f274cb1bf4ba6fda015ae30d28d2a6 Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 8 Jul 2014 14:27:22 +0200 Subject: [PATCH 3/6] Make script inclusion via QML also relative to asset path --- ethereal/assets/qml/webapp.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereal/assets/qml/webapp.qml b/ethereal/assets/qml/webapp.qml index 63927f0ebe..4012675118 100644 --- a/ethereal/assets/qml/webapp.qml +++ b/ethereal/assets/qml/webapp.qml @@ -38,7 +38,7 @@ ApplicationWindow { experimental.preferences.javascriptEnabled: true experimental.preferences.navigatorQtObjectEnabled: true experimental.preferences.developerExtrasEnabled: true - experimental.userScripts: [ui.assetPath("ext/pre.js"), ui.assetPath("ext/big.js"), ui.assetPath("ext/string.js"), ui.assetPath("ext/ethereum.js")] + experimental.userScripts: ["../ext/pre.js", "../ext/big.js", "../ext/string.js", "../ext/ethereum.js"] experimental.onMessageReceived: { console.log("[onMessageReceived]: ", message.data) // TODO move to messaging.js From 7e88dd4e6b5431a6c7bb2187965fd019261e5f3c Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 8 Jul 2014 14:58:23 +0200 Subject: [PATCH 4/6] Setup default asset path for windows --- ethereal/flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereal/flags.go b/ethereal/flags.go index 2c9b3af5fa..9a43188554 100644 --- a/ethereal/flags.go +++ b/ethereal/flags.go @@ -53,7 +53,7 @@ func defaultAssetPath() string { case "linux": assetPath = "/usr/share/ethereal" case "window": - fallthrough + assetPath = "./assets" default: assetPath = "." } From 05c18998959b6fbc5da674489371a8d3e88e7db2 Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 8 Jul 2014 14:58:33 +0200 Subject: [PATCH 5/6] Windos case for assetPath had a typo --- ethereal/flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereal/flags.go b/ethereal/flags.go index 9a43188554..d5ca9f336a 100644 --- a/ethereal/flags.go +++ b/ethereal/flags.go @@ -52,7 +52,7 @@ func defaultAssetPath() string { assetPath = filepath.Join(exedir, "../Resources") case "linux": assetPath = "/usr/share/ethereal" - case "window": + case "windows": assetPath = "./assets" default: assetPath = "." From c2bca5939d1d78d1548fcd43c29390fb06a508c0 Mon Sep 17 00:00:00 2001 From: Maran Date: Wed, 9 Jul 2014 14:01:53 +0200 Subject: [PATCH 6/6] Added path check for Windows when loading external QML windows/components --- ethereal/qml_container.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ethereal/qml_container.go b/ethereal/qml_container.go index a8ce1cb752..cb43a99bde 100644 --- a/ethereal/qml_container.go +++ b/ethereal/qml_container.go @@ -5,6 +5,7 @@ import ( "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethutil" "github.com/go-qml/qml" + "runtime" ) type QmlApplication struct { @@ -20,7 +21,14 @@ func NewQmlApplication(path string, lib *UiLib) *QmlApplication { } func (app *QmlApplication) Create() error { - component, err := app.engine.LoadFile(app.path) + path := string(app.path) + + // For some reason for windows we get /c:/path/to/something, windows doesn't like the first slash but is fine with the others so we are removing it + if string(app.path[0]) == "/" && runtime.GOOS == "windows" { + path = app.path[1:] + } + + component, err := app.engine.LoadFile(path) if err != nil { logger.Warnln(err) }