remove testing code
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
1a9b13dda5
commit
4641eceda8
56
common.go
56
common.go
|
@ -2,7 +2,6 @@
|
|||
package linuxstatus
|
||||
|
||||
import (
|
||||
"go.wit.com/gui"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
|
@ -19,30 +18,6 @@ func (ls *LinuxStatus) Changed() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func (ls *LinuxStatus) Make() {
|
||||
if !ls.Ready() {
|
||||
return
|
||||
}
|
||||
log.Log(CHANGE, "Make() window ready =", ls.ready)
|
||||
ls.window.Make()
|
||||
ls.ready = true
|
||||
}
|
||||
func (ls *LinuxStatus) Draw() {
|
||||
if !ls.Ready() {
|
||||
return
|
||||
}
|
||||
log.Log(CHANGE, "Draw() window ready =", ls.ready)
|
||||
ls.window.Draw()
|
||||
ls.ready = true
|
||||
}
|
||||
func (ls *LinuxStatus) Draw2() {
|
||||
if !ls.Ready() {
|
||||
return
|
||||
}
|
||||
log.Log(CHANGE, "draw(ls) ready =", ls.ready)
|
||||
draw(ls)
|
||||
}
|
||||
|
||||
func (ls *LinuxStatus) Show() {
|
||||
if !ls.Ready() {
|
||||
return
|
||||
|
@ -86,34 +61,3 @@ func (ls *LinuxStatus) Ready() bool {
|
|||
}
|
||||
return me.ready
|
||||
}
|
||||
|
||||
func (ls *LinuxStatus) Initialized() bool {
|
||||
log.Log(CHANGE, "checking Initialized()")
|
||||
if me == nil {
|
||||
return false
|
||||
}
|
||||
if ls == nil {
|
||||
return false
|
||||
}
|
||||
if ls.parent == nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (ls *LinuxStatus) SetParent(p *gui.Node) {
|
||||
log.Log(CHANGE, "Attempting SetParent")
|
||||
if me == nil {
|
||||
return
|
||||
}
|
||||
if ls == nil {
|
||||
return
|
||||
}
|
||||
if ls.parent == nil {
|
||||
log.Log(CHANGE, "SetParent =", p)
|
||||
ls.parent = p
|
||||
return
|
||||
} else {
|
||||
log.Log(CHANGE, "SetParent was already set to =", ls.parent)
|
||||
}
|
||||
}
|
||||
|
|
3
draw.go
3
draw.go
|
@ -8,9 +8,6 @@ import (
|
|||
// creates the actual widgets.
|
||||
// it's assumed you are always passing in a box
|
||||
func draw(ls *LinuxStatus) {
|
||||
if !ls.Ready() {
|
||||
return
|
||||
}
|
||||
ls.group = ls.window.Box().NewGroup("What Linux Knows It Is")
|
||||
|
||||
ls.grid = ls.group.NewGrid("gridnuts", 2, 2)
|
||||
|
|
26
new.go
26
new.go
|
@ -2,12 +2,13 @@
|
|||
package linuxstatus
|
||||
|
||||
import (
|
||||
"go.wit.com/gui"
|
||||
"go.wit.com/log"
|
||||
|
||||
"go.wit.com/lib/gadgets"
|
||||
)
|
||||
|
||||
func New() *LinuxStatus {
|
||||
func NewLinuxStatus(parent *gui.Node) *LinuxStatus {
|
||||
if me != nil {
|
||||
log.Log(WARN, "You have done New() twice. You can only do this once")
|
||||
return me
|
||||
|
@ -19,21 +20,12 @@ func New() *LinuxStatus {
|
|||
me.ifmap = make(map[int]*IFtype)
|
||||
me.ipmap = make(map[string]*IPtype)
|
||||
|
||||
log.Log(WARN, "Creating the Window")
|
||||
me.window = gadgets.NewBasicWindow(parent, "OS Hostname Details")
|
||||
me.window.Make()
|
||||
draw(me)
|
||||
me.window.Draw()
|
||||
|
||||
me.ready = true
|
||||
return me
|
||||
}
|
||||
|
||||
func (ls *LinuxStatus) InitWindow() {
|
||||
if !ls.Initialized() {
|
||||
log.Log(WARN, "not initalized yet (no parent for the window?)")
|
||||
return
|
||||
}
|
||||
if ls.window != nil {
|
||||
log.Log(WARN, "You already have a window")
|
||||
ls.ready = true
|
||||
return
|
||||
}
|
||||
|
||||
log.Log(WARN, "Creating the Window")
|
||||
ls.window = gadgets.NewBasicWindow(ls.parent, "Linux OS Details")
|
||||
ls.ready = true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue