ci and general changes
All checks were successful
CI / Lint (pull_request) Successful in 50s
CI / Build (pull_request) Successful in 3m46s
CI / Test (pull_request) Successful in 4m6s

This commit is contained in:
2024-03-11 21:42:16 -05:00
parent be35430727
commit e281fbafdb
4 changed files with 37 additions and 14 deletions

12
main.go
View File

@@ -63,10 +63,12 @@ var cfg *Config
func main() {
if !admin.Admin() {
fmt.Println("not running as administrator relaunching")
if err := admin.RunSelfElevated(); err != nil {
panic(err)
}
os.Exit(0)
return // just incase
}
cfg = loadConfig()
@@ -138,9 +140,13 @@ func fillGrid(grid *fyne.Container, parent fyne.Window) {
grid.Hide()
defer grid.Show()
grid.RemoveAll()
for _, profile := range profiles {
profilename := filepath.Base(profile)
grid.Add(widget.NewButton(profilename, makeIFunc(profile, archive, parent)))
if admin.Admin() {
for _, profile := range profiles {
profilename := filepath.Base(profile)
grid.Add(widget.NewButton(profilename, makeIFunc(profile, archive, parent)))
}
} else {
grid.Add(widget.NewLabel("not running as administrator"))
}
}