aboutsummaryrefslogtreecommitdiff
path: root/gui/internal
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-17 09:03:43 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-17 09:03:43 +0200
commit80dde7b2cae7b9844c244e03395145370a819412 (patch)
treef0e79ea9a655e715d9d2bf41799f695d88df80b4 /gui/internal
parent1e3dd67868e1b6d3c12f0bca201d5e60a12c3723 (diff)
downloadkrino-80dde7b2cae7b9844c244e03395145370a819412.tar.gz
krino-80dde7b2cae7b9844c244e03395145370a819412.zip
gui: an applied plan says it is history; Settings says what needs saving
Diffstat (limited to 'gui/internal')
-rw-r--r--gui/internal/ui/plan.go22
-rw-r--r--gui/internal/ui/settings.go12
2 files changed, 29 insertions, 5 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()
}
diff --git a/gui/internal/ui/settings.go b/gui/internal/ui/settings.go
index e90c691..10f4bab 100644
--- a/gui/internal/ui/settings.go
+++ b/gui/internal/ui/settings.go
@@ -67,6 +67,11 @@ func (w *Window) showSettings() {
box.Append(s.check)
box.Append(heading("This window"))
+ kept := gtk.NewLabel("These are kept as you change them; the button below writes krino.conf, and is only lit when something above has changed.")
+ kept.SetXAlign(0)
+ kept.SetWrap(true)
+ kept.AddCSSClass("dim-label")
+ box.Append(kept)
prefs := w.prefs
colours := gtk.NewCheckButtonWithLabel("colour the configuration in the Text tab")
colours.SetActive(prefs.Colours)
@@ -122,6 +127,7 @@ func (w *Window) showSettings() {
s.save = gtk.NewButtonWithLabel("Save krino.conf")
s.save.AddCSSClass("suggested-action")
s.save.SetSensitive(false)
+ s.save.SetTooltipText("nothing to save: the defaults above are as krino.conf has them. The window settings below need no saving - they are kept as you change them.")
s.save.ConnectClicked(s.onSave)
closeBtn := gtk.NewButtonWithLabel("Close")
closeBtn.ConnectClicked(func() { s.win.Close() })
@@ -171,7 +177,11 @@ func (s *settingsWindow) armSave() {
switch {
case len(diags) == 0:
s.check.SetText("")
- s.save.SetSensitive(s.toSave && s.main.Modified())
+ canSave := s.toSave && s.main.Modified()
+ s.save.SetSensitive(canSave)
+ if canSave {
+ s.save.SetTooltipText("write krino.conf, keeping the previous text as krino.conf.bak")
+ }
default:
s.check.SetText(escape(diags[0].Error()))
s.check.AddCSSClass("error")