def removeProject(self,item): itemPath = item.getPath() self.closed.pop(self.projects.index(itemPath)) config.setClosedProjects(self.closed) self.projects.remove(itemPath) self.projectItems.remove(item) config.setProject(self.projects) self.takeTopLevelItem(self.indexOfTopLevelItem(item))
def createProject(self,startDir): if(ospathexists(startDir)): if self.projects != None: if(startDir in self.projects):#will work even if list is empty QMessageBox.about(self, "Already Open","Project Already Open\n"+startDir) return False self.projects.append(startDir) self.addProject(startDir) config.setProject(self.projects) return True #print "adding"+startDir else: #This is important very very important otherwise it will crash if self.projects != None: if(startDir in self.projects): self.projects.remove(startDir) config.setProject(self.projects) QMessageBox.about(self,"Can't Open Project","Project Does Not Exist %s"%startDir) return False