MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / showWizardModal

Function showWizardModal

internal/ui/components/config_wizard.go:22–43  ·  view source on GitHub ↗

Update showWizardModal to accept an onClose callback.

(pages *tview.Pages, form *tview.Form, app *tview.Application, kind, message string, onClose func())

Source from the content-addressed store, hash-verified

20
21// Update showWizardModal to accept an onClose callback.
22func showWizardModal(pages *tview.Pages, form *tview.Form, app *tview.Application, kind, message string, onClose func()) {
23 cb := func() {
24 pages.RemovePage("modal")
25 pages.SwitchToPage("form")
26 app.SetFocus(form)
27
28 if onClose != nil {
29 onClose()
30 }
31 }
32
33 var modal *tview.Modal
34
35 if kind == "error" {
36 modal = CreateErrorDialog("Error", message, cb)
37 } else {
38 modal = CreateInfoDialog("Info", message, cb)
39 }
40
41 pages.AddPage("modal", modal, false, true)
42 pages.SwitchToPage("modal")
43}
44
45// (removed) FilepathBase is removed in favor of filepath.Dir which is OS-agnostic
46

Callers 2

NewConfigWizardPageFunction · 0.85

Calls 3

CreateErrorDialogFunction · 0.85
CreateInfoDialogFunction · 0.85
SetFocusMethod · 0.65

Tested by

no test coverage detected