Fri, 30 Apr 2021 19:54:20 +0200
Modernized some more code.
--- a/eric6/APIs/Python3/eric6.api Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/APIs/Python3/eric6.api Fri Apr 30 19:54:20 2021 +0200 @@ -1312,10 +1312,7 @@ eric6.E5Gui.E5OverrideCursor.E5OverrideCursor?1(cursorShape=Qt.CursorShape.WaitCursor) eric6.E5Gui.E5OverrideCursor.E5OverrideCursorProcess?1(parent=None, cursorShape=Qt.CursorShape.WaitCursor) eric6.E5Gui.E5OverrideCursor.E5OverridenCursor?1() -eric6.E5Gui.E5PassivePopup.DEFAULT_POPUP_TIME?7 -eric6.E5Gui.E5PassivePopup.DEFAULT_POPUP_TYPE?7 -eric6.E5Gui.E5PassivePopup.E5PassivePopup.Boxed?7 -eric6.E5Gui.E5PassivePopup.E5PassivePopup.Custom?7 +eric6.E5Gui.E5PassivePopup.E5PassivePopup.DefaultPopupTime?7 eric6.E5Gui.E5PassivePopup.E5PassivePopup.clicked?7 eric6.E5Gui.E5PassivePopup.E5PassivePopup.getCustomData?4(key) eric6.E5Gui.E5PassivePopup.E5PassivePopup.hideEvent?4(evt) @@ -1327,8 +1324,10 @@ eric6.E5Gui.E5PassivePopup.E5PassivePopup.show?4(p=None) eric6.E5Gui.E5PassivePopup.E5PassivePopup.timeout?4() eric6.E5Gui.E5PassivePopup.E5PassivePopup.view?4() -eric6.E5Gui.E5PassivePopup.E5PassivePopup?1(parent=None) -eric6.E5Gui.E5PassivePopup.POPUP_FLAGS?7 +eric6.E5Gui.E5PassivePopup.E5PassivePopup?1(style=E5PassivePopupStyle.BOXED, parent=None) +eric6.E5Gui.E5PassivePopup.E5PassivePopupStyle.BOXED?7 +eric6.E5Gui.E5PassivePopup.E5PassivePopupStyle.CUSTOM?7 +eric6.E5Gui.E5PassivePopup.E5PassivePopupStyle.STYLED?7 eric6.E5Gui.E5PasswordMeter.E5PasswordMeter.checkPasswordStrength?4(password) eric6.E5Gui.E5PasswordMeter.E5PasswordMeter.setMaximum?4(value) eric6.E5Gui.E5PasswordMeter.E5PasswordMeter.setMinimum?4(value) @@ -1959,20 +1958,20 @@ eric6.Graphics.AssociationItem.AssociationItem.parseAssociationItemDataString?4(data) eric6.Graphics.AssociationItem.AssociationItem.unassociate?4() eric6.Graphics.AssociationItem.AssociationItem.widgetMoved?4() -eric6.Graphics.AssociationItem.AssociationItem?1(itemA, itemB, assocType=Normal, topToBottom=False, colors=None, parent=None) -eric6.Graphics.AssociationItem.Center?7 -eric6.Graphics.AssociationItem.East?7 -eric6.Graphics.AssociationItem.Generalisation?7 -eric6.Graphics.AssociationItem.Imports?7 -eric6.Graphics.AssociationItem.NoRegion?7 -eric6.Graphics.AssociationItem.Normal?7 -eric6.Graphics.AssociationItem.North?7 -eric6.Graphics.AssociationItem.NorthEast?7 -eric6.Graphics.AssociationItem.NorthWest?7 -eric6.Graphics.AssociationItem.South?7 -eric6.Graphics.AssociationItem.SouthEast?7 -eric6.Graphics.AssociationItem.SouthWest?7 -eric6.Graphics.AssociationItem.West?7 +eric6.Graphics.AssociationItem.AssociationItem?1(itemA, itemB, assocType=AssociationType.NORMAL, topToBottom=False, colors=None, parent=None) +eric6.Graphics.AssociationItem.AssociationPointRegion.CENTER?7 +eric6.Graphics.AssociationItem.AssociationPointRegion.EAST?7 +eric6.Graphics.AssociationItem.AssociationPointRegion.NORTH?7 +eric6.Graphics.AssociationItem.AssociationPointRegion.NORTH_EAST?7 +eric6.Graphics.AssociationItem.AssociationPointRegion.NORTH_WEST?7 +eric6.Graphics.AssociationItem.AssociationPointRegion.NO_REGION?7 +eric6.Graphics.AssociationItem.AssociationPointRegion.SOUTH?7 +eric6.Graphics.AssociationItem.AssociationPointRegion.SOUTH_EAST?7 +eric6.Graphics.AssociationItem.AssociationPointRegion.SOUTH_WEST?7 +eric6.Graphics.AssociationItem.AssociationPointRegion.WEST?7 +eric6.Graphics.AssociationItem.AssociationType.GENERALISATION?7 +eric6.Graphics.AssociationItem.AssociationType.IMPORTS?7 +eric6.Graphics.AssociationItem.AssociationType.NORMAL?7 eric6.Graphics.ClassItem.ClassItem.ItemType?7 eric6.Graphics.ClassItem.ClassItem.buildItemDataString?4() eric6.Graphics.ClassItem.ClassItem.isExternal?4() @@ -9172,6 +9171,7 @@ eric6.UI.BrowserModel.BrowserFileItem.isCythonFile?4() eric6.UI.BrowserModel.BrowserFileItem.isDFile?4() eric6.UI.BrowserModel.BrowserFileItem.isDesignerFile?4() +eric6.UI.BrowserModel.BrowserFileItem.isEricGraphicsFile?4() eric6.UI.BrowserModel.BrowserFileItem.isIdlFile?4() eric6.UI.BrowserModel.BrowserFileItem.isJavaScriptFile?4() eric6.UI.BrowserModel.BrowserFileItem.isLinguistFile?4()
--- a/eric6/APIs/Python3/eric6.bas Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/APIs/Python3/eric6.bas Fri Apr 30 19:54:20 2021 +0200 @@ -27,6 +27,8 @@ ArgumentsError RuntimeError ArrayResolver BaseResolver AssociationItem E5ArrowItem +AssociationPointRegion enum.Enum +AssociationType enum.Enum Attribute ClbrBaseClasses.Attribute VisibilityMixin AuthenticationDialog QDialog Ui_AuthenticationDialog AutoSaver QObject @@ -212,6 +214,7 @@ E5OverrideCursorProcess QProcess E5OverridenCursor contextlib.AbstractContextManager E5PassivePopup QFrame +E5PassivePopupStyle enum.Enum E5PasswordMeter QProgressBar E5PathPicker E5PathPickerBase E5PathPickerBase QWidget
--- a/eric6/Documentation/Help/source.qhp Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Documentation/Help/source.qhp Fri Apr 30 19:54:20 2021 +0200 @@ -1810,6 +1810,8 @@ <keyword name="AssociationItem.parseAssociationItemDataString" id="AssociationItem.parseAssociationItemDataString" ref="eric6.Graphics.AssociationItem.html#AssociationItem.parseAssociationItemDataString" /> <keyword name="AssociationItem.unassociate" id="AssociationItem.unassociate" ref="eric6.Graphics.AssociationItem.html#AssociationItem.unassociate" /> <keyword name="AssociationItem.widgetMoved" id="AssociationItem.widgetMoved" ref="eric6.Graphics.AssociationItem.html#AssociationItem.widgetMoved" /> + <keyword name="AssociationPointRegion" id="AssociationPointRegion" ref="eric6.Graphics.AssociationItem.html#AssociationPointRegion" /> + <keyword name="AssociationType" id="AssociationType" ref="eric6.Graphics.AssociationItem.html#AssociationType" /> <keyword name="AstUtilities (Module)" id="AstUtilities (Module)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.AstUtilities.html" /> <keyword name="AsyncFile" id="AsyncFile" ref="eric6.DebugClients.Python.AsyncFile.html#AsyncFile" /> <keyword name="AsyncFile (Constructor)" id="AsyncFile (Constructor)" ref="eric6.DebugClients.Python.AsyncFile.html#AsyncFile.__init__" /> @@ -2255,6 +2257,7 @@ <keyword name="BrowserFileItem.isCythonFile" id="BrowserFileItem.isCythonFile" ref="eric6.UI.BrowserModel.html#BrowserFileItem.isCythonFile" /> <keyword name="BrowserFileItem.isDFile" id="BrowserFileItem.isDFile" ref="eric6.UI.BrowserModel.html#BrowserFileItem.isDFile" /> <keyword name="BrowserFileItem.isDesignerFile" id="BrowserFileItem.isDesignerFile" ref="eric6.UI.BrowserModel.html#BrowserFileItem.isDesignerFile" /> + <keyword name="BrowserFileItem.isEricGraphicsFile" id="BrowserFileItem.isEricGraphicsFile" ref="eric6.UI.BrowserModel.html#BrowserFileItem.isEricGraphicsFile" /> <keyword name="BrowserFileItem.isIdlFile" id="BrowserFileItem.isIdlFile" ref="eric6.UI.BrowserModel.html#BrowserFileItem.isIdlFile" /> <keyword name="BrowserFileItem.isJavaScriptFile" id="BrowserFileItem.isJavaScriptFile" ref="eric6.UI.BrowserModel.html#BrowserFileItem.isJavaScriptFile" /> <keyword name="BrowserFileItem.isLinguistFile" id="BrowserFileItem.isLinguistFile" ref="eric6.UI.BrowserModel.html#BrowserFileItem.isLinguistFile" /> @@ -4370,6 +4373,7 @@ <keyword name="E5PassivePopup.show" id="E5PassivePopup.show" ref="eric6.E5Gui.E5PassivePopup.html#E5PassivePopup.show" /> <keyword name="E5PassivePopup.timeout" id="E5PassivePopup.timeout" ref="eric6.E5Gui.E5PassivePopup.html#E5PassivePopup.timeout" /> <keyword name="E5PassivePopup.view" id="E5PassivePopup.view" ref="eric6.E5Gui.E5PassivePopup.html#E5PassivePopup.view" /> + <keyword name="E5PassivePopupStyle" id="E5PassivePopupStyle" ref="eric6.E5Gui.E5PassivePopup.html#E5PassivePopupStyle" /> <keyword name="E5PasswordMeter" id="E5PasswordMeter" ref="eric6.E5Gui.E5PasswordMeter.html#E5PasswordMeter" /> <keyword name="E5PasswordMeter (Constructor)" id="E5PasswordMeter (Constructor)" ref="eric6.E5Gui.E5PasswordMeter.html#E5PasswordMeter.__init__" /> <keyword name="E5PasswordMeter (Module)" id="E5PasswordMeter (Module)" ref="eric6.E5Gui.E5PasswordMeter.html" /> @@ -15482,7 +15486,6 @@ <keyword name="UMLDialog (Constructor)" id="UMLDialog (Constructor)" ref="eric6.Graphics.UMLDialog.html#UMLDialog.__init__" /> <keyword name="UMLDialog (Module)" id="UMLDialog (Module)" ref="eric6.Graphics.UMLDialog.html" /> <keyword name="UMLDialog.__diagramBuilder" id="UMLDialog.__diagramBuilder" ref="eric6.Graphics.UMLDialog.html#UMLDialog.__diagramBuilder" /> - <keyword name="UMLDialog.__diagramTypeString" id="UMLDialog.__diagramTypeString" ref="eric6.Graphics.UMLDialog.html#UMLDialog.__diagramTypeString" /> <keyword name="UMLDialog.__initActions" id="UMLDialog.__initActions" ref="eric6.Graphics.UMLDialog.html#UMLDialog.__initActions" /> <keyword name="UMLDialog.__initToolBars" id="UMLDialog.__initToolBars" ref="eric6.Graphics.UMLDialog.html#UMLDialog.__initToolBars" /> <keyword name="UMLDialog.__relayout" id="UMLDialog.__relayout" ref="eric6.Graphics.UMLDialog.html#UMLDialog.__relayout" />
--- a/eric6/Documentation/Source/eric6.E5Gui.E5PassivePopup.html Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Documentation/Source/eric6.E5Gui.E5PassivePopup.html Fri Apr 30 19:54:20 2021 +0200 @@ -29,7 +29,7 @@ <h3>Global Attributes</h3> <table> -<tr><td>DEFAULT_POPUP_TIME</td></tr><tr><td>DEFAULT_POPUP_TYPE</td></tr><tr><td>POPUP_FLAGS</td></tr> +<tr><td>None</td></tr> </table> <h3>Classes</h3> @@ -39,6 +39,10 @@ <td><a href="#E5PassivePopup">E5PassivePopup</a></td> <td>Class implementing dialog-like popup that displays messages without interrupting the user.</td> </tr> +<tr> +<td><a href="#E5PassivePopupStyle">E5PassivePopupStyle</a></td> +<td>Class defining the popup styles.</td> +</tr> </table> <h3>Functions</h3> @@ -67,7 +71,7 @@ <h3>Class Attributes</h3> <table> -<tr><td>Boxed</td></tr><tr><td>Custom</td></tr> +<tr><td>DefaultPopupTime</td></tr> </table> <h3>Class Methods</h3> @@ -147,16 +151,20 @@ <a NAME="E5PassivePopup.__init__" ID="E5PassivePopup.__init__"></a> <h4>E5PassivePopup (Constructor)</h4> -<b>E5PassivePopup</b>(<i>parent=None</i>) +<b>E5PassivePopup</b>(<i>style=E5PassivePopupStyle.BOXED, parent=None</i>) <p> Constructor </p> <dl> -<dt><i>parent</i></dt> +<dt><i>style</i> (E5PassivePopupStyle)</dt> <dd> -reference to the parent widget (QWidget) +style of the popup +</dd> +<dt><i>parent</i> (QWidget)</dt> +<dd> +reference to the parent widget </dd> </dl> <a NAME="E5PassivePopup.__calculateNearbyPoint" ID="E5PassivePopup.__calculateNearbyPoint"></a> @@ -379,4 +387,36 @@ </dl> <div align="right"><a href="#top">Up</a></div> <hr /> +<hr /> +<a NAME="E5PassivePopupStyle" ID="E5PassivePopupStyle"></a> +<h2>E5PassivePopupStyle</h2> + +<p> + Class defining the popup styles. +</p> +<h3>Derived from</h3> +enum.Enum +<h3>Class Attributes</h3> + +<table> +<tr><td>BOXED</td></tr><tr><td>CUSTOM</td></tr><tr><td>STYLED</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /> </body></html> \ No newline at end of file
--- a/eric6/Documentation/Source/eric6.Graphics.AssociationItem.html Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Documentation/Source/eric6.Graphics.AssociationItem.html Fri Apr 30 19:54:20 2021 +0200 @@ -28,7 +28,7 @@ <h3>Global Attributes</h3> <table> -<tr><td>Center</td></tr><tr><td>East</td></tr><tr><td>Generalisation</td></tr><tr><td>Imports</td></tr><tr><td>NoRegion</td></tr><tr><td>Normal</td></tr><tr><td>North</td></tr><tr><td>NorthEast</td></tr><tr><td>NorthWest</td></tr><tr><td>South</td></tr><tr><td>SouthEast</td></tr><tr><td>SouthWest</td></tr><tr><td>West</td></tr> +<tr><td>None</td></tr> </table> <h3>Classes</h3> @@ -38,6 +38,14 @@ <td><a href="#AssociationItem">AssociationItem</a></td> <td>Class implementing a graphics item for an association between two items.</td> </tr> +<tr> +<td><a href="#AssociationPointRegion">AssociationPointRegion</a></td> +<td>Class defining the regions for an association end point.</td> +</tr> +<tr> +<td><a href="#AssociationType">AssociationType</a></td> +<td>Class defining the association types.</td> +</tr> </table> <h3>Functions</h3> @@ -155,29 +163,24 @@ </dl> <a NAME="AssociationItem.__init__" ID="AssociationItem.__init__"></a> <h4>AssociationItem (Constructor)</h4> -<b>AssociationItem</b>(<i>itemA, itemB, assocType=Normal, topToBottom=False, colors=None, parent=None</i>) +<b>AssociationItem</b>(<i>itemA, itemB, assocType=AssociationType.NORMAL, topToBottom=False, colors=None, parent=None</i>) <p> Constructor </p> <dl> -<dt><i>itemA</i></dt> +<dt><i>itemA</i> (UMLItem)</dt> <dd> first widget of the association </dd> -<dt><i>itemB</i></dt> +<dt><i>itemB</i> (UMLItem)</dt> <dd> second widget of the association </dd> -<dt><i>assocType</i></dt> +<dt><i>assocType</i> (AssociationType)</dt> <dd> -type of the association. This must be one of - <ul> - <li>Normal (default)</li> - <li>Generalisation</li> - <li>Imports</li> - </ul> +type of the association </dd> <dt><i>topToBottom</i> (bool)</dt> <dd> @@ -452,4 +455,68 @@ </p> <div align="right"><a href="#top">Up</a></div> <hr /> +<hr /> +<a NAME="AssociationPointRegion" ID="AssociationPointRegion"></a> +<h2>AssociationPointRegion</h2> + +<p> + Class defining the regions for an association end point. +</p> +<h3>Derived from</h3> +enum.Enum +<h3>Class Attributes</h3> + +<table> +<tr><td>CENTER</td></tr><tr><td>EAST</td></tr><tr><td>NORTH</td></tr><tr><td>NORTH_EAST</td></tr><tr><td>NORTH_WEST</td></tr><tr><td>NO_REGION</td></tr><tr><td>SOUTH</td></tr><tr><td>SOUTH_EAST</td></tr><tr><td>SOUTH_WEST</td></tr><tr><td>WEST</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="AssociationType" ID="AssociationType"></a> +<h2>AssociationType</h2> + +<p> + Class defining the association types. +</p> +<h3>Derived from</h3> +enum.Enum +<h3>Class Attributes</h3> + +<table> +<tr><td>GENERALISATION</td></tr><tr><td>IMPORTS</td></tr><tr><td>NORMAL</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /> </body></html> \ No newline at end of file
--- a/eric6/Documentation/Source/eric6.Graphics.UMLDialog.html Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Documentation/Source/eric6.Graphics.UMLDialog.html Fri Apr 30 19:54:20 2021 +0200 @@ -77,10 +77,6 @@ <td>Private method to instantiate a diagram builder object.</td> </tr> <tr> -<td><a href="#UMLDialog.__diagramTypeString">__diagramTypeString</a></td> -<td>Private method to generate a readable string for the diagram type.</td> -</tr> -<tr> <td><a href="#UMLDialog.__initActions">__initActions</a></td> <td>Private slot to initialize the actions.</td> </tr> @@ -192,19 +188,6 @@ raised to indicate an illegal diagram type </dd> </dl> -<a NAME="UMLDialog.__diagramTypeString" ID="UMLDialog.__diagramTypeString"></a> -<h4>UMLDialog.__diagramTypeString</h4> -<b>__diagramTypeString</b>(<i></i>) - -<p> - Private method to generate a readable string for the diagram type. -</p> -<dl> -<dt>Return:</dt> -<dd> -readable type string (string) -</dd> -</dl> <a NAME="UMLDialog.__initActions" ID="UMLDialog.__initActions"></a> <h4>UMLDialog.__initActions</h4> <b>__initActions</b>(<i></i>)
--- a/eric6/Documentation/Source/eric6.UI.BrowserModel.html Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Documentation/Source/eric6.UI.BrowserModel.html Fri Apr 30 19:54:20 2021 +0200 @@ -916,6 +916,10 @@ <td>Public method to check, if this file is a Qt-Designer file.</td> </tr> <tr> +<td><a href="#BrowserFileItem.isEricGraphicsFile">isEricGraphicsFile</a></td> +<td>Public method to check, if this is an eric graphics file.</td> +</tr> +<tr> <td><a href="#BrowserFileItem.isIdlFile">isIdlFile</a></td> <td>Public method to check, if this file is a CORBA IDL file.</td> </tr> @@ -1089,7 +1093,32 @@ <dl> <dt>Return:</dt> <dd> -flag indicating a Qt-Designer file (boolean) +flag indicating a Qt-Designer file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> +<a NAME="BrowserFileItem.isEricGraphicsFile" ID="BrowserFileItem.isEricGraphicsFile"></a> +<h4>BrowserFileItem.isEricGraphicsFile</h4> +<b>isEricGraphicsFile</b>(<i></i>) + +<p> + Public method to check, if this is an eric graphics file. +</p> +<dl> +<dt>Return:</dt> +<dd> +flag indicating an eric graphics file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <a NAME="BrowserFileItem.isIdlFile" ID="BrowserFileItem.isIdlFile"></a> @@ -1102,7 +1131,13 @@ <dl> <dt>Return:</dt> <dd> -flag indicating a CORBA IDL file (boolean) +flag indicating a CORBA IDL file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <a NAME="BrowserFileItem.isJavaScriptFile" ID="BrowserFileItem.isJavaScriptFile"></a> @@ -1115,7 +1150,13 @@ <dl> <dt>Return:</dt> <dd> -flag indicating a JavaScript file (boolean) +flag indicating a JavaScript file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <a NAME="BrowserFileItem.isLinguistFile" ID="BrowserFileItem.isLinguistFile"></a> @@ -1128,7 +1169,13 @@ <dl> <dt>Return:</dt> <dd> -flag indicating a Qt-Linguist file (boolean) +flag indicating a Qt-Linguist file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <a NAME="BrowserFileItem.isMultiProjectFile" ID="BrowserFileItem.isMultiProjectFile"></a> @@ -1141,7 +1188,13 @@ <dl> <dt>Return:</dt> <dd> -flag indicating an eric project file (boolean) +flag indicating an eric project file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <a NAME="BrowserFileItem.isPixmapFile" ID="BrowserFileItem.isPixmapFile"></a> @@ -1154,7 +1207,13 @@ <dl> <dt>Return:</dt> <dd> -flag indicating a pixmap file (boolean) +flag indicating a pixmap file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <a NAME="BrowserFileItem.isProjectFile" ID="BrowserFileItem.isProjectFile"></a> @@ -1167,7 +1226,13 @@ <dl> <dt>Return:</dt> <dd> -flag indicating an eric project file (boolean) +flag indicating an eric project file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <a NAME="BrowserFileItem.isProtobufFile" ID="BrowserFileItem.isProtobufFile"></a> @@ -1218,7 +1283,13 @@ <dl> <dt>Return:</dt> <dd> -flag indicating a Qt-Resources file (boolean) +flag indicating a Qt-Resources file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <a NAME="BrowserFileItem.isRubyFile" ID="BrowserFileItem.isRubyFile"></a> @@ -1231,7 +1302,13 @@ <dl> <dt>Return:</dt> <dd> -flag indicating a Ruby file (boolean) +flag indicating a Ruby file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <a NAME="BrowserFileItem.isSvgFile" ID="BrowserFileItem.isSvgFile"></a> @@ -1244,7 +1321,13 @@ <dl> <dt>Return:</dt> <dd> -flag indicating a SVG file (boolean) +flag indicating a SVG file +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool </dd> </dl> <a NAME="BrowserFileItem.lessThan" ID="BrowserFileItem.lessThan"></a>
--- a/eric6/Graphics/ApplicationDiagramBuilder.py Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Graphics/ApplicationDiagramBuilder.py Fri Apr 30 19:54:20 2021 +0200 @@ -105,46 +105,44 @@ sceneRect = self.umlView.sceneRect() modules = self.__buildModulesDict() - sortedkeys = sorted(modules.keys()) # step 1: build a dictionary of packages - for module in sortedkeys: - li = module.split('.') - package = '.'.join(li[:-1]) - if package in packages: - packages[package][0].append(li[-1]) + for module in sorted(modules.keys()): + packageName, moduleName = module.rsplit(".", 1) + if packageName in packages: + packages[packageName][0].append(moduleName) else: - packages[package] = ([li[-1]], []) + packages[packageName] = ([moduleName], []) # step 2: assign modules to dictionaries and update import relationship - for module in sortedkeys: - li = module.split('.') - package = '.'.join(li[:-1]) + for module in sorted(modules.keys()): + package = module.rsplit(".", 1)[0] impLst = [] - for i in modules[module].imports: - if i in modules: - impLst.append(i) + for moduleImport in modules[module].imports: + if moduleImport in modules: + impLst.append(moduleImport) else: - if i.find('.') == -1: - n = "{0}.{1}".format(modules[module].package, i) + if moduleImport.find('.') == -1: + n = "{0}.{1}".format(modules[module].package, + moduleImport) if n in modules: impLst.append(n) else: - n = "{0}.{1}".format(project, i) + n = "{0}.{1}".format(project, moduleImport) if n in modules: impLst.append(n) elif n in packages: n = "{0}.<<Dummy>>".format(n) impLst.append(n) else: - n = "{0}.{1}".format(project, i) + n = "{0}.{1}".format(project, moduleImport) if n in modules: impLst.append(n) - for i in list(modules[module].from_imports.keys()): - if i.startswith('.'): - dots = len(i) - len(i.lstrip('.')) + for moduleImport in list(modules[module].from_imports.keys()): + if moduleImport.startswith('.'): + dots = len(moduleImport) - len(moduleImport.lstrip('.')) if dots == 1: - i = i[1:] + moduleImport = moduleImport[1:] elif dots > 1: packagePath = os.path.dirname(modules[module].file) hasInit = True @@ -159,38 +157,38 @@ ) packageList = shortPackage.split('.')[1:] packageListLen = len(packageList) - i = '.'.join( + moduleImport = '.'.join( packageList[:packageListLen - dots + 1] + - [i[dots:]]) + [moduleImport[dots:]]) - if i in modules: - impLst.append(i) + if moduleImport in modules: + impLst.append(moduleImport) else: - if i.find('.') == -1: - n = "{0}.{1}".format(modules[module].package, i) + if moduleImport.find('.') == -1: + n = "{0}.{1}".format(modules[module].package, + moduleImport) if n in modules: impLst.append(n) else: - n = "{0}.{1}".format(project, i) + n = "{0}.{1}".format(project, moduleImport) if n in modules: impLst.append(n) elif n in packages: n = "{0}.<<Dummy>>".format(n) impLst.append(n) else: - n = "{0}.{1}".format(project, i) + n = "{0}.{1}".format(project, moduleImport) if n in modules: impLst.append(n) - for imp in impLst: - impPackage = '.'.join(imp.split('.')[:-1]) + for moduleImport in impLst: + impPackage = moduleImport.rsplit(".", 1)[0] if ( impPackage not in packages[package][1] and impPackage != package ): packages[package][1].append(impPackage) - sortedkeys = sorted(packages.keys()) - for package in sortedkeys: + for package in sorted(packages.keys()): if package: relPackage = package.replace(project, '') if relPackage and relPackage[0] == '.': @@ -251,12 +249,12 @@ @param shapes list of shapes """ - from .AssociationItem import AssociationItem, Imports + from .AssociationItem import AssociationItem, AssociationType for package in shapes: for rel in shapes[package][1]: assoc = AssociationItem( shapes[package][0], shapes[rel][0], - Imports, + AssociationType.IMPORTS, colors=self.umlView.getDrawingColors()) self.scene.addItem(assoc)
--- a/eric6/Graphics/AssociationItem.py Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Graphics/AssociationItem.py Fri Apr 30 19:54:20 2021 +0200 @@ -7,6 +7,8 @@ Module implementing a graphics item for an association between two items. """ +import enum + from PyQt5.QtCore import QPointF, QRectF, QLineF from PyQt5.QtWidgets import QGraphicsItem @@ -15,22 +17,29 @@ import Utilities -# TODO: convert to Enum -Normal = 0 -Generalisation = 1 -Imports = 2 +class AssociationType(enum.Enum): + """ + Class defining the association types. + """ + NORMAL = 0 + GENERALISATION = 1 + IMPORTS = 2 + -# TODO: convert to Enum -NoRegion = 0 -West = 1 -North = 2 -East = 3 -South = 4 -NorthWest = 5 -NorthEast = 6 -SouthEast = 7 -SouthWest = 8 -Center = 9 +class AssociationPointRegion(enum.Enum): + """ + Class defining the regions for an association end point. + """ + NO_REGION = 0 + WEST = 1 + NORTH = 2 + EAST = 3 + SOUTH = 4 + NORTH_WEST = 5 + NORTH_EAST = 6 + SOUTH_EAST = 7 + SOUTH_WEST = 8 + CENTER = 9 class AssociationItem(E5ArrowItem): @@ -40,19 +49,17 @@ The association is drawn as an arrow starting at the first items and ending at the second. """ - def __init__(self, itemA, itemB, assocType=Normal, topToBottom=False, - colors=None, parent=None): + def __init__(self, itemA, itemB, assocType=AssociationType.NORMAL, + topToBottom=False, colors=None, parent=None): """ Constructor @param itemA first widget of the association + @type UMLItem @param itemB second widget of the association - @param assocType type of the association. This must be one of - <ul> - <li>Normal (default)</li> - <li>Generalisation</li> - <li>Imports</li> - </ul> + @type UMLItem + @param assocType type of the association + @type AssociationType @param topToBottom flag indicating to draw the association from item A top to item B bottom @type bool @@ -61,10 +68,10 @@ @param parent reference to the parent object @type QGraphicsItem """ - if assocType in (Normal, Imports): + if assocType in (AssociationType.NORMAL, AssociationType.IMPORTS): arrowType = E5ArrowType.NORMAL arrowFilled = True - elif assocType == Generalisation: + elif assocType == AssociationType.GENERALISATION: arrowType = E5ArrowType.WIDE arrowFilled = False @@ -87,8 +94,8 @@ self.assocType = assocType self.topToBottom = topToBottom - self.regionA = NoRegion - self.regionB = NoRegion + self.regionA = AssociationPointRegion.NO_REGION + self.regionB = AssociationPointRegion.NO_REGION self.calculateEndingPoints() @@ -216,14 +223,17 @@ rc = QRectF(xA, yA, rectA.width(), rectA.height()) self.regionA = self.__findPointRegion(rc, xB, yB) # move some regions to the standard ones - if self.regionA == NorthWest: - self.regionA = North - elif self.regionA == NorthEast: - self.regionA = East - elif self.regionA == SouthEast: - self.regionA = South - elif self.regionA in (SouthWest, Center): - self.regionA = West + if self.regionA == AssociationPointRegion.NORTH_WEST: + self.regionA = AssociationPointRegion.NORTH + elif self.regionA == AssociationPointRegion.NORTH_EAST: + self.regionA = AssociationPointRegion.EAST + elif self.regionA == AssociationPointRegion.SOUTH_EAST: + self.regionA = AssociationPointRegion.SOUTH + elif self.regionA in ( + AssociationPointRegion.SOUTH_WEST, + AssociationPointRegion.CENTER + ): + self.regionA = AssociationPointRegion.WEST self.__updateEndPoint(self.regionA, True) @@ -231,14 +241,17 @@ rc = QRectF(xB, yB, rectB.width(), rectB.height()) self.regionB = self.__findPointRegion(rc, xA, yA) # move some regions to the standard ones - if self.regionB == NorthWest: - self.regionB = North - elif self.regionB == NorthEast: - self.regionB = East - elif self.regionB == SouthEast: - self.regionB = South - elif self.regionB in (SouthWest, Center): - self.regionB = West + if self.regionB == AssociationPointRegion.NORTH_WEST: + self.regionB = AssociationPointRegion.NORTH + elif self.regionB == AssociationPointRegion.NORTH_EAST: + self.regionB = AssociationPointRegion.EAST + elif self.regionB == AssociationPointRegion.SOUTH_EAST: + self.regionB = AssociationPointRegion.SOUTH + elif self.regionB in ( + AssociationPointRegion.SOUTH_WEST, + AssociationPointRegion.CENTER + ): + self.regionB = AssociationPointRegion.WEST self.__updateEndPoint(self.regionB, False) @@ -273,43 +286,43 @@ eval1 = slope1 * posY + b1 eval2 = slope2 * posY + b2 - result = NoRegion + result = AssociationPointRegion.NO_REGION # inside region 1 if eval1 > posX and eval2 > posX: - result = West + result = AssociationPointRegion.WEST #inside region 2 elif eval1 > posX and eval2 < posX: - result = North + result = AssociationPointRegion.NORTH # inside region 3 elif eval1 < posX and eval2 < posX: - result = East + result = AssociationPointRegion.EAST # inside region 4 elif eval1 < posX and eval2 > posX: - result = South + result = AssociationPointRegion.SOUTH # inside region 5 elif eval1 == posX and eval2 < posX: - result = NorthWest + result = AssociationPointRegion.NORTH_WEST # inside region 6 elif eval1 < posX and eval2 == posX: - result = NorthEast + result = AssociationPointRegion.NORTH_EAST # inside region 7 elif eval1 == posX and eval2 > posX: - result = SouthEast + result = AssociationPointRegion.SOUTH_EAST # inside region 8 elif eval1 > posX and eval2 == posX: - result = SouthWest + result = AssociationPointRegion.SOUTH_WEST # inside region 9 elif eval1 == posX and eval2 == posX: - result = Center + result = AssociationPointRegion.CENTER return result @@ -320,7 +333,7 @@ @param region the region for the endpoint (integer) @param isWidgetA flag indicating update for itemA is done (boolean) """ - if region == NoRegion: + if region == AssociationPointRegion.NO_REGION: return rect = ( @@ -335,16 +348,19 @@ ch = wh / 2.0 cw = ww / 2.0 - if region == West: + if region == AssociationPointRegion.WEST: px = x py = y + ch - elif region == North: + elif region == AssociationPointRegion.NORTH: px = x + cw py = y - elif region == East: + elif region == AssociationPointRegion.EAST: px = x + ww py = y + ch - elif region in (South, Center): + elif region in ( + AssociationPointRegion.SOUTH, + AssociationPointRegion.CENTER + ): px = x + cw py = y + wh @@ -534,7 +550,7 @@ entries = [ "src={0}".format(self.itemA.getId()), "dst={0}".format(self.itemB.getId()), - "type={0}".format(self.assocType), + "type={0}".format(self.assocType.value), "topToBottom={0}".format(self.topToBottom) ] return ", ".join(entries) @@ -551,7 +567,7 @@ """ src = -1 dst = -1 - assocType = Normal + assocType = AssociationType.NORMAL topToBottom = False for entry in data.split(", "): if "=" in entry: @@ -561,7 +577,7 @@ elif key == "dst": dst = int(value) elif key == "type": - assocType = int(value) + assocType = AssociationType(int(value)) elif key == "topToBottom": topToBottom = Utilities.toBool(value)
--- a/eric6/Graphics/ImportsDiagramBuilder.py Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Graphics/ImportsDiagramBuilder.py Fri Apr 30 19:54:20 2021 +0200 @@ -245,12 +245,12 @@ @param shapes list of shapes """ - from .AssociationItem import AssociationItem, Imports + from .AssociationItem import AssociationItem, AssociationType for module in list(shapes.keys()): for rel in shapes[module][1]: assoc = AssociationItem( shapes[module][0], shapes[rel][0], - Imports, + AssociationType.IMPORTS, colors=self.umlView.getDrawingColors()) self.scene.addItem(assoc)
--- a/eric6/Graphics/PackageDiagramBuilder.py Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Graphics/PackageDiagramBuilder.py Fri Apr 30 19:54:20 2021 +0200 @@ -430,13 +430,13 @@ @param routes list of relationsships """ - from .AssociationItem import AssociationItem, Generalisation + from .AssociationItem import AssociationItem, AssociationType for route in routes: if len(route) > 1: assoc = AssociationItem( self.__getCurrentShape(route[1]), self.__getCurrentShape(route[0]), - Generalisation, + AssociationType.GENERALISATION, topToBottom=True, colors=self.umlView.getDrawingColors()) self.scene.addItem(assoc)
--- a/eric6/Graphics/UMLClassDiagramBuilder.py Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Graphics/UMLClassDiagramBuilder.py Fri Apr 30 19:54:20 2021 +0200 @@ -200,8 +200,8 @@ sceneRect = self.umlView.sceneRect() width += 50.0 height += 50.0 - swidth = width < sceneRect.width() and sceneRect.width() or width - sheight = height < sceneRect.height() and sceneRect.height() or height + swidth = sceneRect.width() if width < sceneRect.width() else width + sheight = sceneRect.height() if height < sceneRect.height() else height self.umlView.setSceneSize(swidth, sheight) # distribute each generation across the width and the @@ -273,13 +273,13 @@ @param routes list of relationsships """ - from .AssociationItem import AssociationItem, Generalisation + from .AssociationItem import AssociationItem, AssociationType for route in routes: if len(route) > 1: assoc = AssociationItem( self.__getCurrentShape(route[1]), self.__getCurrentShape(route[0]), - Generalisation, + AssociationType.GENERALISATION, topToBottom=True, colors=self.umlView.getDrawingColors()) self.scene.addItem(assoc)
--- a/eric6/Graphics/UMLDialog.py Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Graphics/UMLDialog.py Fri Apr 30 19:54:20 2021 +0200 @@ -47,8 +47,14 @@ super().__init__(parent) self.setObjectName("UMLDialog") + self.__project = project self.__diagramType = diagramType - self.__project = project + self.__diagramTypeString = { + UMLDialog.ClassDiagram: "Class Diagram", + UMLDialog.PackageDiagram: "Package Diagram", + UMLDialog.ImportsDiagram: "Imports Diagram", + UMLDialog.ApplicationDiagram: "Application Diagram", + }.get(diagramType, "Illegal Diagram Type") from .UMLGraphicsView import UMLGraphicsView self.scene = QGraphicsScene(0.0, 0.0, 800.0, 600.0) @@ -67,7 +73,7 @@ self.umlView.relayout.connect(self.__relayout) - self.setWindowTitle(self.__diagramTypeString()) + self.setWindowTitle(self.__diagramTypeString) def __initActions(self): """ @@ -191,29 +197,13 @@ else: return None - def __diagramTypeString(self): - """ - Private method to generate a readable string for the diagram type. - - @return readable type string (string) - """ - if self.__diagramType == UMLDialog.ClassDiagram: - return "Class Diagram" - elif self.__diagramType == UMLDialog.PackageDiagram: - return "Package Diagram" - elif self.__diagramType == UMLDialog.ImportsDiagram: - return "Imports Diagram" - elif self.__diagramType == UMLDialog.ApplicationDiagram: - return "Application Diagram" - else: - return "Illegal Diagram Type" - def __save(self): """ Private slot to save the diagram with the current name. """ self.__saveAs(self.__fileName) + # TODO: change this to save file in JSON format @pyqtSlot() def __saveAs(self, filename=""): """ @@ -250,7 +240,7 @@ lines = [ "version: 1.0", "diagram_type: {0} ({1})".format( - self.__diagramType, self.__diagramTypeString()), + self.__diagramType, self.__diagramTypeString), "scene_size: {0};{1}".format(self.scene.width(), self.scene.height()), ] @@ -273,6 +263,8 @@ self.__fileName = filename + # TODO: add loading of file in JSON format + # TODO: delete the current one with eric7 def load(self): """ Public method to load a diagram from a file. @@ -325,7 +317,10 @@ self.__showInvalidDataMessage(filename, linenum) return False try: - self.__diagramType = int(value.strip().split(None, 1)[0]) + diagramType, diagramTypeString = value.strip().split(None, 1) + self.__diagramType = int(self.__diagramType) + self.__diagramTypeString = diagramTypeString[1:-1] + # remove opening an closing bracket except ValueError: self.__showInvalidDataMessage(filename, linenum) return False @@ -368,7 +363,7 @@ # everything worked fine, so remember the file name and set the # window title - self.setWindowTitle(self.__diagramTypeString()) + self.setWindowTitle(self.__diagramTypeString) self.__fileName = filename return True
--- a/eric6/Project/ProjectOthersBrowser.py Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/Project/ProjectOthersBrowser.py Fri Apr 30 19:54:20 2021 +0200 @@ -254,6 +254,7 @@ self.svgFile.emit(itm.fileName()) elif itm.isPixmapFile(): self.pixmapFile.emit(itm.fileName()) + # TODO: add entry for eric graphics files else: if Utilities.MimeTypes.isTextFile(itm.fileName()): self.sourceFile.emit(itm.fileName())
--- a/eric6/UI/Browser.py Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/UI/Browser.py Fri Apr 30 19:54:20 2021 +0200 @@ -494,6 +494,7 @@ self.svgFile.emit(itm.fileName()) elif itm.isPixmapFile(): self.pixmapFile.emit(itm.fileName()) + # TODO: add entry for eric graphics files else: if Utilities.MimeTypes.isTextFile(itm.fileName()): self.sourceFile[str].emit(itm.fileName())
--- a/eric6/UI/BrowserModel.py Thu Apr 29 17:39:17 2021 +0200 +++ b/eric6/UI/BrowserModel.py Fri Apr 30 19:54:20 2021 +0200 @@ -1155,6 +1155,7 @@ self._moduleName = '' + # TODO: add icon for eric graphics file pixName = "" if self.isPython3File(): pixName = "filePython" @@ -1300,7 +1301,8 @@ """ Public method to check, if this file is a Ruby script. - @return flag indicating a Ruby file (boolean) + @return flag indicating a Ruby file + @rtype bool """ return ( self.fileext == '.rb' or @@ -1311,7 +1313,8 @@ """ Public method to check, if this file is a Qt-Designer file. - @return flag indicating a Qt-Designer file (boolean) + @return flag indicating a Qt-Designer file + @rtype bool """ return self.fileext == '.ui' @@ -1319,7 +1322,8 @@ """ Public method to check, if this file is a Qt-Linguist file. - @return flag indicating a Qt-Linguist file (boolean) + @return flag indicating a Qt-Linguist file + @rtype bool """ return self.fileext in ['.ts', '.qm'] @@ -1327,7 +1331,8 @@ """ Public method to check, if this file is a Qt-Resources file. - @return flag indicating a Qt-Resources file (boolean) + @return flag indicating a Qt-Resources file + @rtype bool """ return self.fileext == '.qrc' @@ -1335,7 +1340,8 @@ """ Public method to check, if this file is an eric project file. - @return flag indicating an eric project file (boolean) + @return flag indicating an eric project file + @rtype bool """ return self.fileext in ('.epj', '.e4p') @@ -1343,7 +1349,8 @@ """ Public method to check, if this file is an eric multi project file. - @return flag indicating an eric project file (boolean) + @return flag indicating an eric project file + @rtype bool """ return self.fileext in ('.emj', '.e4m', '.e5m') @@ -1351,7 +1358,8 @@ """ Public method to check, if this file is a CORBA IDL file. - @return flag indicating a CORBA IDL file (boolean) + @return flag indicating a CORBA IDL file + @rtype bool """ return self.fileext == '.idl' @@ -1368,7 +1376,8 @@ """ Public method to check, if this file is a JavaScript file. - @return flag indicating a JavaScript file (boolean) + @return flag indicating a JavaScript file + @rtype bool """ return self.fileext == '.js' @@ -1376,7 +1385,8 @@ """ Public method to check, if this file is a pixmap file. - @return flag indicating a pixmap file (boolean) + @return flag indicating a pixmap file + @rtype bool """ return self.fileext[1:] in QImageReader.supportedImageFormats() @@ -1384,7 +1394,8 @@ """ Public method to check, if this file is a SVG file. - @return flag indicating a SVG file (boolean) + @return flag indicating a SVG file + @rtype bool """ return self.fileext == '.svg' @@ -1399,6 +1410,15 @@ (self.fileext == "" and self.sourceLanguage == "D") ) + def isEricGraphicsFile(self): + """ + Public method to check, if this is an eric graphics file. + + @return flag indicating an eric graphics file + @rtype bool + """ + return self.fileext in ('.egj', '.e5g') + def lessThan(self, other, column, order): """ Public method to check, if the item is less than the other one.