summaryrefslogtreecommitdiff
path: root/logFlag.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-05 07:24:42 -0600
committerJeff Carr <[email protected]>2025-02-05 07:24:42 -0600
commite8e36ee802ffe9d7ed6adb35e4de8054c6ec6ef0 (patch)
tree518ca80a1a2d0d31edd7f7449df2514e492754bb /logFlag.go
parentb697978b6939718f2ce349f73da639d01cc7c299 (diff)
Diffstat (limited to 'logFlag.go')
-rw-r--r--logFlag.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/logFlag.go b/logFlag.go
index 67df269..8183894 100644
--- a/logFlag.go
+++ b/logFlag.go
@@ -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
}