This repository has been archived on 2024-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
adlin/pkg/login-app/cmd/dialog-uefi.go

22 lines
571 B
Go

package main
import (
"github.com/rivo/tview"
)
func CreateUEFIDialog(app *tview.Application, next func()) {
modal := tview.NewModal().
SetText("This machine does not boot in UEFI mode!\nYou should reboot now, enter UEFI Setup (F2) and disable Legacy boot. Or choose another machine, that boot in UEFI.").
AddButtons([]string{"Reboot", "Ignore"}).
SetDoneFunc(func(buttonIndex int, buttonLabel string) {
if buttonLabel == "Reboot" {
app.Stop()
} else if buttonLabel == "Ignore" {
next()
}
})
app.SetRoot(modal, true)
app.SetFocus(modal)
}