Refactoring complete: v0.4.0 architectural milestone #1
+1
-1
@@ -249,7 +249,7 @@ Track progress here. Mark tasks complete as they land and pass review.
|
|||||||
- [x] T1.3 — Create `src/runner`; move runner logic
|
- [x] T1.3 — Create `src/runner`; move runner logic
|
||||||
- [x] T1.4 — Create `src/scheduler`; move scheduler
|
- [x] T1.4 — Create `src/scheduler`; move scheduler
|
||||||
- [x] T1.5 — Create `src/storage`; move store/paths
|
- [x] T1.5 — Create `src/storage`; move store/paths
|
||||||
- [ ] T1.6 — Create `src/platform/autostart`; move autostart logic
|
- [x] T1.6 — Create `src/platform/autostart`; move autostart logic
|
||||||
- [ ] T1.7 — Create `src/platform/desktop`; move desktop integration
|
- [ ] T1.7 — Create `src/platform/desktop`; move desktop integration
|
||||||
- [ ] T1.8 — Delete empty `src/core`; build + test both platforms
|
- [ ] T1.8 — Delete empty `src/core`; build + test both platforms
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func InstallDesktopIntegration(appID string, executablePath string, icon []byte) (string, error) {
|
func InstallDesktopIntegration(appID string, executablePath string, icon []byte) (string, error) {
|
||||||
@@ -40,6 +41,10 @@ StartupWMClass=%s
|
|||||||
return iconPath, nil
|
return iconPath, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func quoteDesktopExec(path string) string {
|
||||||
|
return strconv.Quote(path)
|
||||||
|
}
|
||||||
|
|
||||||
func xdgDataHome() (string, error) {
|
func xdgDataHome() (string, error) {
|
||||||
dataHome := os.Getenv("XDG_DATA_HOME")
|
dataHome := os.Getenv("XDG_DATA_HOME")
|
||||||
if dataHome == "" {
|
if dataHome == "" {
|
||||||
|
|||||||
+3
-2
@@ -15,6 +15,7 @@ import (
|
|||||||
"gitea.mixdep.ru/mix/gosentry/assets"
|
"gitea.mixdep.ru/mix/gosentry/assets"
|
||||||
"gitea.mixdep.ru/mix/gosentry/src/core"
|
"gitea.mixdep.ru/mix/gosentry/src/core"
|
||||||
"gitea.mixdep.ru/mix/gosentry/src/domain"
|
"gitea.mixdep.ru/mix/gosentry/src/domain"
|
||||||
|
"gitea.mixdep.ru/mix/gosentry/src/platform/autostart"
|
||||||
"gitea.mixdep.ru/mix/gosentry/src/runner"
|
"gitea.mixdep.ru/mix/gosentry/src/runner"
|
||||||
"gitea.mixdep.ru/mix/gosentry/src/scheduler"
|
"gitea.mixdep.ru/mix/gosentry/src/scheduler"
|
||||||
"gitea.mixdep.ru/mix/gosentry/src/storage"
|
"gitea.mixdep.ru/mix/gosentry/src/storage"
|
||||||
@@ -910,7 +911,7 @@ func settingsView(w fyne.Window, store *storage.Store, jobs *[]job) fyne.CanvasO
|
|||||||
startOnLogin.SetChecked(store.Config.StartOnLogin)
|
startOnLogin.SetChecked(store.Config.StartOnLogin)
|
||||||
autostartStatus := widget.NewLabel("")
|
autostartStatus := widget.NewLabel("")
|
||||||
refreshAutostartStatus := func() {
|
refreshAutostartStatus := func() {
|
||||||
ok, message := core.AutostartStatus(store.Config.StartOnLogin, store.Paths.ExecutablePath)
|
ok, message := autostart.AutostartStatus(store.Config.StartOnLogin, store.Paths.ExecutablePath)
|
||||||
if ok {
|
if ok {
|
||||||
autostartStatus.SetText("OK: " + message)
|
autostartStatus.SetText("OK: " + message)
|
||||||
return
|
return
|
||||||
@@ -975,7 +976,7 @@ func settingsView(w fyne.Window, store *storage.Store, jobs *[]job) fyne.CanvasO
|
|||||||
settingsStatus.SetText("Save failed: " + err.Error())
|
settingsStatus.SetText("Save failed: " + err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := core.SetAutostart(store.Config.StartOnLogin, store.Paths.ExecutablePath, store.Paths.DesktopIcon); err != nil {
|
if err := autostart.SetAutostart(store.Config.StartOnLogin, store.Paths.ExecutablePath, store.Paths.DesktopIcon); err != nil {
|
||||||
refreshAutostartStatus()
|
refreshAutostartStatus()
|
||||||
settingsStatus.SetText("Saved, autostart failed: " + err.Error())
|
settingsStatus.SetText("Saved, autostart failed: " + err.Error())
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//go:build linux
|
//go:build linux
|
||||||
|
|
||||||
package core
|
package autostart
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
//go:build linux
|
//go:build linux
|
||||||
|
|
||||||
package core
|
package autostart
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
//go:build !windows && !linux
|
//go:build !windows && !linux
|
||||||
|
|
||||||
package core
|
package autostart
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package core
|
package autostart
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
|
|
||||||
package core
|
package autostart
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
Reference in New Issue
Block a user