(m managerUI.Manager)
| 348 | } |
| 349 | |
| 350 | func (mui *MasterUI) CloseView(m managerUI.Manager) error { |
| 351 | |
| 352 | mui.gui.DeleteView(m.Name()) |
| 353 | mui.gui.DeleteKeybindings(m.Name()) |
| 354 | nextForFocus := mui.layoutManager.Remove(m) |
| 355 | nextViewName := nextForFocus.Name() |
| 356 | if err := mui.SetCurrentViewOnTop(mui.gui); err != nil { |
| 357 | return merry.Wrap(err).Appendf("SetCurrentViewOnTop viewName:[%v]", nextViewName) |
| 358 | } |
| 359 | |
| 360 | if mui.checkIfUpdatableView(nextForFocus) { |
| 361 | mui.currentDataView = nextForFocus.(masterUIInterface.UpdatableView) |
| 362 | mui.updateHeaderDisplay(mui.gui) |
| 363 | mui.currentDataView.RefreshDisplay(mui.gui) |
| 364 | } |
| 365 | |
| 366 | return nil |
| 367 | } |
| 368 | |
| 369 | func (mui *MasterUI) checkIfUpdatableView(x interface{}) bool { |
| 370 | // Declare a type object representing UpdatableView |
no test coverage detected