diff options
Diffstat (limited to 'new.go')
| -rw-r--r-- | new.go | 35 |
1 files changed, 13 insertions, 22 deletions
@@ -5,7 +5,6 @@ import ( "path/filepath" "strings" - "go.wit.com/gui" "go.wit.com/lib/gadgets" "go.wit.com/log" ) @@ -45,7 +44,18 @@ func NewRepoStatusWindow(path string) *RepoStatus { // return nil } - rs := New(gui.TreeRoot(), path) + rs := &RepoStatus{ + ready: false, + } + rs.tags = make(map[string]string) + rs.window = gadgets.RawBasicWindow("GO Repo Details " + path) + rs.window.Horizontal() + rs.window.Make() + rs.ready = true + rs.window.Custom = func() { + rs.Hide() + log.Warn("repostatus user closed the window()") + } rs.draw() // save ~/go/src & the whole path strings @@ -56,6 +66,7 @@ func NewRepoStatusWindow(path string) *RepoStatus { rs.readGitConfig() rs.readOnly.SetValue("true") + // ignore everything else for now if strings.HasPrefix(path, "go.wit.com") { rs.readOnly.SetValue("false") } @@ -64,26 +75,6 @@ func NewRepoStatusWindow(path string) *RepoStatus { } 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{ - ready: false, - parent: p, - } - rs.tags = make(map[string]string) - rs.window = gadgets.NewBasicWindow(p, "GO Repo Details "+path) - rs.window.Horizontal() - rs.window.Make() - rs.ready = true - rs.window.Custom = func() { - rs.Hide() - log.Warn("repostatus user closed the window()") - } - windowMap[path] = rs return rs } |
