def _load_items(self, items):
     for item in items:
         typeIcon = self._replace_symbol_type.get(item.type, item.type)
         if settings.IS_WINDOWS:
             display_path = item.path
         else:
             display_path = utils.path_with_tilde_homepath(item.path)
         self._root.loadItem(typeIcon, item.name, item.lineno,
                             item.path, display_path, self._colors[item.type])
 def _load_items(self, items):
     for item in items:
         typeIcon = self._replace_symbol_type.get(item.type, item.type)
         if settings.IS_WINDOWS:
             display_path = item.path
         else:
             display_path = utils.path_with_tilde_homepath(item.path)
         self._root.loadItem(typeIcon, item.name, item.lineno, item.path,
                             display_path, self._colors[item.type])
 def add_project(self, project):
     if project not in self.projects:
         self._combo_project.addItem(project.name)
         tooltip = utils.path_with_tilde_homepath(project.path)
         self._combo_project.setToolTip(tooltip)
         index = self._combo_project.count() - 1
         self._combo_project.setItemData(index, project)
         ptree = TreeProjectsWidget(project)
         self._projects_area.addWidget(ptree)
         ptree.closeProject['PyQt_PyObject'].connect(self._close_project)
         pmodel = project.model
         ptree.setModel(pmodel)
         pindex = pmodel.index(pmodel.rootPath())
         ptree.setRootIndex(pindex)
         self.projects.append(ptree)
         self._projects_area.setCurrentWidget(ptree)  # Can be empty widget
         self._combo_project.setCurrentIndex(index)
 def add_project(self, project):
     if project not in self.projects:
         self._combo_project.addItem(project.name)
         tooltip = utils.path_with_tilde_homepath(project.path)
         self._combo_project.setToolTip(tooltip)
         index = self._combo_project.count() - 1
         self._combo_project.setItemData(index, project)
         ptree = TreeProjectsWidget(project)
         self._projects_area.addWidget(ptree)
         ptree.closeProject['PyQt_PyObject'].connect(self._close_project)
         pmodel = project.model
         ptree.setModel(pmodel)
         pindex = pmodel.index(pmodel.rootPath())
         ptree.setRootIndex(pindex)
         self.projects.append(ptree)
         self._projects_area.setCurrentWidget(ptree)  # Can be empty widget
         self._combo_project.setCurrentIndex(index)
Exemple #5
0
    def _update_recent_files_and_projects(self):
        recent_fmenu = self._submenu[(translations.TR_MENU_FILE,
                                      translations.TR_RECENT_FILES)]
        recent_fmenu.clear()
        main_container = IDE.get_service("main_container")
        recent_files = main_container.last_opened_files
        for e, file_path in enumerate(recent_files):
            _file_path = utils.path_with_tilde_homepath(file_path)
            action_text = "&{} | {}".format(e + 1, _file_path)
            action = recent_fmenu.addAction(action_text)
            action.setData(file_path)
            action.triggered.connect(self._open_recent)

        recent_fmenu.setEnabled(bool(recent_files))
        if recent_files:
            recent_fmenu.addSeparator()
            clear_action = recent_fmenu.addAction(translations.TR_CLEAR_THIS_LIST)
            clear_action.triggered.connect(
                main_container.clear_last_opened_files)
 def path(self):
     return utils.path_with_tilde_homepath(self._path)
Exemple #7
0
 def path(self):
     return utils.path_with_tilde_homepath(self._path)