diff options
Diffstat (limited to 'gui/internal/ui/plan.go')
| -rw-r--r-- | gui/internal/ui/plan.go | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gui/internal/ui/plan.go b/gui/internal/ui/plan.go index 472350a..38412c2 100644 --- a/gui/internal/ui/plan.go +++ b/gui/internal/ui/plan.go @@ -468,7 +468,8 @@ func (p *planView) onApply() { p.w.setStatus("apply: %v", err) return } - p.w.setStatus("%d applied, %d failed, %d declined", res.Applied, res.Failed, res.Declined) + p.w.setStatus("%d applied, %d failed, %d declined - this plan is done; press Scan for a fresh one", + res.Applied, res.Failed, res.Declined) }) } @@ -488,8 +489,9 @@ func (p *planView) closeTab() { func (p *planView) setBusy(busy bool) { p.scan.SetSensitive(!busy) p.dirs.SetSensitive(!busy) - p.selAll.SetSensitive(!busy) - p.selNone.SetSensitive(!busy) + done := p.tab != nil && p.tab.Applied + p.selAll.SetSensitive(!busy && !done) + p.selNone.SetSensitive(!busy && !done) if p.checked != nil { p.checked.SetSensitive(!busy && p.tab != nil && !p.tab.Applied) } @@ -519,7 +521,17 @@ func (p *planView) selectAll(on bool) { // the plan is on screen, and whether it is hiding something that is // checked and would be applied. func (p *planView) sayWhatIsShown() { - if p.tab == nil || p.filter.Text() == "" { + if p.tab == nil { + return + } + if p.tab.Applied { + if p.filter.Text() != "" { + p.w.setStatus("%d of %d files shown; this plan has been applied - press Scan for a fresh one", + len(p.shown), len(p.tab.Rows)) + } + return + } + if p.filter.Text() == "" { return } hidden := p.tab.HiddenSelected(p.shown) @@ -552,6 +564,8 @@ func (p *planView) fillList() { // The plan arrives after setBusy has already run, so the menu over the // checked files is enabled here rather than there. p.checked.SetSensitive(!p.tab.Applied) + p.selAll.SetSensitive(!p.tab.Applied) + p.selNone.SetSensitive(!p.tab.Applied) p.sayWhatIsShown() } |
