tidying
the build was successful Details

This commit is contained in:
erinn 2020-01-08 14:37:57 -08:00
parent 78f4d96a9b
commit aa39ed3f54
2 changed files with 5 additions and 9 deletions

11
main.go
View File

@ -16,7 +16,6 @@ import (
"github.com/therecipe/qt/network" "github.com/therecipe/qt/network"
"github.com/therecipe/qt/qml" "github.com/therecipe/qt/qml"
"github.com/therecipe/qt/quickcontrols2" "github.com/therecipe/qt/quickcontrols2"
"github.com/therecipe/qt/widgets"
"os" "os"
"os/user" "os/user"
"path" "path"
@ -126,13 +125,12 @@ func mainService() {
func mainUi(flagLocal bool, flagClientUI bool) { func mainUi(flagLocal bool, flagClientUI bool) {
log.Infof("I am the UI (client:%v)\n", flagClientUI) log.Infof("I am the UI (client:%v)\n", flagClientUI)
//app := gui.NewQGuiApplication(len(os.Args), os.Args) app := gui.NewQGuiApplication(len(os.Args), os.Args)
app := widgets.NewQApplication(len(os.Args), os.Args)
// our globals // our globals
gcd := ui.NewGrandCentralDispatcher(nil) gcd := ui.NewGrandCentralDispatcher(nil)
gcd.SetOs(runtime.GOOS) gcd.SetOs(runtime.GOOS)
ex, err := os.Executable() ex, err := os.Executable()
if err != nil { log.Infof("error getting path: %v", err) } if err != nil { log.Errorf("error getting path: %v", err) }
dir := path.Dir(ex) dir := path.Dir(ex)
if runtime.GOOS == "android" { if runtime.GOOS == "android" {
gcd.SetAssetPath("assets:/") gcd.SetAssetPath("assets:/")
@ -159,7 +157,7 @@ func mainUi(flagLocal bool, flagClientUI bool) {
qmlSource = core.NewQUrl3("qrc:/qml/main.qml", 0) qmlSource = core.NewQUrl3("qrc:/qml/main.qml", 0)
} }
//app.SetWindowIcon(widgets.NewQ NewQIcon5(":/qml/images/cwtch-icon.png")) app.SetWindowIcon(gui.NewQIcon5(":/qml/images/cwtch-icon.png"))
// load english first so it becomes the default in case we don't have a .ts for the user's locale, or if it contains unfinished strings // load english first so it becomes the default in case we don't have a .ts for the user's locale, or if it contains unfinished strings
translator := core.NewQTranslator(nil) translator := core.NewQTranslator(nil)
@ -183,8 +181,7 @@ func mainUi(flagLocal bool, flagClientUI bool) {
proxy := network.NewQNetworkProxy() proxy := network.NewQNetworkProxy()
proxy.SetHostName("0.0.0.0") proxy.SetHostName("0.0.0.0")
nam.SetProxy(proxy) nam.SetProxy(proxy)
log.Infof("schemes: %v", nam.SupportedSchemes()) return nam
return nam//.QNetworkAccessManager_PTR()*/
}) })
engine.SetNetworkAccessManagerFactory(factory) engine.SetNetworkAccessManagerFactory(factory)

View File

@ -38,7 +38,6 @@ ApplicationWindow {
} }
function parse(text, size, isntEditable) { // REPLACE EMOJI WITH <IMG> TAGS function parse(text, size, isntEditable) { // REPLACE EMOJI WITH <IMG> TAGS
//T.twemoji.base = "file://"+gcd.binaryPath+"/assets/twemoji/"
T.twemoji.base = gcd.assetPath + "twemoji/" T.twemoji.base = gcd.assetPath + "twemoji/"
T.twemoji.ext = ".png" T.twemoji.ext = ".png"
T.twemoji.size = "72x72" T.twemoji.size = "72x72"
@ -47,7 +46,7 @@ ApplicationWindow {
retText = retText.replace(/\n/g,"<br/>") retText = retText.replace(/\n/g,"<br/>")
// mutant standard stickers // mutant standard stickers
if (isntEditable) retText = Mutant.standard.parse(retText) if (isntEditable) retText = Mutant.standard.parse(retText)
return retText return retText
} }