eric6/QScintilla/Editor.py

branch
maintenance
changeset 8400
b3eefd7e58d1
parent 8273
698ae46f40a4
parent 8298
83ddb87b3bc1
child 8576
fe1957c69854
--- a/eric6/QScintilla/Editor.py	Sat May 01 14:27:38 2021 +0200
+++ b/eric6/QScintilla/Editor.py	Thu Jun 03 11:39:23 2021 +0200
@@ -2723,7 +2723,7 @@
                 fromLine, fromIndex, toLine, toIndex = self.getSelection()
                 if toIndex == 0:
                     toLine -= 1
-                # Qscintilla seems to print one line more than told
+                # QScintilla seems to print one line more than told
                 res = printer.printRange(self, fromLine, toLine - 1)
             else:
                 res = printer.printRange(self)
@@ -7556,12 +7556,12 @@
         """
         Private method to handle the Class Diagram context menu action.
         """
-        from Graphics.UMLDialog import UMLDialog
+        from Graphics.UMLDialog import UMLDialog, UMLDialogType
         if not self.checkDirty():
             return
         
         self.classDiagram = UMLDialog(
-            UMLDialog.ClassDiagram, self.project, self.fileName,
+            UMLDialogType.CLASS_DIAGRAM, self.project, self.fileName,
             self, noAttrs=False)
         self.classDiagram.show()
         
@@ -7569,7 +7569,7 @@
         """
         Private method to handle the Package Diagram context menu action.
         """
-        from Graphics.UMLDialog import UMLDialog
+        from Graphics.UMLDialog import UMLDialog, UMLDialogType
         if not self.checkDirty():
             return
         
@@ -7583,7 +7583,7 @@
             self.tr("""Include class attributes?"""),
             yesDefault=True)
         self.packageDiagram = UMLDialog(
-            UMLDialog.PackageDiagram, self.project, package,
+            UMLDialogType.PACKAGE_DIAGRAM, self.project, package,
             self, noAttrs=not res)
         self.packageDiagram.show()
         
@@ -7591,20 +7591,17 @@
         """
         Private method to handle the Imports Diagram context menu action.
         """
-        from Graphics.UMLDialog import UMLDialog
+        from Graphics.UMLDialog import UMLDialog, UMLDialogType
         if not self.checkDirty():
             return
         
-        package = (
-            os.path.isdir(self.fileName) and
-            self.fileName or os.path.dirname(self.fileName)
-        )
+        package = os.path.dirname(self.fileName)
         res = E5MessageBox.yesNo(
             self,
             self.tr("Imports Diagram"),
             self.tr("""Include imports from external modules?"""))
         self.importsDiagram = UMLDialog(
-            UMLDialog.ImportsDiagram, self.project, package,
+            UMLDialogType.IMPORTS_DIAGRAM, self.project, package,
             self, showExternalImports=res)
         self.importsDiagram.show()
         
@@ -7612,14 +7609,14 @@
         """
         Private method to handle the Imports Diagram context menu action.
         """
-        from Graphics.UMLDialog import UMLDialog
+        from Graphics.UMLDialog import UMLDialog, UMLDialogType
         res = E5MessageBox.yesNo(
             self,
             self.tr("Application Diagram"),
             self.tr("""Include module names?"""),
             yesDefault=True)
         self.applicationDiagram = UMLDialog(
-            UMLDialog.ApplicationDiagram, self.project,
+            UMLDialogType.APPLICATION_DIAGRAM, self.project,
             self, noModules=not res)
         self.applicationDiagram.show()
     
@@ -7627,9 +7624,9 @@
         """
         Private slot to load a diagram from file.
         """
-        from Graphics.UMLDialog import UMLDialog
+        from Graphics.UMLDialog import UMLDialog, UMLDialogType
         self.loadedDiagram = UMLDialog(
-            UMLDialog.NoDiagram, self.project, parent=self)
+            UMLDialogType.NO_DIAGRAM, self.project, parent=self)
         if self.loadedDiagram.load():
             self.loadedDiagram.show(fromFile=True)
         else:

eric ide

mercurial