quiet normal init() conditions
This commit is contained in:
parent
154c750e02
commit
531a31e4b3
20
action.go
20
action.go
|
@ -13,17 +13,18 @@ import (
|
|||
// everything from the application goes through here
|
||||
func (me *TreeInfo) doAction(a widget.Action) {
|
||||
if a.ActionType == widget.ToolkitInit {
|
||||
log.Log(TREEWARN, "tree.doAction() trapped ToolkitInit finally!")
|
||||
log.Log(TREE, "tree.doAction() trapped ToolkitInit finally!")
|
||||
a.WidgetType = widget.Root
|
||||
n := addNode(&a)
|
||||
me.Add(n)
|
||||
log.Log(TREEWARN, "tree.doAction() init() me.treeRoot")
|
||||
if me.ToolkitInit != nil {
|
||||
log.Log(TREEWARN, "tree.doAction() doing ToolkitInit()")
|
||||
me.ToolkitInit()
|
||||
} else {
|
||||
log.Log(TREEWARN, "tree.doAction() me.ToolkitInit() == nil")
|
||||
log.Log(TREE, "tree.doAction() init() me.treeRoot")
|
||||
if me.ToolkitInit == nil {
|
||||
log.Log(TREE, "tree.doAction() ToolkitInit() was called before plugin had a chance to initialize")
|
||||
log.Log(TREE, "tree.doAction() TODO: fix channel to pause")
|
||||
return
|
||||
}
|
||||
log.Log(TREE, "tree.doAction() doing ToolkitInit()")
|
||||
me.ToolkitInit()
|
||||
return
|
||||
}
|
||||
if a.TablePB != nil {
|
||||
|
@ -44,6 +45,11 @@ func (me *TreeInfo) doAction(a widget.Action) {
|
|||
me.Add(n)
|
||||
return
|
||||
}
|
||||
if a.WidgetId == 0 {
|
||||
// this is ok. This is the binary tree base and it's already initialized. This happens on startup
|
||||
return
|
||||
}
|
||||
// this shouldn't really happen. It's good to print a warning so the plugin code can be debugged
|
||||
log.Log(TREEWARN, "attempting to re-add widget", a.WidgetId, a.WidgetType, a.ActionType)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ func (me *TreeInfo) AddNode(a *widget.Action) *Node {
|
|||
if me.TryLock() {
|
||||
defer me.Unlock()
|
||||
} else {
|
||||
log.Info("TREE: mutex lock was already held before AddNode()")
|
||||
log.Log(TREE, "mutex lock was already held before AddNode()")
|
||||
}
|
||||
return addNode(a)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue