diff --git a/git.go b/git.go index 782a30d..9cfdeeb 100644 --- a/git.go +++ b/git.go @@ -175,34 +175,28 @@ func (rs *RepoStatus) SetUserBranchName(s string) { // returns "master", "devel", os.Username, etc func (rs *RepoStatus) GetMasterBranchName() string { name := rs.masterDrop.String() - log.Warn("GetMasterName() =", name) return name } func (rs *RepoStatus) GetDevelBranchName() string { name := rs.develDrop.String() - log.Warn("GetDevelName() =", name) return name } func (rs *RepoStatus) GetUserBranchName() string { name := rs.userDrop.String() - log.Warn("GetUserBranchName() =", name) return name } // returns the git versions like "1.3-2-laksdjf" or whatever func (rs *RepoStatus) GetMasterVersion() string { name := rs.masterBranchVersion.String() - log.Warn("GetMasterVersion() =", name) return name } func (rs *RepoStatus) GetDevelVersion() string { name := rs.develBranchVersion.String() - log.Warn("GetBranchVersion() =", name) return name } func (rs *RepoStatus) GetUserVersion() string { name := rs.userBranchVersion.String() - log.Warn("GetUserVersion() =", name) return name } @@ -211,7 +205,7 @@ func (rs *RepoStatus) SetMasterVersion(s string) { return } rs.changed = true - log.Warn("git", rs.GetMasterBranchName(), "version now =", s) + log.Verbose("git", rs.GetMasterBranchName(), "is now version =", s) rs.masterBranchVersion.SetValue(s) } @@ -220,8 +214,8 @@ func (rs *RepoStatus) SetDevelVersion(s string) { return } rs.changed = true - log.Warn("git", rs.GetDevelBranchName(), "version now =", s) rs.develBranchVersion.SetValue(s) + log.Verbose("git", rs.GetDevelBranchName(), "s now version =", s) } func (rs *RepoStatus) SetUserVersion(s string) { @@ -229,8 +223,8 @@ func (rs *RepoStatus) SetUserVersion(s string) { return } rs.changed = true - log.Warn("git", rs.GetUserBranchName(), "version now =", s) rs.userBranchVersion.SetValue(s) + log.Verbose("git", rs.GetUserBranchName(), "is now version =", s) } func (rs *RepoStatus) GetStatus() string { @@ -250,7 +244,7 @@ func (rs *RepoStatus) GetStatus() string { } if rs.CheckBranches() { - log.Warn("Branches are Perfect") + log.Info("Branches are Perfect") return "PERFECT" } log.Warn(rs.GetPath(), "Branches are not Perfect") diff --git a/new.go b/new.go index c5a0756..5da1fc1 100644 --- a/new.go +++ b/new.go @@ -6,6 +6,28 @@ import ( "go.wit.com/log" ) +var windowMap map[string]*RepoStatus + +func ListAll() { + for path, rs := range windowMap { + log.Warn(rs.GetMasterVersion(), path) + } +} + +func NewRepoStatusWindow(path string) *RepoStatus { + if windowMap[path] == nil { + log.Warn("This doesn't exist yet for path", path) + } else { + log.Warn("This already exists yet for path", path) + log.Warn("should return windowMap[path] here") + } + rs := New(gui.TreeRoot(), path) + windowMap[path] = rs + + // todo check if a window already exists for this path + return rs +} + func New(p *gui.Node, path string) *RepoStatus { rs := &RepoStatus{ hidden: true, @@ -24,5 +46,10 @@ func New(p *gui.Node, path string) *RepoStatus { rs.Hide() log.Warn("repostatus user closed the window()") } + windowMap[path] = rs return rs } + +func init() { + windowMap = make(map[string]*RepoStatus) +}