src/eric7/Project/ProjectResourcesBrowser.py

branch
eric7
changeset 10256
1b728f26d1ae
parent 10113
40eb9038d100
child 10398
ef1ea18994d5
equal deleted inserted replaced
10255:a25f95af0a51 10256:1b728f26d1ae
24 from eric7.UI.NotificationWidget import NotificationTypes 24 from eric7.UI.NotificationWidget import NotificationTypes
25 25
26 from .FileCategoryRepositoryItem import FileCategoryRepositoryItem 26 from .FileCategoryRepositoryItem import FileCategoryRepositoryItem
27 from .ProjectBaseBrowser import ProjectBaseBrowser 27 from .ProjectBaseBrowser import ProjectBaseBrowser
28 from .ProjectBrowserModel import ( 28 from .ProjectBrowserModel import (
29 ProjectBrowserDirectoryItem,
30 ProjectBrowserFileItem, 29 ProjectBrowserFileItem,
31 ProjectBrowserSimpleDirectoryItem, 30 ProjectBrowserSimpleDirectoryItem,
32 ) 31 )
33 from .ProjectBrowserRepositoryItem import ProjectBrowserRepositoryItem 32 from .ProjectBrowserRepositoryItem import ProjectBrowserRepositoryItem
34 33
485 484
486 def __addResourceFiles(self): 485 def __addResourceFiles(self):
487 """ 486 """
488 Private method to add resource files to the project. 487 Private method to add resource files to the project.
489 """ 488 """
490 itm = self.model().item(self.currentIndex()) 489 self.project.addFiles("RESOURCES", self.currentDirectory())
491 if isinstance(itm, ProjectBrowserFileItem):
492 dn = os.path.dirname(itm.fileName())
493 elif isinstance(
494 itm, (ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem)
495 ):
496 dn = itm.dirName()
497 else:
498 dn = None
499 self.project.addFiles("RESOURCES", dn)
500 490
501 def __addResourcesDirectory(self): 491 def __addResourcesDirectory(self):
502 """ 492 """
503 Private method to add resource files of a directory to the project. 493 Private method to add resource files of a directory to the project.
504 """ 494 """
505 itm = self.model().item(self.currentIndex()) 495 self.project.addDirectory("RESOURCES", self.currentDirectory())
506 if isinstance(itm, ProjectBrowserFileItem):
507 dn = os.path.dirname(itm.fileName())
508 elif isinstance(
509 itm, (ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem)
510 ):
511 dn = itm.dirName()
512 else:
513 dn = None
514 self.project.addDirectory("RESOURCES", dn)
515 496
516 def _openItem(self): 497 def _openItem(self):
517 """ 498 """
518 Protected slot to handle the open popup menu entry. 499 Protected slot to handle the open popup menu entry.
519 """ 500 """

eric ide

mercurial