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 /new.go | |
| parent | 696b58744c5fcda33ddfc42013929442ce936d14 (diff) | |
work on making a map of the windowsv0.12.20
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'new.go')
| -rw-r--r-- | new.go | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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) +} |
