closer. only show writable so I can fix the GUI

This commit is contained in:
Jeff Carr 2024-11-28 23:24:58 -06:00
parent c32aea103c
commit 43385fcb43
2 changed files with 9 additions and 40 deletions

10
init.go
View File

@ -19,11 +19,17 @@ func Init(f *forgepb.Forge, g *gui.Node) *RepoList {
me.Enable()
me.forge = f
me.viewName = "autotypist"
repos := me.forge.Repos.SortByPath()
for repos.Scan() {
repo := repos.Next()
log.Info("repo scan directory:", repo.FullPath)
me.AddRepo(repo)
if me.forge.IsReadOnly(repo.GoPath) {
log.Info("repo scan readonly directory:", repo.FullPath)
} else {
log.Info("repo scan writable directory:", repo.FullPath)
me.AddRepo(repo)
}
}
me.Enable()

View File

@ -60,43 +60,6 @@ func (r *RepoRow) Show2() {
r.hidden = false
}
/*
func (r *RepoList) NewRepo(path string) (*RepoRow, error) {
test, ok := r.allrepos[path]
if ok {
// this repo already exists
return test, nil
}
status, err := repostatus.New(path)
if err != nil {
return nil, err
}
newRepo := new(RepoRow)
newRepo.Status = status
newRepo.Status.InitOk = false
newRepo.pLabel = r.reposgrid.NewLabel(path).SetProgName("path")
newRepo.hidden = false
r.allrepos[path] = newRepo
newRepo.NewScan()
switch r.viewName {
case "autotypist":
r.makeAutotypistView(newRepo)
case "guireleaser":
r.makeGuireleaserView(newRepo)
default:
r.makeAutotypistView(newRepo)
}
r.reposgrid.NextRow()
newRepo.Status.InitOk = true
newRepo.Hide()
return newRepo, nil
}
*/
// adds a gui row to the table based off the repo protobuf
func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
test, ok := r.allrepos[pb.GetGoPath()]
@ -130,7 +93,7 @@ func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
}
r.reposgrid.NextRow()
newRepo.Status.InitOk = true
newRepo.Hide()
// newRepo.Hide()
return newRepo, nil
}