Project/ProjectSourcesBrowser.py

changeset 541
00e1a5d060c5
parent 538
7f1a56e80124
child 564
b3d966393ba9
equal deleted inserted replaced
540:2631831b4052 541:00e1a5d060c5
801 itm = self.model().item(self.currentIndex()) 801 itm = self.model().item(self.currentIndex())
802 try: 802 try:
803 fn = itm.fileName() 803 fn = itm.fileName()
804 except AttributeError: 804 except AttributeError:
805 fn = itm.dirName() 805 fn = itm.dirName()
806 res = E5MessageBox.question(self, 806 res = E5MessageBox.yesNo(self,
807 self.trUtf8("Class Diagram"), 807 self.trUtf8("Class Diagram"),
808 self.trUtf8("""Include class attributes?"""), 808 self.trUtf8("""Include class attributes?"""),
809 QMessageBox.StandardButtons(\ 809 yesDefault = True)
810 QMessageBox.No | \ 810 self.classDiagram = UMLClassDiagram(fn, self, noAttrs = not res)
811 QMessageBox.Yes),
812 QMessageBox.Yes)
813 self.classDiagram = UMLClassDiagram(fn, self,
814 noAttrs = (res != QMessageBox.Yes))
815 self.classDiagram.show() 811 self.classDiagram.show()
816 812
817 def __showImportsDiagram(self): 813 def __showImportsDiagram(self):
818 """ 814 """
819 Private method to handle the imports diagram context menu action. 815 Private method to handle the imports diagram context menu action.
822 try: 818 try:
823 fn = itm.fileName() 819 fn = itm.fileName()
824 except AttributeError: 820 except AttributeError:
825 fn = itm.dirName() 821 fn = itm.dirName()
826 package = os.path.isdir(fn) and fn or os.path.dirname(fn) 822 package = os.path.isdir(fn) and fn or os.path.dirname(fn)
827 res = E5MessageBox.question(self, 823 res = E5MessageBox.yesNo(self,
828 self.trUtf8("Imports Diagram"), 824 self.trUtf8("Imports Diagram"),
829 self.trUtf8("""Include imports from external modules?"""), 825 self.trUtf8("""Include imports from external modules?"""))
830 QMessageBox.StandardButtons(\
831 QMessageBox.No | \
832 QMessageBox.Yes),
833 QMessageBox.No)
834 self.importsDiagram = ImportsDiagram(package, self, 826 self.importsDiagram = ImportsDiagram(package, self,
835 showExternalImports = (res == QMessageBox.Yes)) 827 showExternalImports = res)
836 self.importsDiagram.show() 828 self.importsDiagram.show()
837 829
838 def __showPackageDiagram(self): 830 def __showPackageDiagram(self):
839 """ 831 """
840 Private method to handle the package diagram context menu action. 832 Private method to handle the package diagram context menu action.
843 try: 835 try:
844 fn = itm.fileName() 836 fn = itm.fileName()
845 except AttributeError: 837 except AttributeError:
846 fn = itm.dirName() 838 fn = itm.dirName()
847 package = os.path.isdir(fn) and fn or os.path.dirname(fn) 839 package = os.path.isdir(fn) and fn or os.path.dirname(fn)
848 res = E5MessageBox.question(self, 840 res = E5MessageBox.yesNo(self,
849 self.trUtf8("Package Diagram"), 841 self.trUtf8("Package Diagram"),
850 self.trUtf8("""Include class attributes?"""), 842 self.trUtf8("""Include class attributes?"""),
851 QMessageBox.StandardButtons(\ 843 yesDefault = True)
852 QMessageBox.No | \ 844 self.packageDiagram = PackageDiagram(package, self, noAttrs = not res)
853 QMessageBox.Yes),
854 QMessageBox.Yes)
855 self.packageDiagram = PackageDiagram(package, self,
856 noAttrs = (res != QMessageBox.Yes))
857 self.packageDiagram.show() 845 self.packageDiagram.show()
858 846
859 def __showApplicationDiagram(self): 847 def __showApplicationDiagram(self):
860 """ 848 """
861 Private method to handle the application diagram context menu action. 849 Private method to handle the application diagram context menu action.
862 """ 850 """
863 res = E5MessageBox.question(self, 851 res = E5MessageBox.yesNo(self,
864 self.trUtf8("Application Diagram"), 852 self.trUtf8("Application Diagram"),
865 self.trUtf8("""Include module names?"""), 853 self.trUtf8("""Include module names?"""),
866 QMessageBox.StandardButtons(\ 854 yesDefault = True)
867 QMessageBox.No | \
868 QMessageBox.Yes),
869 QMessageBox.Yes)
870 self.applicationDiagram = ApplicationDiagram(self.project, self, 855 self.applicationDiagram = ApplicationDiagram(self.project, self,
871 noModules = (res != QMessageBox.Yes)) 856 noModules = not res)
872 self.applicationDiagram.show() 857 self.applicationDiagram.show()

eric ide

mercurial