P3.4: Add Queue group to settings view

Add Execution mode and Overlap policy widget.Select controls in
ui/settings_view.go under a new Queue section group, between the
Application and Storage sections. Both selects are primed from the
current config on open and their selected values are written back into
the config struct on save, passing through the existing UpdateSettings
validation path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mixeme
2026-06-23 07:57:51 +03:00
parent b3e699792a
commit 94a8dcc62a
2 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ These land together because both edit `domain/job.go` and `storage/store.go`.
- [x] P3.1 — Config/runtime fields + defaults - [x] P3.1 — Config/runtime fields + defaults
- [x] P3.2 — Split dispatch into `app/run.go` - [x] P3.2 — Split dispatch into `app/run.go`
- [x] P3.3 — Rework `RunDue`/`executeRun` for mode + overlap policy - [x] P3.3 — Rework `RunDue`/`executeRun` for mode + overlap policy
- [ ] P3.4 — Settings Queue selects - [x] P3.4 — Settings Queue selects
- [ ] P3.5 — Queue tests - [ ] P3.5 — Queue tests
### Phase 4 — Notifications + Command browse ### Phase 4 — Notifications + Command browse
+17
View File
@@ -8,6 +8,7 @@ import (
"strings" "strings"
"gitea.mixdep.ru/mix/gosentry/src/app" "gitea.mixdep.ru/mix/gosentry/src/app"
"gitea.mixdep.ru/mix/gosentry/src/domain"
"fyne.io/fyne/v2" "fyne.io/fyne/v2"
"fyne.io/fyne/v2/container" "fyne.io/fyne/v2/container"
@@ -46,6 +47,16 @@ func settingsView(w fyne.Window, svc *app.Service) fyne.CanvasObject {
minimizeToTray.SetChecked(store.Config.KeepRunningInTray) minimizeToTray.SetChecked(store.Config.KeepRunningInTray)
notifications := widget.NewCheck("Show desktop notifications for failed jobs", nil) notifications := widget.NewCheck("Show desktop notifications for failed jobs", nil)
notifications.SetChecked(store.Config.NotifyOnFailure) notifications.SetChecked(store.Config.NotifyOnFailure)
executionModeSelect := widget.NewSelect(
[]string{string(domain.ExecutionModeParallel), string(domain.ExecutionModeSequential)},
nil,
)
executionModeSelect.SetSelected(string(store.Config.ExecutionMode))
overlapPolicySelect := widget.NewSelect(
[]string{string(domain.OverlapPolicySkip), string(domain.OverlapPolicyQueue)},
nil,
)
overlapPolicySelect.SetSelected(string(store.Config.OverlapPolicy))
jobsDir := widget.NewEntry() jobsDir := widget.NewEntry()
jobsDir.SetText(store.Config.JobsDir) jobsDir.SetText(store.Config.JobsDir)
jobsDirBrowse := widget.NewButtonWithIcon("Browse", theme.FolderOpenIcon(), func() { jobsDirBrowse := widget.NewButtonWithIcon("Browse", theme.FolderOpenIcon(), func() {
@@ -92,6 +103,8 @@ func settingsView(w fyne.Window, svc *app.Service) fyne.CanvasObject {
config.StartOnLogin = startOnLogin.Checked config.StartOnLogin = startOnLogin.Checked
config.KeepRunningInTray = minimizeToTray.Checked config.KeepRunningInTray = minimizeToTray.Checked
config.NotifyOnFailure = notifications.Checked config.NotifyOnFailure = notifications.Checked
config.ExecutionMode = domain.ExecutionMode(executionModeSelect.Selected)
config.OverlapPolicy = domain.OverlapPolicy(overlapPolicySelect.Selected)
if err := svc.UpdateSettings(config); err != nil { if err := svc.UpdateSettings(config); err != nil {
settingsStatus.SetText("Save failed: " + err.Error()) settingsStatus.SetText("Save failed: " + err.Error())
return return
@@ -111,6 +124,10 @@ func settingsView(w fyne.Window, svc *app.Service) fyne.CanvasObject {
settingsRow("Tray", container.New(minWidthLayout{width: settingsControlWidth}, minimizeToTray)), settingsRow("Tray", container.New(minWidthLayout{width: settingsControlWidth}, minimizeToTray)),
settingsRow("Notifications", container.New(minWidthLayout{width: settingsControlWidth}, notifications)), settingsRow("Notifications", container.New(minWidthLayout{width: settingsControlWidth}, notifications)),
widget.NewSeparator(), widget.NewSeparator(),
widget.NewLabelWithStyle("Queue", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
settingsRow("Execution mode", container.New(minWidthLayout{width: settingsControlWidth}, executionModeSelect)),
settingsRow("Overlap policy", container.New(minWidthLayout{width: settingsControlWidth}, overlapPolicySelect)),
widget.NewSeparator(),
widget.NewLabelWithStyle("Storage", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Storage", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
settingsRow("Config YAML", widget.NewLabel(store.Paths.ConfigPath)), settingsRow("Config YAML", widget.NewLabel(store.Paths.ConfigPath)),
settingsRow("Jobs directory", container.NewBorder(nil, nil, nil, jobsDirBrowse, jobsDir)), settingsRow("Jobs directory", container.NewBorder(nil, nil, nil, jobsDirBrowse, jobsDir)),