diff options
Diffstat (limited to 'doGui.go')
| -rw-r--r-- | doGui.go | 43 |
1 files changed, 24 insertions, 19 deletions
@@ -14,6 +14,7 @@ import ( "go.wit.com/lib/fhelp" "go.wit.com/lib/gadgets" "go.wit.com/lib/gui/shell" + "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) @@ -168,28 +169,32 @@ func drawWindow(win *gadgets.GenericWindow) { patchesWin.Toggle() return } - // me.forge.GetPatches() - // loadUpstreamPatchsets() - /* - if me.psets == nil { - log.Info("failed to download current patchsets") - return + // load the current patches protobuf file + if err := me.forge.LoadPatchsets(); err != nil { + log.Info("patches failed to open", err) + if err := me.forge.SavePatchsets(); err != nil { + log.Warn("savePatchsets() failed", err) } - notdone := new(forgepb.Patches) + } + // patchesWin = makePatchesWin(me.forge.Patchsets) + notdone := new(forgepb.Patches) - all := me.psets.All() - for all.Scan() { - pset := all.Next() - AddNotDonePatches(notdone, pset, false) - } + if me.forge.Patchsets == nil { + log.Info("patchsets == nil") + return + } + all := me.forge.Patchsets.All() + for all.Scan() { + pset := all.Next() + AddAllPatches(notdone, pset, false) + // AddNotDonePatches(notdone, pset, false) + } - for patch := range notdone.IterAll() { - comment := cleanSubject(patch.Comment) - log.Info("new patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.Namespace, comment) - } - // savePatchsets() - patchesWin = makePatchesWin(notdone) - */ + for patch := range notdone.IterAll() { + comment := cleanSubject(patch.Comment) + log.Info("new patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.Namespace, comment) + } + patchesWin = makePatchesWin(notdone) }) var pubWin *gadgets.GenericWindow |
