summaryrefslogtreecommitdiff
path: root/newRepo.go
diff options
context:
space:
mode:
Diffstat (limited to 'newRepo.go')
-rw-r--r--newRepo.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/newRepo.go b/newRepo.go
index e821dc0..56002fc 100644
--- a/newRepo.go
+++ b/newRepo.go
@@ -4,6 +4,7 @@ import (
"strings"
"go.wit.com/lib/gui/repostatus"
+ "go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
@@ -59,6 +60,7 @@ func (r *RepoRow) Show2() {
r.hidden = false
}
+/*
func (r *RepoList) NewRepo(path string) (*RepoRow, error) {
test, ok := r.allrepos[path]
if ok {
@@ -93,6 +95,43 @@ func (r *RepoList) NewRepo(path string) (*RepoRow, error) {
newRepo.Hide()
return newRepo, nil
}
+*/
+
+// adds a gui row to the table based off the repo protobuf
+func (r *RepoList) AddRepo(repo *gitpb.Repo) (*RepoRow, error) {
+ test, ok := r.allrepos[repo.GetGoPath()]
+ if ok {
+ // this repo already exists
+ return test, nil
+ }
+
+ status, err := repostatus.NewRepoStatusWindow(repo)
+ if err != nil {
+ return nil, err
+ }
+ newRepo := new(RepoRow)
+ newRepo.Status = status
+ newRepo.Status.InitOk = false
+
+ newRepo.pLabel = r.reposgrid.NewLabel(repo.GoPath).SetProgName("path")
+ newRepo.hidden = false
+
+ r.allrepos[repo.GoPath] = 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
+}
func (r *RepoList) makeAutotypistView(newRepo *RepoRow) {
grid := r.reposgrid