login-app: warning if not booted UEFI

This commit is contained in:
nemunaire 2021-02-17 20:25:36 +01:00
commit 1ff63190b2
2 changed files with 28 additions and 17 deletions

View file

@ -0,0 +1,21 @@
package main
import (
"github.com/rivo/tview"
)
func CreateUEFIDialog(app *tview.Application, next func()) {
modal := tview.NewModal().
SetText("Not UEFI boot\nYou should reboot, enter UEFI Setup (F2) and disable Legacy boot").
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)
}