If fit is removed and active, the page is deleted. We also refresh the fit of the new current page in case delete fit caused change in stats (projected) todo: move this to the notebook, not the page. We don't want the page being responsible for deleting itself
(self, event)
| 300 | event.Skip() |
| 301 | |
| 302 | def fitRemoved(self, event): |
| 303 | """ |
| 304 | If fit is removed and active, the page is deleted. |
| 305 | We also refresh the fit of the new current page in case |
| 306 | delete fit caused change in stats (projected) |
| 307 | todo: move this to the notebook, not the page. We don't want the page being responsible for deleting itself |
| 308 | """ |
| 309 | pyfalog.debug("FittingView::fitRemoved") |
| 310 | if not self: |
| 311 | event.Skip() |
| 312 | return |
| 313 | if event.fitID == self.getActiveFit(): |
| 314 | pyfalog.debug(" Deleted fit is currently active") |
| 315 | self.parent.DeletePage(self.parent.GetPageIndex(self)) |
| 316 | |
| 317 | try: |
| 318 | # Sometimes there is no active page after deletion, hence the try block |
| 319 | sFit = Fit.getInstance() |
| 320 | |
| 321 | # stopgap for #1384 |
| 322 | fit = sFit.getFit(self.getActiveFit()) |
| 323 | if fit: |
| 324 | sFit.refreshFit(self.getActiveFit()) |
| 325 | wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=(self.activeFitID,))) |
| 326 | except RuntimeError: |
| 327 | pyfalog.warning("Caught dead object") |
| 328 | pass |
| 329 | |
| 330 | event.Skip() |
| 331 | |
| 332 | def fitRenamed(self, event): |
| 333 | if not self: |
nothing calls this directly
no test coverage detected