diff options
| author | Jeff Carr <[email protected]> | 2024-01-18 01:34:00 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-18 01:34:00 -0600 |
| commit | f3da30a919832f071a120927ceb431d8fd5a6147 (patch) | |
| tree | 2375b5d3409a04909ada20ea49e2a01c2b36ab19 /draw.go | |
| parent | b0ddd6af217a873c66013706372b5d989feffcf3 (diff) | |
fix paths
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'draw.go')
| -rw-r--r-- | draw.go | 48 |
1 files changed, 29 insertions, 19 deletions
@@ -1,9 +1,9 @@ package logsettings -import ( - "go.wit.com/log" +import ( "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() } @@ -37,11 +43,11 @@ func (d *LogSettings) draw() { g = g.NewBox("bw vbox", false) d.buttonG = g - g.NewButton("Redirect STDOUT to /tmp/", func () { + g.NewButton("Redirect STDOUT to /tmp/", func() { log.SetTmp() }) - g.NewButton("restore defaults", func () { + g.NewButton("restore defaults", func() { for _, wg := range myLogGui.groups { for _, f := range wg.flags { f.SetDefault() @@ -49,7 +55,7 @@ func (d *LogSettings) draw() { } }) - g.NewButton("all on", func () { + g.NewButton("all on", func() { for _, wg := range myLogGui.groups { for _, f := range wg.flags { f.Set(true) @@ -57,7 +63,7 @@ func (d *LogSettings) draw() { } }) - g.NewButton("all off", func () { + g.NewButton("all off", func() { for _, wg := range myLogGui.groups { for _, f := range wg.flags { f.Set(false) @@ -65,7 +71,7 @@ func (d *LogSettings) draw() { } }) - g.NewButton("Dump Flags", func () { + g.NewButton("Dump Flags", func() { // ShowDebugValues() log.ShowFlags() for s, wg := range myLogGui.groups { @@ -79,14 +85,14 @@ func (d *LogSettings) draw() { d.flagG = d.win.Box().NewGroup("Subsystem (aka package)") d.flagG = d.flagG.NewBox("bw vbox", false) - g.NewButton("Add all Flags", func () { + g.NewButton("Add all Flags", func() { flags := log.ShowFlags() for _, f := range flags { addFlag(d.flagG, f) } }) - g.NewButton("Close", func () { + g.NewButton("Close", func() { d.Hide() }) @@ -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() @@ -127,11 +137,11 @@ func addFlag(p *gui.Node, newf *log.LogFlag) { } type flagGroup struct { - name string // should be set to the flag.Subsystem + name string // should be set to the flag.Subsystem - parent *gui.Node // where to draw our group - group *gui.Node - grid *gui.Node + parent *gui.Node // where to draw our group + group *gui.Node + grid *gui.Node // the widget for each flag flags []*gadgets.LogFlag |
