parent
b0ddd6af21
commit
f3da30a919
24
draw.go
24
draw.go
|
@ -1,9 +1,9 @@
|
|||
package logsettings
|
||||
|
||||
import (
|
||||
"go.wit.com/log"
|
||||
"go.wit.com/gui/gui"
|
||||
"go.wit.com/gui/gadgets"
|
||||
"go.wit.com/lib/gadgets"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
// TODO: make sure this works without needing to be shown
|
||||
|
@ -12,18 +12,24 @@ import (
|
|||
// this is a test commit to tag this as v0.10
|
||||
|
||||
func (d *LogSettings) Show() {
|
||||
if ! d.Ready() { return }
|
||||
if !d.Ready() {
|
||||
return
|
||||
}
|
||||
d.win.Show()
|
||||
}
|
||||
|
||||
func (d *LogSettings) Hide() {
|
||||
if ! d.Ready() { return }
|
||||
if !d.Ready() {
|
||||
return
|
||||
}
|
||||
d.win.Hide()
|
||||
}
|
||||
|
||||
// alternates between showing and hiding the window
|
||||
func (d *LogSettings) Toggle() {
|
||||
if ! d.Ready() { return }
|
||||
if !d.Ready() {
|
||||
return
|
||||
}
|
||||
d.win.Toggle()
|
||||
}
|
||||
|
||||
|
@ -98,8 +104,12 @@ func (d *LogSettings) draw() {
|
|||
|
||||
func addFlag(p *gui.Node, newf *log.LogFlag) {
|
||||
var flagWidgets *flagGroup
|
||||
if newf == nil { return }
|
||||
if p == nil { return }
|
||||
if newf == nil {
|
||||
return
|
||||
}
|
||||
if p == nil {
|
||||
return
|
||||
}
|
||||
|
||||
subsys := newf.GetSubsystem()
|
||||
name := newf.GetName()
|
||||
|
|
20
settings.go
20
settings.go
|
@ -1,14 +1,16 @@
|
|||
package logsettings
|
||||
|
||||
import (
|
||||
"go.wit.com/log"
|
||||
"go.wit.com/gui/gui"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
// This initializes the main object
|
||||
// You can only have one of these
|
||||
func New(p *gui.Node) *LogSettings {
|
||||
if myLogGui != nil {return myLogGui}
|
||||
if myLogGui != nil {
|
||||
return myLogGui
|
||||
}
|
||||
myLogGui = new(LogSettings)
|
||||
myLogGui.parent = p
|
||||
myLogGui.groups = make(map[string]*flagGroup)
|
||||
|
@ -19,16 +21,22 @@ func New(p *gui.Node) *LogSettings {
|
|||
|
||||
// Returns true if the status is valid
|
||||
func (d *LogSettings) Ready() bool {
|
||||
if d == nil {return false}
|
||||
if ! d.parent.Ready() {return false}
|
||||
if (d.win == nil) {
|
||||
if d == nil {
|
||||
return false
|
||||
}
|
||||
if !d.parent.Ready() {
|
||||
return false
|
||||
}
|
||||
if d.win == nil {
|
||||
d.draw()
|
||||
}
|
||||
return d.ready
|
||||
}
|
||||
|
||||
func (d *LogSettings) Update() bool {
|
||||
if ! d.Ready() {return false}
|
||||
if !d.Ready() {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package logsettings
|
|||
|
||||
import (
|
||||
"go.wit.com/gui/gui"
|
||||
"go.wit.com/gui/gadgets"
|
||||
"go.wit.com/lib/gadgets"
|
||||
)
|
||||
|
||||
var myLogGui *LogSettings
|
||||
|
|
Loading…
Reference in New Issue