+ #Check for open files not in any of these projects and add them to a default project
+ def AlreadyInProject(fileName):
+ for projectDocument in docList:
+ if projectDocument.IsFileInProject(fileName):
+ return True
+ return False
+
+ unprojectedFiles = []
+ for document in self._projService.GetDocumentManager().GetDocuments():
+ if not ACTIVEGRID_BASE_IDE and type(document) == ProcessModelEditor.ProcessModelDocument:
+ if not AlreadyInProject(document.GetFilename()):
+ unprojectedFiles.append(document.GetFilename())
+ if type(document) == PythonEditor.PythonDocument:
+ if not AlreadyInProject(document.GetFilename()):
+ unprojectedFiles.append(document.GetFilename())
+
+ if unprojectedFiles:
+ unprojProj = ProjectEditor.ProjectDocument()
+ unprojProj.SetFilename(_("Not in any Project"))
+ unprojProj.AddFiles(unprojectedFiles)
+ docList.append(unprojProj)
+ nameList.append(_("Not in any Project"))
+