22 lines
493 B
Go
22 lines
493 B
Go
|
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)
|
||
|
}
|