# HG changeset patch # User Edouard Tisserant # Date 1363145695 -32400 # Node ID c8e008b8cefebd92f1fbcb20262ff2458ba304c2 # Parent eee7625de1f75db1c05e662df9845000eec83ffa# Parent 0ba3d9cd61e8f50fb05c8436c8c2f7b270bc8adf RC3 diff -r eee7625de1f7 -r c8e008b8cefe Beremiz.py --- a/Beremiz.py Thu Mar 07 11:47:43 2013 +0900 +++ b/Beremiz.py Wed Mar 13 12:34:55 2013 +0900 @@ -433,7 +433,8 @@ if projectOpen is not None: projectOpen = DecodeFileSystemPath(projectOpen, False) - if ctr is None and projectOpen is None and self.Config.HasEntry("currenteditedproject"): + if (self.EnableSaveProjectState() and ctr is None and + projectOpen is None and self.Config.HasEntry("currenteditedproject")): try: projectOpen = DecodeFileSystemPath(self.Config.Read("currenteditedproject")) if projectOpen == "": @@ -877,7 +878,8 @@ self.RefreshConfigRecentProjects(projectpath) if self.EnableDebug: self.DebugVariablePanel.SetDataProducer(self.CTR) - self.LoadProjectLayout() + if self.EnableSaveProjectState(): + self.LoadProjectLayout() self._Refresh(PROJECTTREE, POUINSTANCEVARIABLESPANEL, LIBRARYTREE) else: self.ResetView() diff -r eee7625de1f7 -r c8e008b8cefe IDEFrame.py --- a/IDEFrame.py Thu Mar 07 11:47:43 2013 +0900 +++ b/IDEFrame.py Wed Mar 13 12:34:55 2013 +0900 @@ -718,6 +718,9 @@ self.RestoreLastLayout() event.Skip() + def EnableSaveProjectState(self): + return False + def GetProjectConfiguration(self): projects = {} try: @@ -887,7 +890,8 @@ except: self.ResetPerspective() - self.LoadProjectLayout() + if self.EnableSaveProjectState(): + self.LoadProjectLayout() self._Refresh(EDITORTOOLBAR) @@ -914,11 +918,12 @@ if pane.IsMaximized(): self.AUIManager.RestorePane(pane) self.Config.Write("perspective", self.AUIManager.SavePerspective()) - - self.SaveProjectLayout() - - for i in xrange(self.TabsOpened.GetPageCount()): - self.SavePageState(self.TabsOpened.GetPage(i)) + + if self.EnableSaveProjectState(): + self.SaveProjectLayout() + + for i in xrange(self.TabsOpened.GetPageCount()): + self.SavePageState(self.TabsOpened.GetPage(i)) self.Config.Flush() @@ -993,7 +998,8 @@ window = self.TabsOpened.GetPage(selected) if window.CheckSaveBeforeClosing(): - self.SavePageState(window) + if self.EnableSaveProjectState(): + self.SavePageState(window) # Refresh all window elements that have changed wx.CallAfter(self._Refresh, TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU) @@ -1855,14 +1861,15 @@ new_window.SetIcon(GetBitmap("DATATYPE")) self.AddPage(new_window, "") if new_window is not None: - project_infos = self.GetProjectConfiguration() - if project_infos.has_key("editors_state"): - if new_window.IsDebugging(): - state = project_infos["editors_state"].get(new_window.GetInstancePath()) - else: - state = project_infos["editors_state"].get(tagname) - if state is not None: - wx.CallAfter(new_window.SetState, state) + if self.EnableSaveProjectState(): + project_infos = self.GetProjectConfiguration() + if project_infos.has_key("editors_state"): + if new_window.IsDebugging(): + state = project_infos["editors_state"].get(new_window.GetInstancePath()) + else: + state = project_infos["editors_state"].get(tagname) + if state is not None: + wx.CallAfter(new_window.SetState, state) openedidx = self.IsOpened(tagname) old_selected = self.TabsOpened.GetSelection() @@ -2066,11 +2073,12 @@ icon = GetBitmap("ACTION", bodytype) if new_window is not None: - project_infos = self.GetProjectConfiguration() - if project_infos.has_key("editors_state"): - state = project_infos["editors_state"].get(instance_path) - if state is not None: - wx.CallAfter(new_window.SetState, state) + if self.EnableSaveProjectState(): + project_infos = self.GetProjectConfiguration() + if project_infos.has_key("editors_state"): + state = project_infos["editors_state"].get(instance_path) + if state is not None: + wx.CallAfter(new_window.SetState, state) new_window.SetIcon(icon) self.AddPage(new_window, "") diff -r eee7625de1f7 -r c8e008b8cefe NativeLib.xml --- a/NativeLib.xml Thu Mar 07 11:47:43 2013 +0900 +++ b/NativeLib.xml Wed Mar 13 12:34:55 2013 +0900 @@ -74,6 +74,7 @@