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

Method OnCopy

gui/builtinViews/entityEditor.py:114–127  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

112 return False
113
114 def OnCopy(self, event):
115 with TextEntryValidatedDialog(
116 self, self.validator, "Enter a name for your {} copy:".format(self.entityName),
117 "Copy {}".format(self.entityName)
118 ) as dlg:
119 active = self.getActiveEntity()
120 dlg.SetValue("{} Copy".format(active.name))
121 dlg.txtctrl.SetInsertionPointEnd()
122 dlg.CenterOnParent()
123
124 if dlg.ShowModal() == wx.ID_OK:
125 copy = self.DoCopy(active, dlg.txtctrl.GetValue().strip())
126 self.refreshEntityList(copy)
127 wx.PostEvent(self.entityChoices, wx.CommandEvent(wx.wxEVT_COMMAND_CHOICE_SELECTED))
128
129 def OnRename(self, event):
130 with TextEntryValidatedDialog(

Callers

nothing calls this directly

Calls 6

getActiveEntityMethod · 0.95
DoCopyMethod · 0.95
refreshEntityListMethod · 0.95
SetValueMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected