27 from eric7.UI.NotificationWidget import NotificationTypes |
27 from eric7.UI.NotificationWidget import NotificationTypes |
28 |
28 |
29 from .FileCategoryRepositoryItem import FileCategoryRepositoryItem |
29 from .FileCategoryRepositoryItem import FileCategoryRepositoryItem |
30 from .ProjectBaseBrowser import ProjectBaseBrowser |
30 from .ProjectBaseBrowser import ProjectBaseBrowser |
31 from .ProjectBrowserModel import ( |
31 from .ProjectBrowserModel import ( |
32 ProjectBrowserDirectoryItem, |
|
33 ProjectBrowserFileItem, |
32 ProjectBrowserFileItem, |
34 ProjectBrowserSimpleDirectoryItem, |
33 ProjectBrowserSimpleDirectoryItem, |
35 ) |
34 ) |
36 from .ProjectBrowserRepositoryItem import ProjectBrowserRepositoryItem |
35 from .ProjectBrowserRepositoryItem import ProjectBrowserRepositoryItem |
37 |
36 |
534 |
533 |
535 def __addFormFiles(self): |
534 def __addFormFiles(self): |
536 """ |
535 """ |
537 Private method to add form files to the project. |
536 Private method to add form files to the project. |
538 """ |
537 """ |
539 itm = self.model().item(self.currentIndex()) |
538 self.project.addFiles("FORMS", self.currentDirectory()) |
540 if isinstance(itm, ProjectBrowserFileItem): |
|
541 dn = os.path.dirname(itm.fileName()) |
|
542 elif isinstance( |
|
543 itm, (ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem) |
|
544 ): |
|
545 dn = itm.dirName() |
|
546 else: |
|
547 dn = None |
|
548 self.project.addFiles("FORMS", dn) |
|
549 |
539 |
550 def __addFormsDirectory(self): |
540 def __addFormsDirectory(self): |
551 """ |
541 """ |
552 Private method to add form files of a directory to the project. |
542 Private method to add form files of a directory to the project. |
553 """ |
543 """ |
554 itm = self.model().item(self.currentIndex()) |
544 self.project.addDirectory("FORMS", self.currentDirectory()) |
555 if isinstance(itm, ProjectBrowserFileItem): |
|
556 dn = os.path.dirname(itm.fileName()) |
|
557 elif isinstance( |
|
558 itm, (ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem) |
|
559 ): |
|
560 dn = itm.dirName() |
|
561 else: |
|
562 dn = None |
|
563 self.project.addDirectory("FORMS", dn) |
|
564 |
545 |
565 def __openFile(self): |
546 def __openFile(self): |
566 """ |
547 """ |
567 Private slot to handle the Open menu action. |
548 Private slot to handle the Open menu action. |
568 """ |
549 """ |