Skip to content

Commit 71037c5

Browse files
committed
Optimized for cross-platform support
macOS deployment files and platform specific fixes Settings are now globally stored in AppConfigLocation
1 parent f19f4d2 commit 71037c5

File tree

8 files changed

+276
-70
lines changed

8 files changed

+276
-70
lines changed

LoFloccus.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type AppSettings struct {
3636
}
3737

3838
var (
39+
appVersion = "1.1.2"
3940
configFile = "LoFloccus-Settings.ini"
4041
cfg *ini.File
4142
windowWidget *widgets.QWidget
@@ -73,13 +74,17 @@ func main() {
7374
windowWidget = loader.Load(file, nil)
7475
windowWidget.SetFixedSize2(windowWidget.Width(), windowWidget.Height())
7576
windowWidget.SetWindowIcon(icon)
77+
windowWidget.SetStyleSheet("QWidget{font-size:12px}");
78+
windowWidget.SetWindowTitle(windowWidget.WindowTitle() + " v" + appVersion)
7679
windowWidget.ConnectDestroyQWidget(func() {
7780
exitApp()
7881
})
7982
setupSystray(icon)
8083

8184
var (
8285
uiLogo = widgets.NewQLabelFromPointer(windowWidget.FindChild("logo", core.Qt__FindChildrenRecursively).Pointer())
86+
uiLogoLabel = widgets.NewQLabelFromPointer(windowWidget.FindChild("logo_label", core.Qt__FindChildrenRecursively).Pointer())
87+
uiDescriptionLabel = widgets.NewQLabelFromPointer(windowWidget.FindChild("description_label", core.Qt__FindChildrenRecursively).Pointer())
8388

8489
uiSrvStatus = widgets.NewQLabelFromPointer(windowWidget.FindChild("srv_status", core.Qt__FindChildrenRecursively).Pointer())
8590
uiXBELPath = widgets.NewQLabelFromPointer(windowWidget.FindChild("xbel_path", core.Qt__FindChildrenRecursively).Pointer())
@@ -92,13 +97,21 @@ func main() {
9297
uiBtnServerControl = widgets.NewQPushButtonFromPointer(windowWidget.FindChild("btn_server_control", core.Qt__FindChildrenRecursively).Pointer())
9398
uiBtnHideControl = widgets.NewQPushButtonFromPointer(windowWidget.FindChild("btn_hide_tray", core.Qt__FindChildrenRecursively).Pointer())
9499

100+
uiConnectLabel = widgets.NewQLabelFromPointer(windowWidget.FindChild("connect_label", core.Qt__FindChildrenRecursively).Pointer())
101+
uiSettingsLabel = widgets.NewQLabelFromPointer(windowWidget.FindChild("settings_label", core.Qt__FindChildrenRecursively).Pointer())
102+
95103
uiSettingsStartMinimized = widgets.NewQCheckBoxFromPointer(windowWidget.FindChild("start_minimized", core.Qt__FindChildrenRecursively).Pointer())
96104
uiSettingsStartServer = widgets.NewQCheckBoxFromPointer(windowWidget.FindChild("start_open", core.Qt__FindChildrenRecursively).Pointer())
97105
)
98106

99107
var pixMap = gui.NewQPixmap5(":/qml/logo.png", "", core.Qt__NoFormatConversion)
100108
uiLogo.SetPixmap(pixMap)
101109

110+
uiLogoLabel.SetStyleSheet("QLabel{font-size:16px;font-weight:600;}");
111+
uiDescriptionLabel.SetStyleSheet("QLabel{font-size:14px;font-weight:600;}");
112+
uiConnectLabel.SetStyleSheet("QLabel{font-weight:600;}");
113+
uiSettingsLabel.SetStyleSheet("QLabel{font-weight:600;}");
114+
102115
uiSrvAddr.SetText("http://" + serverConfig.address + ":" + strconv.Itoa(serverConfig.port))
103116
uiSrvUser.SetText(serverConfig.user);
104117
uiSrvPasswd.SetText(serverConfig.passwd);
@@ -192,7 +205,7 @@ func setupSystray(icon *gui.QIcon) {
192205
tray.SetToolTip("LoFloccus App")
193206
tray.SetContextMenu(menu)
194207
tray.ConnectActivated(func(reason widgets.QSystemTrayIcon__ActivationReason) {
195-
if reason != widgets.QSystemTrayIcon__Context {
208+
if reason != widgets.QSystemTrayIcon__Context && core.QSysInfo_ProductType() == "windows" {
196209
windowWidget.Show()
197210
}
198211
})
@@ -205,6 +218,7 @@ func exitApp() {
205218
}
206219

207220
func loadAppConfig() {
221+
configFile = core.QStandardPaths_WritableLocation(core.QStandardPaths__AppConfigLocation) + "/" + configFile
208222
var err error
209223
cfg, err = ini.Load(configFile)
210224
if err != nil {

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Sync Floccus to a Local Folder!
33

44
**LoFloccus** is a small companion app for Floccus that empowers you to sync your bookmarks with whatever service or tool you would like to!
55

6-
![LoFloccus](https://cdn.iklive.eu/tcb13/2019/lofloccus-1-1-0.png)
6+
![LoFloccus](https://cdn.iklive.eu/tcb13/2019/lofloccus-1-1-0.png)
77

88
## Download LoFloccus
99

10-
- **Windows**: https://github.com/TCB13/LoFloccus/releases/download/1.1.1/LoFloccus-1-1-1.zip
11-
- **macOS**: Available Soon!
10+
- **Windows**: https://github.com/TCB13/LoFloccus/releases/download/1.1.2/LoFloccus-Win.zip
11+
- **macOS**: https://github.com/TCB13/LoFloccus/releases/download/1.1.2/LoFloccus-macOS.zip
1212

1313
## Why and How
1414

@@ -29,16 +29,23 @@ Enjoy the best of Floccus and combine it with favourite sync tool!
2929

3030
LoFloccus was built using Golang and Qt.
3131

32-
#### Windows
33-
**Develop**:
32+
#### Develop
3433
1. Install Qt
3534
2. Install https://github.com/therecipe/qt
36-
3. Add user variable `CGO_LDFLAGS`: `C:\Users\Public\env_windows_amd64_Tools\mingw730_64\x86_64-w64-mingw32\lib\libmsvcrt.a`
37-
4. Add to user `Path` variable: `C:\Users\Public\env_windows_amd64\5.12.0\mingw73_64\bin` and `C:\Users\Public\env_windows_amd64_Tools\mingw730_64\bin`
35+
3. (Windows only) Add user variable `CGO_LDFLAGS`: `C:\Users\Public\env_windows_amd64_Tools\mingw730_64\x86_64-w64-mingw32\lib\libmsvcrt.a`
36+
4. (Windows only) Add to user `Path` variable: `C:\Users\Public\env_windows_amd64\5.12.0\mingw73_64\bin` and `C:\Users\Public\env_windows_amd64_Tools\mingw730_64\bin`
3837
5. `go run LoFloccus.go`!
3938

40-
**Deploy**:
39+
### Deploy for Windows
4140
1. `cd LoFloccus`
4241
2. `windres.exe .\Windows.rc -o Windows.syso`
4342
3. `qtdeploy build desktop .`
4443
4. Run `deploy/windows/LoFloccus.exe`!
44+
45+
### Deploy for macOS
46+
1. `cd LoFloccus`
47+
2. (Optionally) Install imagemagick `brew update && brew install imagemagick`
48+
3. (Optionally) `generate-icns-from-svg.sh`
49+
4. (Optionally) Move `icon.icns` to `darwin\Contents\Resources`
50+
5. `qtdeploy build desktop .`
51+
6. Run `deploy/darwin/LoFloccus.app`

Windows.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
IDI_ICON1 ICON DISCARDABLE "qml/icon.ico"
22

33
1 VERSIONINFO
4-
FILEVERSION 1,1,1,0
5-
PRODUCTVERSION 1,1,1,0
4+
FILEVERSION 1,1,2,0
5+
PRODUCTVERSION 1,1,2,0
66
BEGIN
77
BLOCK "StringFileInfo"
88
BEGIN
99
BLOCK "040904E4"
1010
BEGIN
1111
VALUE "CompanyName", "LoFloccus"
12-
VALUE "FileDescription", "Sync Floccus to a Local Folder!"
13-
VALUE "FileVersion", "1.1.1"
12+
VALUE "FileDescription", "LoFloccus"
13+
VALUE "FileVersion", "1.1.2"
1414
VALUE "InternalName", "LoFloccus"
1515
VALUE "LegalCopyright", "LoFloccus"
1616
VALUE "OriginalFilename", "LoFloccus.exe"
1717
VALUE "ProductName", "LoFloccus"
18-
VALUE "ProductVersion", "1.1.1"
18+
VALUE "ProductVersion", "1.1.2"
1919
END
2020
END
2121
BLOCK "VarFileInfo"

darwin/Contents/Info.plist

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleExecutable</key>
6+
<string>LoFloccus</string>
7+
<key>CFBundleGetInfoString</key>
8+
<string>1.1.2, Copyright © 2019, TCB13.</string>
9+
<key>CFBundleIconFile</key>
10+
<string>icon.icns</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>com.tcb13.LoFloccus</string>
13+
<key>CFBundleName</key>
14+
<string>LoFloccus</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.1.2</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>LSMinimumSystemVersion</key>
22+
<string>10.11</string>
23+
<key>NOTE</key>
24+
<string>This file was generated by Qt/QMake.</string>
25+
<key>NSPrincipalClass</key>
26+
<string>NSApplication</string>
27+
<key>NSHighResolutionCapable</key>
28+
<true/>
29+
<key>NSSupportsAutomaticGraphicsSwitching</key>
30+
<true/>
31+
</dict>
32+
</plist>
33+
82.3 KB
Binary file not shown.

generate-icns-from-svg.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
mkdir icon.iconset
4+
convert -background none -size 16x16 -gravity center -extent 16x16 icon.svg icon.iconset/icon_16x16.png
5+
convert -background none -size 32x32 -gravity center -extent 32x32 icon.svg icon.iconset/[email protected]
6+
convert -background none -size 32x32 -gravity center -extent 32x32 icon.svg icon.iconset/icon_32x32.png
7+
convert -background none -size 64x64 -gravity center -extent 64x64 icon.svg icon.iconset/[email protected]
8+
convert -background none -size 64x64 -gravity center -extent 64x64 icon.svg icon.iconset/icon_64x64.png
9+
convert -background none -size 128x128 -gravity center -extent 128x128 icon.svg icon.iconset/[email protected]
10+
convert -background none -size 128x128 -gravity center -extent 128x128 icon.svg icon.iconset/icon_128x128.png
11+
convert -background none -size 256x256 -gravity center -extent 256x256 icon.svg icon.iconset/[email protected]
12+
convert -background none -size 256x256 -gravity center -extent 256x256 icon.svg icon.iconset/icon_256x256.png
13+
convert -background none -size 512x512 -gravity center -extent 512x512 icon.svg icon.iconset/[email protected]
14+
convert -background none -size 512x512 -gravity center -extent 512x512 icon.svg icon.iconset/icon_512x512.png
15+
convert -background none -size 1024x1024 -gravity center -extent 1024x1024 icon.svg icon.iconset/[email protected]
16+
iconutil --convert icns icon.iconset
17+
rm -R icon.iconset
18+

icon.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)