forked from henhouse/TurtleSilicon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
61 lines (48 loc) · 1.41 KB
/
main.go
File metadata and controls
61 lines (48 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package main
import (
"turtlesilicon/pkg/debug"
"turtlesilicon/pkg/service"
"turtlesilicon/pkg/ui"
"turtlesilicon/pkg/utils"
"strings"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
)
const appVersion = "1.4.0"
func main() {
TSApp := app.NewWithID("com.tairasu.turtlesilicon")
TSWindow := TSApp.NewWindow("TurtleSilicon v" + appVersion)
TSWindow.Resize(fyne.NewSize(650, 550))
TSWindow.SetFixedSize(true)
// Check for updates
go func() {
prefs, _ := utils.LoadPrefs()
updateInfo, updateAvailable, err := utils.CheckForUpdateWithAssets(appVersion)
if err != nil {
debug.Printf("Failed to check for updates: %v", err)
return
}
if !updateAvailable {
debug.Printf("No updates available")
return
}
latestVersion := strings.TrimPrefix(updateInfo.TagName, "v")
debug.Printf("Update available: current=%s, latest=%s", appVersion, latestVersion)
// Skip if user has suppressed this version
if prefs.SuppressedUpdateVersion == latestVersion {
debug.Printf("Update suppressed by user: %s", latestVersion)
return
}
// Show enhanced update dialog
ui.ShowUpdateDialog(updateInfo, appVersion, TSWindow)
}()
content := ui.CreateUI(TSWindow)
TSWindow.SetContent(content)
// Set up cleanup when window closes
TSWindow.SetCloseIntercept(func() {
debug.Println("Application closing, cleaning up RosettaX87 service...")
service.CleanupService()
TSApp.Quit()
})
TSWindow.ShowAndRun()
}