summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go35
1 files changed, 21 insertions, 14 deletions
diff --git a/main.go b/main.go
index bdc67c2..a944ca8 100644
--- a/main.go
+++ b/main.go
@@ -1,15 +1,15 @@
// This is a simple example
package main
-import (
- "os/user"
+import (
"embed"
+ "os/user"
"go.wit.com/log"
"go.wit.com/gui/gui"
- "go.wit.com/gui/gadgets"
- "go.wit.com/gui/lib/repostatus"
+ "go.wit.com/lib/gadgets"
+ "go.wit.com/lib/gui/repostatus"
)
//go:embed resources/*
@@ -51,7 +51,7 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri
newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion")
newRepo.dirtyLabel = grid.NewLabel("")
- newRepo.showButton = grid.NewButton("Show()", func () {
+ newRepo.showButton = grid.NewButton("Show()", func() {
if newRepo.status == nil {
log.Warn("status window doesn't exist")
return
@@ -76,12 +76,12 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri
func autotypistWindow() {
/*
- me.autotypistWindow = gadgets.NewBasicWindow(myGui, "autotypist for GO & git. it types faster than you can.")
- me.autotypistWindow.Make()
- me.autotypistWindow.StandardExit()
+ me.autotypistWindow = gadgets.NewBasicWindow(myGui, "autotypist for GO & git. it types faster than you can.")
+ me.autotypistWindow.Make()
+ me.autotypistWindow.StandardExit()
- box := me.autotypistWindow.Box()
- me.autotypistWindow.Draw()
+ box := me.autotypistWindow.Box()
+ me.autotypistWindow.Draw()
*/
win := myGui.NewWindow("autotypist for GO & git. it types faster than you can.")
box := win.NewBox("bw hbox", true)
@@ -97,6 +97,8 @@ func repoworld() {
reposwin.Make()
reposbox = reposwin.Box().NewBox("bw vbox", false)
+ reposwin.Draw()
+
reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)")
reposgrid = reposgroup.NewGrid("test", 11, 1)
@@ -116,11 +118,16 @@ func repoworld() {
for _, line := range repos {
log.Warn("repo =", line)
path, mbranch, dbranch, ubranch := splitLine(line)
- if mbranch == "" { mbranch = "master" }
- if dbranch == "" { dbranch = "devel" }
+ if mbranch == "" {
+ mbranch = "master"
+ }
+ if dbranch == "" {
+ dbranch = "devel"
+ }
usr, _ := user.Current()
- if ubranch == "" { ubranch = usr.Username }
+ if ubranch == "" {
+ ubranch = usr.Username
+ }
addRepo(reposgrid, path, mbranch, dbranch, ubranch)
}
- reposwin.Draw()
}