work on getting new patchset lists
This commit is contained in:
parent
6cf3648b94
commit
695da486d2
|
@ -59,6 +59,7 @@ func savePatchsets() error {
|
|||
if me.psets == nil {
|
||||
return fmt.Errorf("savePatchesets() can't save nil")
|
||||
}
|
||||
log.Info("savePatchsets() len =", me.psets.Len())
|
||||
data, err := me.psets.Marshal()
|
||||
if err != nil {
|
||||
log.Info("protobuf.Marshal() failed:", err)
|
||||
|
|
|
@ -54,7 +54,38 @@ func makePatchsetsWin() *stdPatchsetTableWin {
|
|||
log.Info("Get Patchsets failed", err)
|
||||
return
|
||||
}
|
||||
|
||||
var foundnew bool
|
||||
all := psets.All()
|
||||
for all.Scan() {
|
||||
pset := all.Next()
|
||||
found := me.psets.FindByUuid(pset.Uuid)
|
||||
if found == nil {
|
||||
log.Info("new patchset", pset.Name, pset.Uuid)
|
||||
pset.State = "new"
|
||||
foundnew = true
|
||||
} else {
|
||||
log.Info("patchset already on disk", found.Name, found.State)
|
||||
pset.State = found.State
|
||||
if pset.State == "" {
|
||||
pset.State = "new"
|
||||
}
|
||||
}
|
||||
}
|
||||
dwin.doPatchsetsTable(psets)
|
||||
if foundnew {
|
||||
log.Info("should save these here")
|
||||
me.psets = psets
|
||||
savePatchsets()
|
||||
}
|
||||
})
|
||||
|
||||
grid.NewButton("save", func() {
|
||||
if me.psets == nil {
|
||||
log.Info("No Patchsets loaded")
|
||||
return
|
||||
}
|
||||
savePatchsets()
|
||||
})
|
||||
|
||||
grid.NewButton("analyse and save patchsets", func() {
|
||||
|
|
Loading…
Reference in New Issue