Add in logic that required an entity for implant sets and target resists (not needed for character or damage profiles as we have read-only defaults)

This commit is contained in:
blitzmann
2016-03-30 00:03:48 -04:00
parent 1161037092
commit 39b2f87194
4 changed files with 47 additions and 11 deletions

View File

@@ -36,7 +36,7 @@ class ImplantTextValidor(BaseValidator):
return ImplantTextValidor()
def Validate(self, win):
profileEditor = win.Parent
profileEditor = win.parent.Parent
textCtrl = self.GetWindow()
text = textCtrl.GetValue().strip()
@@ -163,9 +163,23 @@ class ImplantSetEditorDlg(wx.Dialog):
self.SetSizer(mainSizer)
self.Layout()
if not self.entityEditor.checkEntitiesExist():
self.Destroy()
return
self.Bind(wx.EVT_CHOICE, self.entityChanged)
self.Import.Bind(wx.EVT_BUTTON, self.importPatterns)
self.Export.Bind(wx.EVT_BUTTON, self.exportPatterns)
self.CenterOnParent()
self.ShowModal()
def entityChanged(self, event):
if not self.entityEditor.checkEntitiesExist():
self.Destroy()
return
def closeEvent(self, event):
self.Destroy()