diff options
| author | Jeff Carr <[email protected]> | 2025-02-13 20:11:06 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-13 20:11:06 -0600 |
| commit | ede7c71fc73276cd58e1a84138fdfc779609a6f3 (patch) | |
| tree | d79ffaac85a2674bb4660acc532c7066c191bb28 /action.go | |
| parent | a75f0be4608991a85022981b3e033970ce40abb3 (diff) | |
subbed in Tables()
Diffstat (limited to 'action.go')
| -rw-r--r-- | action.go | 36 |
1 files changed, 34 insertions, 2 deletions
@@ -5,6 +5,7 @@ package tree import ( + "go.wit.com/lib/protobuf/guipb" "go.wit.com/log" "go.wit.com/widget" ) @@ -71,8 +72,21 @@ func (me *TreeInfo) doAction(a widget.Action) { log.Log(TREEWARN, "SetChecked() not supported on widget", n.WidgetType, n.String()) } case widget.Show: - n.State.Hidden = false - me.Show(n) + if n.WidgetType == widget.Table { + t, err := loadTable(&a) + if err != nil { + log.Info("unmarshal data failed", err) + return + } + if t == nil { + log.Info("unmarshal data failed table == nil") + } else { + me.ShowTable(nil) + } + } else { + n.State.Hidden = false + me.Show(n) + } case widget.Hide: n.State.Hidden = true me.Hide(n) @@ -85,3 +99,21 @@ func (me *TreeInfo) doAction(a widget.Action) { // me.NodeAction(n, a.ActionType) } } + +func loadTable(a *widget.Action) (*guipb.Tables, error) { + var t *guipb.Tables + err := t.Unmarshal(a.TablePB) + /* + test := NewRepos() + if test.Uuid != all.Uuid { + log.Log(WARN, "uuids do not match", test.Uuid, all.Uuid) + deleteProtobufFile(cfgname) + } + if test.Version != all.Version { + log.Log(WARN, "versions do not match", test.Version, all.Version) + deleteProtobufFile(cfgname) + } + */ + // log.Log(INFO, cfgname, "protobuf versions and uuid match", all.Uuid, all.Version) + return t, err +} |
