summaryrefslogtreecommitdiff
path: root/logsettings/settings.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-04 12:23:36 -0600
committerJeff Carr <[email protected]>2024-01-04 12:23:36 -0600
commit51929bdde255954318eb7c41fae97f620a613f78 (patch)
tree4326b70a4de46092a1ce32a72c5dde19414e8e2d /logsettings/settings.go
parent57b8fdc0602db13683979c161665044f38c2003c (diff)
working log window
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'logsettings/settings.go')
-rw-r--r--logsettings/settings.go45
1 files changed, 45 insertions, 0 deletions
diff --git a/logsettings/settings.go b/logsettings/settings.go
new file mode 100644
index 0000000..417673d
--- /dev/null
+++ b/logsettings/settings.go
@@ -0,0 +1,45 @@
+package logsettings
+
+import (
+ "go.wit.com/log"
+ "go.wit.com/gui/gui"
+)
+
+// This initializes the main object
+// You can only have one of these
+func New(p *gui.Node) *LogSettings {
+ if myLogGui != nil {return myLogGui}
+ myLogGui = new(LogSettings)
+ myLogGui.parent = p
+ myLogGui.ready = true
+ myLogGui.hidden = false
+ return myLogGui
+}
+
+func (ls *LogSettings) Set(b bool) {
+ // log.Set(ls.name, b)
+ log.Warn("log.Set() FIXME: not working here anymore")
+ ls.checkbox.Set(b)
+}
+
+// Returns true if the status is valid
+func (d *LogSettings) Ready() bool {
+ if d == nil {return false}
+ if ! d.parent.Ready() {return false}
+ return d.ready
+}
+
+func (d *LogSettings) Update() bool {
+ if ! d.Ready() {return false}
+ return true
+}
+
+func (d *LogSettings) ShowFlags() {
+ log.ShowFlags()
+ return
+}
+
+func (d *LogSettings) SetAll(b bool) {
+ log.SetAll(b)
+ return
+}