コード例 #1
0
    def save_recent_projects(self, folder):
        recent_project_list = QSettings(
            resources.SETTINGS_PATH, QSettings.IniFormat).value(
                'recentProjects', {})

        project = nproject.NProject(folder)
        #if already exist on the list update the date time
        if folder in recent_project_list:
            properties = recent_project_list[folder]
            properties["lastopen"] = QDateTime.currentDateTime()
            properties["name"] = project.name
            properties["description"] = project.description
            recent_project_list[folder] = properties
        else:
            recent_project_list[folder] = {
                "name": project.name,
                "description": project.description,
                "isFavorite": False, "lastopen": QDateTime.currentDateTime()}
            #if the length of the project list it's high that 10 then delete
            #the most old
            #TODO: add the length of available projects to setting
            if len(recent_project_list) > 10:
                del recent_project_list[self.find_most_old_open()]
        QSettings(resources.SETTINGS_PATH, QSettings.IniFormat).setValue(
            'recentProjects', recent_project_list)
コード例 #2
0
ファイル: ide.py プロジェクト: maurolguin1/ninja-ide
 def create_project(self, path):
     nproj = nproject.NProject(path)
     self.filesystem.open_project(nproj)
     return nproj
コード例 #3
0
ファイル: ide.py プロジェクト: pgonzalezr/ninja-ide
 def get_project(self, path):
     project = self.__projects.get(path)
     if project is None:
         project = nproject.NProject(path)
         self.__projects[path] = project
     return project