summaryrefslogtreecommitdiff
path: root/listWindow.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-22 15:28:32 -0600
committerJeff Carr <[email protected]>2024-02-22 15:28:32 -0600
commitf82ca7a951ef17e4ddb117d8715c7191c2f779b5 (patch)
tree1cbadc66a0f69bd549921051b603408f433e876f /listWindow.go
parentf8963c75638d16030a67aa1c79da55dbc824a79e (diff)
skip comments in config file
Diffstat (limited to 'listWindow.go')
-rw-r--r--listWindow.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/listWindow.go b/listWindow.go
index c69b759..61239b3 100644
--- a/listWindow.go
+++ b/listWindow.go
@@ -94,6 +94,15 @@ func ListWindow(view *repolist.RepoList) *gadgets.BasicWindow {
currents = NewSection(group, "local (~/.config/myrepolist)")
for i, line := range myrepolist() {
+ line = strings.TrimSpace(line)
+ if line == "" {
+ // skip blank lines
+ continue
+ }
+ if strings.HasPrefix(line, "#") {
+ // skip comment lines
+ continue
+ }
parts := strings.Split(line, " ")
log.Info("adding:", i, parts)
currents.add(view, parts[0])
@@ -202,8 +211,12 @@ func (s *section) add(view *repolist.RepoList, path string) {
log.Verbose("repo is already downloaded", path)
tmp.downloadB.SetLabel("downloaded")
tmp.downloadB.Disable()
+ s.grid.NewButton("Configure", func() {
+ log.Log(WIT, "todo: open the repo window here")
+ })
}
+ s.grid.NextRow()
s.witRepos = append(s.witRepos, tmp)
}
@@ -228,7 +241,7 @@ func NewSection(parent *gui.Node, desc string) *section {
}
lw.Enable()
})
- news.grid = news.parent.NewGrid("sections", 2, 1)
+ news.grid = news.parent.NewGrid("sections", 0, 0)
allsections = append(allsections, news)
return news
}