linux build can now access assets in various */share/cwtch/assets folders. linux installer installs multiple sized icons
the build was successful
Details
the build was successful
Details
This commit is contained in:
parent
4cdb507e5e
commit
4bb5a52b9f
|
@ -2,7 +2,7 @@
|
||||||
Name=Cwtch
|
Name=Cwtch
|
||||||
Comment=Metadata Resistant Instant Messaging
|
Comment=Metadata Resistant Instant Messaging
|
||||||
Exec=~/.local/bin/cwtch
|
Exec=~/.local/bin/cwtch
|
||||||
Icon=~/.local/share/icons/cwtch.png
|
Icon=cwtch
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
Type=Application
|
Type=Application
|
||||||
Keywords=Internet;IM;Instant Messaging;Messaging;Chat
|
Keywords=Internet;IM;Instant Messaging;Messaging;Chat
|
||||||
|
|
BIN
linux/cwtch.png
BIN
linux/cwtch.png
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 798 B |
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
|
@ -6,5 +6,10 @@ cp ui ~/.local/bin/cwtch
|
||||||
mkdir -p ~/.local/share/icons
|
mkdir -p ~/.local/share/icons
|
||||||
cp cwtch.png ~/.local/share/icons
|
cp cwtch.png ~/.local/share/icons
|
||||||
|
|
||||||
|
mkdir -p ~/.local/share/cwtch
|
||||||
|
cp -r assets ~/.local/share/cwtch
|
||||||
|
|
||||||
|
cp -r icons ~/.local/share/
|
||||||
|
|
||||||
mkdir -p ~/.local/share/applications
|
mkdir -p ~/.local/share/applications
|
||||||
sed "s|~|$HOME|" cwtch.desktop > $HOME/.local/share/applications/cwtch.desktop
|
sed "s|~|$HOME|" cwtch.desktop > $HOME/.local/share/applications/cwtch.desktop
|
||||||
|
|
32
main.go
32
main.go
|
@ -181,14 +181,38 @@ func mainUi(flagLocal bool, flagClientUI bool) {
|
||||||
log.Infof("core.QCoreApplication_ApplicationDirPath(): %v\n", dir)
|
log.Infof("core.QCoreApplication_ApplicationDirPath(): %v\n", dir)
|
||||||
if runtime.GOOS == "android" {
|
if runtime.GOOS == "android" {
|
||||||
gcd.SetAssetPath("assets:/")
|
gcd.SetAssetPath("assets:/")
|
||||||
} else {
|
} else if runtime.GOOS == "windows" {
|
||||||
// all of these access are QML based, and QML takes URIs which use forward slashes and translates them to local OS sperators
|
// all of these access are QML based, and QML takes URIs which use forward slashes and translates them to local OS sperators
|
||||||
// also windows paths need to be like /c:/PATH
|
// also windows paths need to be like /c:/PATH
|
||||||
if runtime.GOOS == "windows" {
|
dir = "/" + dir
|
||||||
dir = "/" + dir
|
|
||||||
}
|
|
||||||
// QML uses '/' regardless of platform (so we use path.Join here not filepath.Join)
|
// QML uses '/' regardless of platform (so we use path.Join here not filepath.Join)
|
||||||
gcd.SetAssetPath("file://" + path.Join(dir, "assets") + "/")
|
gcd.SetAssetPath("file://" + path.Join(dir, "assets") + "/")
|
||||||
|
} else {
|
||||||
|
if buildVer == "" || flagLocal {
|
||||||
|
if _, err := os.Stat(path.Join(dir, "assets")); !os.IsNotExist(err) {
|
||||||
|
gcd.SetAssetPath("file://" + path.Join(dir, "assets") + "/")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
usr, err := user.Current()
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("\nerror: could not load current user: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
localCwtch := path.Join(usr.HomeDir, ".local/share/cwtch")
|
||||||
|
if _, err := os.Stat(localCwtch); !os.IsNotExist(err) {
|
||||||
|
gcd.SetAssetPath("file://" + path.Join(localCwtch, "assets") + "/")
|
||||||
|
} else if _, err := os.Stat("/usr/share/cwtch"); !os.IsNotExist(err) {
|
||||||
|
gcd.SetAssetPath("file://" + "/usr/share/cwtch/assets/")
|
||||||
|
} else if _, err := os.Stat("/usr/local/share/cwtch/"); !os.IsNotExist(err) {
|
||||||
|
gcd.SetAssetPath("file://" + "/usr/local/share/cwtch/assets/")
|
||||||
|
} else if _, err := os.Stat(path.Join(dir, "assets")); !os.IsNotExist(err) {
|
||||||
|
gcd.SetAssetPath("file://" + path.Join(dir, "assets") + "/")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if gcd.AssetPath() == "" {
|
||||||
|
log.Errorf("Could not find assets folder")
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log.Infof("gcd.assetPath = '%v'\n", gcd.AssetPath())
|
log.Infof("gcd.assetPath = '%v'\n", gcd.AssetPath())
|
||||||
|
|
||||||
|
|
Reference in New Issue