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

Method OnClear

gui/propertyEditor.py:143–161  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

141 writer.writerow([item.ID, override.attrID, override.value])
142
143 def OnClear(self, event):
144 with wx.MessageDialog(
145 self,
146 _t("Are you sure you want to delete all overrides?"),
147 _t("Confirm Delete"),
148 wx.YES | wx.NO | wx.ICON_EXCLAMATION
149 ) as dlg:
150 if dlg.ShowModal() == wx.ID_YES:
151 sMkt = Market.getInstance()
152 items = sMkt.getItemsWithOverrides()
153 # We can't just delete overrides, as loaded items will still have
154 # them assigned. Deleting them from the database won't propagate
155 # them due to the eve/user database disconnect. We must loop through
156 # all items that have overrides and remove them
157 for item in items:
158 for _, x in list(item.overrides.items()):
159 item.deleteOverride(x.attr)
160 self.itemView.updateItems(True)
161 self.pg.Clear()
162
163
164# This is literally a stripped down version of the market.

Callers

nothing calls this directly

Calls 7

getItemsWithOverridesMethod · 0.80
itemsMethod · 0.80
deleteOverrideMethod · 0.80
updateItemsMethod · 0.80
_tFunction · 0.50
getInstanceMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected