diff options
| author | Jeff Carr <[email protected]> | 2024-01-21 03:18:07 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-21 03:18:07 -0600 |
| commit | 7546209d24055bb1252ba3cab63e09f692c3e74b (patch) | |
| tree | 74ba3f92d1a514837a6b637ca187aa930fe914cc | |
| parent | 696b58744c5fcda33ddfc42013929442ce936d14 (diff) | |
work on making a map of the windowsv0.12.20
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | git.go | 14 | ||||
| -rw-r--r-- | new.go | 27 |
2 files changed, 31 insertions, 10 deletions
@@ -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") @@ -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) +} |
