Beremiz.py
changeset 793 1b24b970a816
parent 790 52d3a084d2b2
child 797 61280a7d9ff2
equal deleted inserted replaced
792:fd113777d1ae 793:1b24b970a816
   650             self.FileMenu.Enable(wx.ID_SAVEAS, False)
   650             self.FileMenu.Enable(wx.ID_SAVEAS, False)
   651             MenuToolBar.EnableTool(wx.ID_SAVEAS, False)
   651             MenuToolBar.EnableTool(wx.ID_SAVEAS, False)
   652             self.FileMenu.Enable(wx.ID_CLOSE_ALL, False)
   652             self.FileMenu.Enable(wx.ID_CLOSE_ALL, False)
   653     
   653     
   654     def RefreshRecentProjectsMenu(self):
   654     def RefreshRecentProjectsMenu(self):
   655         recent_projects = map(DecodeFileSystemPath, 
   655         try:
   656                               self.GetConfigEntry("RecentProjects", []))
   656             recent_projects = map(DecodeFileSystemPath, 
       
   657                                   self.GetConfigEntry("RecentProjects", []))
       
   658         except:
       
   659             recent_projects = []
   657         self.FileMenu.Enable(ID_FILEMENURECENTPROJECTS, len(recent_projects) > 0)
   660         self.FileMenu.Enable(ID_FILEMENURECENTPROJECTS, len(recent_projects) > 0)
   658         for idx, projectpath in enumerate(recent_projects):
   661         for idx, projectpath in enumerate(recent_projects):
   659             text = u'%d: %s' % (idx + 1, projectpath)
   662             text = u'%d: %s' % (idx + 1, projectpath)
   660             
   663             
   661             if idx < self.RecentProjectsMenu.GetMenuItemCount():
   664             if idx < self.RecentProjectsMenu.GetMenuItemCount():
   786         self.Log.flush()
   789         self.Log.flush()
   787         if self.EnableDebug:
   790         if self.EnableDebug:
   788             self.DebugVariablePanel.SetDataProducer(None)
   791             self.DebugVariablePanel.SetDataProducer(None)
   789     
   792     
   790     def RefreshConfigRecentProjects(self, projectpath):
   793     def RefreshConfigRecentProjects(self, projectpath):
   791         recent_projects = map(DecodeFileSystemPath, 
   794         try:
   792                               self.GetConfigEntry("RecentProjects", []))
   795             recent_projects = map(DecodeFileSystemPath, 
       
   796                                   self.GetConfigEntry("RecentProjects", []))
       
   797         except:
       
   798             recent_projects = []
   793         if projectpath in recent_projects:
   799         if projectpath in recent_projects:
   794             recent_projects.remove(projectpath)
   800             recent_projects.remove(projectpath)
   795         recent_projects.insert(0, projectpath)
   801         recent_projects.insert(0, projectpath)
   796         self.Config.Write("RecentProjects", cPickle.dumps(
   802         self.Config.Write("RecentProjects", cPickle.dumps(
   797             map(EncodeFileSystemPath, recent_projects[:MAX_RECENT_PROJECTS])))
   803             map(EncodeFileSystemPath, recent_projects[:MAX_RECENT_PROJECTS])))