diff options
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) +} |
