diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-17 10:56:19 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-17 10:56:19 +0200 |
| commit | 48d1781fed3f9ea5cfd2b270bd92fd2826605636 (patch) | |
| tree | 8abddf0ae7aaab97426cad1f65038560c8b85b9f /gui/internal/ui/plan.go | |
| parent | a2cb20851499e9c00bd3bf642680a9ce3148cae8 (diff) | |
| download | krino-48d1781fed3f9ea5cfd2b270bd92fd2826605636.tar.gz krino-48d1781fed3f9ea5cfd2b270bd92fd2826605636.zip | |
gui: conditions as a nested tree, and a way to add a directory
Diffstat (limited to 'gui/internal/ui/plan.go')
| -rw-r--r-- | gui/internal/ui/plan.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gui/internal/ui/plan.go b/gui/internal/ui/plan.go index 0a9b718..0adc6b1 100644 --- a/gui/internal/ui/plan.go +++ b/gui/internal/ui/plan.go @@ -469,6 +469,33 @@ func (p *planView) showPath() { p.path.SetText("no directory is included; add one with: krino new NAME PATH") } +// currentName is the directory the picker names, "" when none. +func (p *planView) currentName() string { + if d := p.currentDir(); d != nil { + return d.Name + } + return "" +} + +// refreshDirs rebuilds the directory picker after the configuration +// changed - a directory added in the Rules tab appears here too. +func (p *planView) refreshDirs(keep string) { + names := make([]string, len(p.w.engine.Dirs)) + for i, d := range p.w.engine.Dirs { + names[i] = d.Name + } + if len(names) == 0 { + names = []string{"none"} + } + p.dirs.SetModel(gtk.NewStringList(names)) + for i, d := range p.w.engine.Dirs { + if d.Name == keep { + p.dirs.SetSelected(uint(i)) + } + } + p.showPath() +} + // currentDir is the directory the picker names. func (p *planView) currentDir() *engine.Dir { i := int(p.dirs.Selected()) |
