laurent@738: laurent@738: import wx laurent@738: Laurent@920: from controls import ProjectPropertiesPanel, VariablePanel Laurent@814: from EditorPanel import EditorPanel Laurent@920: from ConfTreeNodeEditor import ConfTreeNodeEditor laurent@738: laurent@738: class ProjectNodeEditor(ConfTreeNodeEditor): laurent@738: Laurent@920: SHOW_BASE_PARAMS = False laurent@762: ENABLE_REQUIRED = True Laurent@920: CONFNODEEDITOR_TABS = [ Laurent@920: (_("Config variables"), "_create_VariablePanel"), Laurent@920: (_("Project properties"), "_create_ProjectPropertiesPanel")] laurent@738: Laurent@920: def _create_VariablePanel(self, prnt): Laurent@920: self.VariableEditorPanel = VariablePanel(prnt, self, self.Controler, "config", self.Debug) Laurent@920: self.VariableEditorPanel.SetTagName(self.TagName) Laurent@920: Laurent@920: return self.VariableEditorPanel Laurent@920: Laurent@920: def _create_ProjectPropertiesPanel(self, prnt): Laurent@920: self.ProjectProperties = ProjectPropertiesPanel(prnt, self.Controler, self.ParentWindow, self.ENABLE_REQUIRED) laurent@738: Laurent@920: return self.ProjectProperties Laurent@920: laurent@738: def __init__(self, parent, controler, window): laurent@738: configuration = controler.GetProjectMainConfigurationName() laurent@738: if configuration is not None: laurent@738: tagname = controler.ComputeConfigurationName(configuration) laurent@738: else: laurent@738: tagname = "" laurent@738: laurent@743: ConfTreeNodeEditor.__init__(self, parent, controler, window, tagname) Laurent@920: Laurent@1055: buttons_sizer = self.GenerateMethodButtonSizer() Laurent@1055: self.MainSizer.InsertSizer(0, buttons_sizer, 0, border=5, flag=wx.ALL) Laurent@1055: self.MainSizer.Layout() Laurent@1055: Laurent@920: self.VariableEditor = self.VariableEditorPanel laurent@738: laurent@738: def GetTagName(self): laurent@738: return self.Controler.CTNName() laurent@738: Laurent@920: def SetTagName(self, tagname): Laurent@920: self.TagName = tagname Laurent@920: if self.VariableEditor is not None: Laurent@920: self.VariableEditor.SetTagName(tagname) Laurent@920: laurent@738: def GetTitle(self): laurent@815: fullname = _(self.Controler.CTNName()) laurent@738: if self.Controler.CTNTestModified(): laurent@738: return "~%s~" % fullname laurent@738: return fullname laurent@746: laurent@800: def RefreshView(self, variablepanel=True): Laurent@920: ConfTreeNodeEditor.RefreshView(self) Laurent@920: if variablepanel: Laurent@920: self.VariableEditor.RefreshView() Laurent@920: #self.ProjectProperties.RefreshView() laurent@738: laurent@756: def GetBufferState(self): laurent@756: return self.Controler.GetBufferState() laurent@756: laurent@756: def Undo(self): laurent@756: self.Controler.LoadPrevious() laurent@756: self.ParentWindow.CloseTabsWithoutModel() laurent@756: laurent@756: def Redo(self): laurent@756: self.Controler.LoadNext() laurent@756: self.ParentWindow.CloseTabsWithoutModel() laurent@756: