forged/doGui.go

52 lines
1.0 KiB
Go

// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
// An app to submit patches for the 30 GO GUI repos
import (
"time"
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/shell"
"go.wit.com/log"
)
func debug() {
defer func() {
if r := recover(); r != nil {
gui.Crash(r, "forge debug()")
}
}()
time.Sleep(2 * time.Second)
for {
now := time.Now()
doList()
log.Printf("finished a scan here in (%s)\n", shell.FormatDuration(time.Since(now)))
time.Sleep(90 * time.Second)
}
}
func doGui() {
mainWindow := gadgets.NewGenericWindow("forged: forge.wit.com", "Current Settings")
mainWindow.Custom = func() {
log.Warn("MAIN WINDOW CLOSE")
now := time.Now()
log.Printf("rill repos.Reload() took (%s)\n", shell.FormatDuration(time.Since(now)))
okExit("")
}
drawWindow(mainWindow)
}
func drawWindow(win *gadgets.GenericWindow) {
grid := win.Group.RawGrid()
grid.NewButton("stats", func() {
doList()
})
}