equal
deleted
inserted
replaced
438 |
438 |
439 if projectOpen is not None: |
439 if projectOpen is not None: |
440 projectOpen = DecodeFileSystemPath(projectOpen, False) |
440 projectOpen = DecodeFileSystemPath(projectOpen, False) |
441 |
441 |
442 if ctr is None and projectOpen is None and self.Config.HasEntry("currenteditedproject"): |
442 if ctr is None and projectOpen is None and self.Config.HasEntry("currenteditedproject"): |
443 projectOpen = DecodeFileSystemPath(self.Config.Read("currenteditedproject")) |
443 try: |
444 if projectOpen == "": |
444 projectOpen = DecodeFileSystemPath(self.Config.Read("currenteditedproject")) |
|
445 if projectOpen == "": |
|
446 projectOpen = None |
|
447 except: |
445 projectOpen = None |
448 projectOpen = None |
446 |
449 |
447 if projectOpen is not None and os.path.isdir(projectOpen): |
450 if projectOpen is not None and os.path.isdir(projectOpen): |
448 self.CTR = ProjectController(self, self.Log) |
451 self.CTR = ProjectController(self, self.Log) |
449 self.Controler = self.CTR |
452 self.Controler = self.CTR |
804 |
807 |
805 def OnNewProjectMenu(self, event): |
808 def OnNewProjectMenu(self, event): |
806 if self.CTR is not None and not self.CheckSaveBeforeClosing(): |
809 if self.CTR is not None and not self.CheckSaveBeforeClosing(): |
807 return |
810 return |
808 |
811 |
809 if not self.Config.HasEntry("lastopenedfolder"): |
812 try: |
|
813 defaultpath = DecodeFileSystemPath(self.Config.Read("lastopenedfolder")) |
|
814 except: |
810 defaultpath = os.path.expanduser("~") |
815 defaultpath = os.path.expanduser("~") |
811 else: |
|
812 defaultpath = DecodeFileSystemPath(self.Config.Read("lastopenedfolder")) |
|
813 |
816 |
814 dialog = wx.DirDialog(self , _("Choose a project"), defaultpath, wx.DD_NEW_DIR_BUTTON) |
817 dialog = wx.DirDialog(self , _("Choose a project"), defaultpath, wx.DD_NEW_DIR_BUTTON) |
815 if dialog.ShowModal() == wx.ID_OK: |
818 if dialog.ShowModal() == wx.ID_OK: |
816 projectpath = dialog.GetPath() |
819 projectpath = dialog.GetPath() |
817 self.Config.Write("lastopenedfolder", |
820 self.Config.Write("lastopenedfolder", |
839 |
842 |
840 def OnOpenProjectMenu(self, event): |
843 def OnOpenProjectMenu(self, event): |
841 if self.CTR is not None and not self.CheckSaveBeforeClosing(): |
844 if self.CTR is not None and not self.CheckSaveBeforeClosing(): |
842 return |
845 return |
843 |
846 |
844 if not self.Config.HasEntry("lastopenedfolder"): |
847 try: |
|
848 defaultpath = DecodeFileSystemPath(self.Config.Read("lastopenedfolder")) |
|
849 except: |
845 defaultpath = os.path.expanduser("~") |
850 defaultpath = os.path.expanduser("~") |
846 else: |
|
847 defaultpath = DecodeFileSystemPath(self.Config.Read("lastopenedfolder")) |
|
848 |
851 |
849 dialog = wx.DirDialog(self , _("Choose a project"), defaultpath, wx.DD_NEW_DIR_BUTTON) |
852 dialog = wx.DirDialog(self , _("Choose a project"), defaultpath, wx.DD_NEW_DIR_BUTTON) |
850 if dialog.ShowModal() == wx.ID_OK: |
853 if dialog.ShowModal() == wx.ID_OK: |
851 self.OpenProject(dialog.GetPath()) |
854 self.OpenProject(dialog.GetPath()) |
852 dialog.Destroy() |
855 dialog.Destroy() |