code rearrange

This commit is contained in:
Jeff Carr 2025-05-31 11:35:49 -05:00
parent 715b63b1c8
commit 912c5a9bb9
2 changed files with 59 additions and 40 deletions

59
windowRepos.go Normal file
View File

@ -0,0 +1,59 @@
// 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 (
"fmt"
"os"
"sync"
"time"
"go.wit.com/gui"
"go.wit.com/lib/debugger"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
type stdReposTableWin struct {
sync.Mutex
win *gadgets.GenericWindow // the machines gui window
boxTB *gui.Node // the machines gui parent box widget
TB *gitpb.ReposTable // the gui table buffer
pb *gitpb.Repos // the current repos protobuf
update bool // if the window should be updated
}
func (w *stdReposTableWin) Toggle() {
if w == nil {
return
}
if w.win == nil {
return
}
w.win.Toggle()
}
func makeReposWindowNew() *gadgets.GenericWindow {
win := gadgets.NewGenericWindow("git repos", "Filter")
win.Custom = func() {
// sets the hidden flag to false so Toggle() works
win.Hide()
}
hbox := win.Group.Box().Horizontal()
hbox.NewCheckbox("broken")
hbox.NewCheckbox("dirty")
hbox.NewCheckbox("mine")
hbox.NewButton("fix all", func() {
log.Info("try to fix everything here")
})
t := makeStandardReposGrid(me.forge.Repos)
t.SetParent(win.Bottom)
t.ShowTable()
return win
}

View File

@ -18,25 +18,6 @@ import (
"go.wit.com/log"
)
type stdReposTableWin struct {
sync.Mutex
win *gadgets.GenericWindow // the machines gui window
boxTB *gui.Node // the machines gui parent box widget
TB *gitpb.ReposTable // the gui table buffer
pb *gitpb.Repos // the current repos protobuf
update bool // if the window should be updated
}
func (w *stdReposTableWin) Toggle() {
if w == nil {
return
}
if w.win == nil {
return
}
w.win.Toggle()
}
func makeReposWin() *stdReposTableWin {
rwin := new(stdReposTableWin)
win := gadgets.NewGenericWindow("git repos", "All about git repos")
@ -592,24 +573,3 @@ func addWindowPB(win *gadgets.GenericWindow, pb *gitpb.Repos) *gitpb.ReposTable
t.ShowTable()
return t
}
func makeReposWindowNew() *gadgets.GenericWindow {
win := gadgets.NewGenericWindow("git repos", "Filter")
win.Custom = func() {
// sets the hidden flag to false so Toggle() works
win.Hide()
}
hbox := win.Group.Box().Horizontal()
hbox.NewCheckbox("broken")
hbox.NewCheckbox("dirty")
hbox.NewCheckbox("mine")
hbox.NewButton("fix all", func() {
log.Info("try to fix everything here")
})
t := makeStandardReposGrid(me.forge.Repos)
t.SetParent(win.Bottom)
t.ShowTable()
return win
}