author | Laurent Bessard |
Tue, 14 May 2013 22:31:14 +0200 | |
changeset 1140 | 80a91fc91595 |
parent 1055 | da483f620668 |
child 1257 | 4b7ef7ea318f |
permissions | -rw-r--r-- |
738 | 1 |
|
2 |
import wx |
|
3 |
||
920
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
4 |
from controls import ProjectPropertiesPanel, VariablePanel |
814 | 5 |
from EditorPanel import EditorPanel |
920
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
6 |
from ConfTreeNodeEditor import ConfTreeNodeEditor |
738 | 7 |
|
8 |
class ProjectNodeEditor(ConfTreeNodeEditor): |
|
9 |
||
920
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
10 |
SHOW_BASE_PARAMS = False |
762
aaacc83aa86b
Modifying canfestival plugin to following the new Beremiz confnode paradigm
laurent
parents:
756
diff
changeset
|
11 |
ENABLE_REQUIRED = True |
920
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
12 |
CONFNODEEDITOR_TABS = [ |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
13 |
(_("Config variables"), "_create_VariablePanel"), |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
14 |
(_("Project properties"), "_create_ProjectPropertiesPanel")] |
738 | 15 |
|
920
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
16 |
def _create_VariablePanel(self, prnt): |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
17 |
self.VariableEditorPanel = VariablePanel(prnt, self, self.Controler, "config", self.Debug) |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
18 |
self.VariableEditorPanel.SetTagName(self.TagName) |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
19 |
|
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
20 |
return self.VariableEditorPanel |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
21 |
|
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
22 |
def _create_ProjectPropertiesPanel(self, prnt): |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
23 |
self.ProjectProperties = ProjectPropertiesPanel(prnt, self.Controler, self.ParentWindow, self.ENABLE_REQUIRED) |
738 | 24 |
|
920
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
25 |
return self.ProjectProperties |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
26 |
|
738 | 27 |
def __init__(self, parent, controler, window): |
28 |
configuration = controler.GetProjectMainConfigurationName() |
|
29 |
if configuration is not None: |
|
30 |
tagname = controler.ComputeConfigurationName(configuration) |
|
31 |
else: |
|
32 |
tagname = "" |
|
33 |
||
743 | 34 |
ConfTreeNodeEditor.__init__(self, parent, controler, window, tagname) |
920
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
35 |
|
1055 | 36 |
buttons_sizer = self.GenerateMethodButtonSizer() |
37 |
self.MainSizer.InsertSizer(0, buttons_sizer, 0, border=5, flag=wx.ALL) |
|
38 |
self.MainSizer.Layout() |
|
39 |
||
920
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
40 |
self.VariableEditor = self.VariableEditorPanel |
738 | 41 |
|
42 |
def GetTagName(self): |
|
43 |
return self.Controler.CTNName() |
|
44 |
||
920
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
45 |
def SetTagName(self, tagname): |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
46 |
self.TagName = tagname |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
47 |
if self.VariableEditor is not None: |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
48 |
self.VariableEditor.SetTagName(tagname) |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
49 |
|
738 | 50 |
def GetTitle(self): |
815
e4f24593a758
Adding support for extending internationalization to extensions
laurent
parents:
814
diff
changeset
|
51 |
fullname = _(self.Controler.CTNName()) |
738 | 52 |
if self.Controler.CTNTestModified(): |
53 |
return "~%s~" % fullname |
|
54 |
return fullname |
|
746
2e09777a40d3
Fix refresh of ConfTreeNodeEditors content when values change
laurent
parents:
743
diff
changeset
|
55 |
|
800
e9406586bb14
Fix bug when modifying configuration global variable in ProjectNodeEditor
laurent
parents:
762
diff
changeset
|
56 |
def RefreshView(self, variablepanel=True): |
920
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
57 |
ConfTreeNodeEditor.RefreshView(self) |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
58 |
if variablepanel: |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
59 |
self.VariableEditor.RefreshView() |
1499a4d225db
Replaced SplitterWindow in ConfTreeNodeEditor by Notebook
Laurent Bessard
parents:
815
diff
changeset
|
60 |
#self.ProjectProperties.RefreshView() |
738 | 61 |
|
756
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
62 |
def GetBufferState(self): |
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
63 |
return self.Controler.GetBufferState() |
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
64 |
|
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
65 |
def Undo(self): |
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
66 |
self.Controler.LoadPrevious() |
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
67 |
self.ParentWindow.CloseTabsWithoutModel() |
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
68 |
|
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
69 |
def Redo(self): |
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
70 |
self.Controler.LoadNext() |
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
71 |
self.ParentWindow.CloseTabsWithoutModel() |
35cd28825be7
Integrating project properties panel into project window
laurent
parents:
746
diff
changeset
|
72 |