MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / fitChanged

Method fitChanged

gui/builtinAdditionPanes/notesView.py:38–61  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

36 event.Skip()
37
38 def fitChanged(self, event):
39 event.Skip()
40 activeFitID = self.mainFrame.getActiveFit()
41 if activeFitID is not None and activeFitID not in event.fitIDs:
42 return
43
44 sFit = Fit.getInstance()
45 fit = sFit.getFit(activeFitID)
46
47 self.changeTimer.Stop() # cancel any pending timers
48
49 self.Parent.Parent.DisablePage(self, not fit or fit.isStructure)
50
51 # when switching fits, ensure that we save the notes for the previous fit
52 if self.lastFitId is not None:
53 sFit.editNotes(self.lastFitId, self.editNotes.GetValue())
54
55 if activeFitID is None and self.lastFitId is not None:
56 self.lastFitId = None
57 return
58 elif activeFitID != self.lastFitId:
59 self.lastFitId = activeFitID
60 self.editNotes.ChangeValue(fit.notes or "")
61 wx.PostEvent(self.mainFrame, GE.FitNotesChanged())
62
63 def onText(self, event):
64 # delay the save so we're not writing to sqlite on every keystroke

Callers

nothing calls this directly

Calls 8

getFitMethod · 0.80
StopMethod · 0.80
DisablePageMethod · 0.80
editNotesMethod · 0.80
getActiveFitMethod · 0.45
getInstanceMethod · 0.45
GetValueMethod · 0.45
ChangeValueMethod · 0.45

Tested by

no test coverage detected