Allow to edit target profiles via context menu

This commit is contained in:
DarkPhoenix
2019-08-07 10:27:41 +03:00
parent dd5c95d2f2
commit b330f72326
4 changed files with 38 additions and 6 deletions

View File

@@ -80,8 +80,8 @@ class TargetProfileNameValidator(BaseValidator):
class TargetProfileEntityEditor(EntityEditor):
def __init__(self, parent):
EntityEditor.__init__(self, parent, "Target Profile")
def __init__(self, parent, selected=None):
EntityEditor.__init__(self, parent=parent, entityName="Target Profile", selected=selected)
self.SetEditorValidator(TargetProfileNameValidator)
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
@@ -122,7 +122,7 @@ class TargetProfileEditorDlg(wx.Dialog):
('signatureRadius', ('Signature radius\nLeave blank for infinitely big value', 'm')),
('radius', ('Radius', 'm'))])
def __init__(self, parent):
def __init__(self, parent, selected=None):
wx.Dialog.__init__(
self, parent, id=wx.ID_ANY,
title="Target Profile Editor",
@@ -135,7 +135,7 @@ class TargetProfileEditorDlg(wx.Dialog):
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.entityEditor = TargetProfileEntityEditor(self)
self.entityEditor = TargetProfileEntityEditor(parent=self, selected=selected)
mainSizer.Add(self.entityEditor, 0, wx.ALL | wx.EXPAND, 2)
self.sl = wx.StaticLine(self)