Factorized some repeated refresh code into a method, to allow customisation.
--- a/BeremizIDE.py Mon Feb 05 16:23:51 2018 +0100
+++ b/BeremizIDE.py Mon Feb 12 11:32:48 2018 +0100
@@ -935,6 +935,10 @@
self._Refresh(TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU)
self.RefreshAll()
+ def RefreshAfterSave(self):
+ self.RefreshAll()
+ self._Refresh(TITLE, FILEMENU, EDITMENU, PAGETITLES)
+
def OnSaveProjectMenu(self, event):
selected = self.TabsOpened.GetSelection()
if selected != -1:
@@ -942,8 +946,7 @@
window.Save()
if self.CTR is not None:
self.CTR.SaveProject()
- self.RefreshAll()
- self._Refresh(TITLE, FILEMENU, EDITMENU, PAGETITLES)
+ self.RefreshAfterSave()
def OnSaveProjectAsMenu(self, event):
selected = self.TabsOpened.GetSelection()
@@ -952,9 +955,8 @@
window.SaveAs()
if self.CTR is not None:
self.CTR.SaveProjectAs()
- self.RefreshAll()
+ self.RefreshAfterSave()
self.RefreshConfigRecentProjects(self.CTR.ProjectPath)
- self._Refresh(TITLE, FILEMENU, EDITMENU, PAGETITLES)
def OnQuitMenu(self, event):
self.Close()