diff options
| author | Jeff Carr <[email protected]> | 2025-02-05 07:24:42 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-05 07:24:42 -0600 |
| commit | e8e36ee802ffe9d7ed6adb35e4de8054c6ec6ef0 (patch) | |
| tree | 518ca80a1a2d0d31edd7f7449df2514e492754bb /logFlag.go | |
| parent | b697978b6939718f2ce349f73da639d01cc7c299 (diff) | |
func name changev0.22.9v0.22.8v0.22.7v0.22.17v0.22.16v0.22.15v0.22.14v0.22.13v0.22.12v0.22.11v0.22.10
Diffstat (limited to 'logFlag.go')
| -rw-r--r-- | logFlag.go | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -32,12 +32,12 @@ type LogFlag struct { // probably a better name than GetValue() func (f *LogFlag) Bool() bool { - if f.lf.Bool() != f.checkbox.Bool() { + if f.lf.Enabled() != f.checkbox.Bool() { log.Error(errors.New("gadget.LogFlag error. actual flag.Bool() does not match checkbox.Bool()")) // set the checkbox to reflect the actual flag value - f.checkbox.SetChecked(f.lf.Bool()) + f.checkbox.SetChecked(f.lf.Enabled()) } - return f.lf.Bool() + return f.lf.Enabled() } func (f *LogFlag) GetValue() bool { @@ -57,10 +57,10 @@ func (f *LogFlag) GetDesc() string { } func (f *LogFlag) SetValue(b bool) { - log.Log(GADGETS, "LogFlag.SetValue() before SetValue() log.flag =", f.lf.Bool(), "checkbox =", f.checkbox.Bool()) + log.Log(GADGETS, "LogFlag.SetValue() before SetValue() log.flag =", f.lf.Enabled(), "checkbox =", f.checkbox.Bool()) f.checkbox.SetChecked(b) f.lf.SetBool(b) - log.Log(GADGETS, "LogFlag.SetValue() after SetValue() log.flag =", f.lf.Bool(), "checkbox =", f.checkbox.Bool()) + log.Log(GADGETS, "LogFlag.SetValue() after SetValue() log.flag =", f.lf.Enabled(), "checkbox =", f.checkbox.Bool()) } // should be RestoreDefault() ? @@ -94,11 +94,11 @@ func NewLogFlag(n *gui.Node, lf *log.LogFlag) *LogFlag { f.checkbox.Custom = func() { if counter == 0 { // store the first clicked value - watcher = f.lf.Bool() + watcher = f.lf.Enabled() } else { // if the value has changed, then everything is fine - if watcher != f.lf.Bool() { - watcher = f.lf.Bool() + if watcher != f.lf.Enabled() { + watcher = f.lf.Enabled() counter = 0 } // this means the value has not changed 3 times @@ -114,7 +114,7 @@ func NewLogFlag(n *gui.Node, lf *log.LogFlag) *LogFlag { f.lf.SetBool(f.checkbox.Bool()) } - f.checkbox.SetChecked(lf.Bool()) + f.checkbox.SetChecked(lf.Enabled()) return &f } |
