summaryrefslogtreecommitdiff
path: root/tableWindow.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-22 13:44:50 -0600
committerJeff Carr <[email protected]>2025-02-22 13:50:27 -0600
commit7e19f3b9aed6970b671004a4195a1531f75515e5 (patch)
tree66c812150464b7c0910cee1171f53018ff244b3f /tableWindow.go
parent49d2653fd41b1d3caa54950892a3a6d11a5abfff (diff)
rm old code. long live generic protobuf tables
Diffstat (limited to 'tableWindow.go')
-rw-r--r--tableWindow.go100
1 files changed, 0 insertions, 100 deletions
diff --git a/tableWindow.go b/tableWindow.go
deleted file mode 100644
index 089a7dc..0000000
--- a/tableWindow.go
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
-// Use of this source code is governed by the GPL 3.0
-
-package main
-
-import (
- "sync"
-
- "go.wit.com/lib/gadgets"
- "go.wit.com/log"
-
- "go.wit.com/gui"
-)
-
-type tableWindow struct {
- once sync.Once // only init() the window once
- win *gadgets.BasicWindow // the patches window
- stack *gui.Node // the top box set as vertical
- shelf *gui.Node // the first box in the stack, set as horizontal
- grid *gui.Node // the list of available patches
- // summary *patchSummary // summary of current patches
- setgrid *gui.Node // the list of each patchset
-}
-
-// todo: autogenerate these or make them standared 'gui' package functions
-// make this an go interface somehow
-
-// is the window hidden right now?
-func (w *tableWindow) Hidden() bool {
- return w.win.Hidden()
-}
-
-// switches between the window being visable or hidden on the desktop
-func (w *tableWindow) Toggle() {
- if w.Hidden() {
- w.Show()
- } else {
- w.Hide()
- }
-}
-
-// hides the window completely
-func (w *tableWindow) Show() {
- w.win.Show()
-}
-
-func (w *tableWindow) Hide() {
- log.Info("hide window here")
- w.win.Hide()
-}
-
-// should be the first box/widget in the window
-// greys out the window to the user
-func (w *tableWindow) Disable() {
- w.stack.Disable()
-}
-
-func (w *tableWindow) Enable() {
- w.stack.Enable()
-}
-
-// you can only have one of these
-func makeTableWindow() *tableWindow {
- pw := new(tableWindow)
-
- // sync.Once()
- pw.win = gadgets.RawBasicWindow("Table window for ")
- pw.win.Make()
-
- pw.stack = pw.win.Box().NewBox("bw vbox", false)
- // me.reposwin.Draw()
- pw.win.Custom = func() {
- // sets the hidden flag to false so Toggle() works
- pw.win.Hide()
- }
-
- grid := pw.stack.NewGrid("", 0, 0)
-
- grid.NewLabel("Patchset Details:")
- grid.NextRow()
-
- g := pw.stack.NewGroup("PatchSet List")
-
- // make a grid to put the list of git repos that have patches
- // in this particular patchset
- pw.grid = g.NewGrid("", 0, 0)
- pw.grid.NewLabel("hostname")
- pw.grid.NewLabel("cpus")
- pw.grid.NewLabel("Memory")
- pw.grid.NewLabel("distro")
- pw.grid.NewLabel("zood")
- pw.grid.NewLabel("bash")
- pw.grid.NewLabel("age")
- pw.grid.NewLabel("upgrade")
- pw.grid.NextRow()
-
- // add the patches to the grid
- // pw.addPatchset(grid, pset)
- return pw
-}