summaryrefslogtreecommitdiff
path: root/action.go
diff options
context:
space:
mode:
Diffstat (limited to 'action.go')
-rw-r--r--action.go36
1 files changed, 34 insertions, 2 deletions
diff --git a/action.go b/action.go
index 3ae03e4..32a11ab 100644
--- a/action.go
+++ b/action.go
@@ -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
+}