From 7e868d6f5b917a1a0735090490cf339e486aa1bb Mon Sep 17 00:00:00 2001 From: mixeme Date: Wed, 24 Jun 2026 22:18:36 +0300 Subject: [PATCH] ui/jobs_view: init pause controls from persisted state (T4.3) schedulerPaused, the scheduler-state label, and the Pause-all/Resume-all button now read Config.Paused at construction time so they correctly reflect a paused install on restart instead of always starting in the running state. Co-Authored-By: Claude Sonnet 4.6 --- src/ui/jobs_view.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ui/jobs_view.go b/src/ui/jobs_view.go index 3562c16..feb455d 100644 --- a/src/ui/jobs_view.go +++ b/src/ui/jobs_view.go @@ -61,7 +61,7 @@ func newJobsView(w fyne.Window, svc *app.Service) (fyne.CanvasObject, func()) { selected := 0 selectedFolder := allFolders - schedulerPaused := false + schedulerPaused := svc.Store().Config.Paused filteredJobs := filteredJobIndexes(jobs, selectedFolder) title := widget.NewLabelWithStyle(jobs[selected].Name, fyne.TextAlignLeading, fyne.TextStyle{Bold: true}) @@ -77,7 +77,11 @@ func newJobsView(w fyne.Window, svc *app.Service) (fyne.CanvasObject, func()) { stateLabel := newJobDetailLabel(selectedRuntime.LastState) statsLabel := newJobDetailLabel(app.DisplayStats(selectedRuntime)) overlapPolicyLabel := newJobDetailLabel(app.DisplayOverlapPolicy(jobs[selected], svc.Store().Config.OverlapPolicy)) - schedulerState := widget.NewLabel("Scheduler running") + schedulerStateText := "Scheduler running" + if schedulerPaused { + schedulerStateText = "Scheduler paused" + } + schedulerState := widget.NewLabel(schedulerStateText) commandOutput := widget.NewTextGrid() commandOutput.SetText(selectedRuntime.Output) commandOutputScroll := container.NewScroll(commandOutput) @@ -265,7 +269,11 @@ func newJobsView(w fyne.Window, svc *app.Service) (fyne.CanvasObject, func()) { list.Refresh() refreshView() }) - stopAllButton := widget.NewButtonWithIcon("Pause all", theme.MediaStopIcon(), nil) + stopAllText, stopAllIcon := "Pause all", theme.MediaStopIcon() + if schedulerPaused { + stopAllText, stopAllIcon = "Resume all", theme.MediaPlayIcon() + } + stopAllButton := widget.NewButtonWithIcon(stopAllText, stopAllIcon, nil) stopAllButton.OnTapped = func() { // SetGlobalPause flips the Service's pause flag, updates every job's // next-run text, and emits the activity record the observer logs. Mirror the