--- a/src/eric7/Project/ProjectSourcesBrowser.py Wed Nov 23 11:09:33 2022 +0100 +++ b/src/eric7/Project/ProjectSourcesBrowser.py Wed Nov 23 16:07:16 2022 +0100 @@ -39,6 +39,7 @@ ProjectBrowserSimpleDirectoryItem, ProjectBrowserSourceType, ) +from .ProjectBrowserRepositoryItem import ProjectBrowserRepositoryItem class ProjectSourcesBrowser(ProjectBaseBrowser): @@ -91,6 +92,17 @@ ), ) + # Add the project browser type to the browser type repository. + projectBrowser.addTypedProjectBrowser( + "sources", + ProjectBrowserRepositoryItem( + projectBrowser=self, + projectBrowserUserString=self.tr("Sources Browser"), + fileCategory="SOURCES", + getIcon=self.getIcon, + ), + ) + # Connect signals of Project. project.prepareRepopulateItem.connect(self._prepareRepopulateItem) project.completeRepopulateItem.connect(self._completeRepopulateItem) @@ -120,6 +132,15 @@ self.applicationDiagram = None self.loadedDiagram = None + def getIcon(self): + """ + Public method to get an icon for the project browser. + + @return icon for the browser + @rtype QIcon + """ + return EricPixmapCache.getIcon("projectSources") + def __closeAllWindows(self): """ Private method to close all project related windows.