Update showWizardModal to accept an onClose callback.
(pages *tview.Pages, form *tview.Form, app *tview.Application, kind, message string, onClose func())
| 20 | |
| 21 | // Update showWizardModal to accept an onClose callback. |
| 22 | func 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 |
no test coverage detected