f82eca8777
Carve src/gui/app.go into the new src/ui package: - run.go: process lifecycle (single instance, app/window, tray, startup timing). - mainwindow.go: view assembly + the app.Service event listener. Route every widget update driven by Service events through fyne.Do so the run goroutine (executeRun) no longer mutates Fyne widgets directly. Also wrap serveSingleInstance's Show/RequestFocus, which runs on the Accept goroutine. (Resolves refactoring problem #4.) fyne.Do/DoAndWait only exist in Fyne v2.6+, so upgrade fyne.io/fyne/v2 v2.5.3 -> v2.6.3. Mark the tray Quit item IsQuit so Fyne's addMissingQuitForMenu reuses it instead of appending a second, localized Quit now that v2.6 ships Russian translations. go build / go vet / go test -race all clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
25 lines
560 B
Go
25 lines
560 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"gitea.mixdep.ru/mix/gosentry/src/domain"
|
|
"gitea.mixdep.ru/mix/gosentry/src/ui"
|
|
)
|
|
|
|
func main() {
|
|
// The executable entry point intentionally delegates all startup work to the
|
|
// UI package. Keeping main small makes it easier to add platform-specific
|
|
// packaging later without mixing window setup, storage, and scheduler logic.
|
|
ui.Run(hasArgument(domain.StartInTrayArgument))
|
|
}
|
|
|
|
func hasArgument(argument string) bool {
|
|
for _, current := range os.Args[1:] {
|
|
if current == argument {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|