22 |
22 |
23 class UMLClassDiagram(UMLDialog): |
23 class UMLClassDiagram(UMLDialog): |
24 """ |
24 """ |
25 Class implementing a dialog showing a UML like class diagram. |
25 Class implementing a dialog showing a UML like class diagram. |
26 """ |
26 """ |
27 def __init__(self, file, parent=None, name=None, noAttrs=False): |
27 def __init__(self, project, file, parent=None, name=None, noAttrs=False): |
28 """ |
28 """ |
29 Constructor |
29 Constructor |
30 |
30 |
|
31 @param project reference to the project object |
31 @param file filename of a python module to be shown (string) |
32 @param file filename of a python module to be shown (string) |
32 @param parent parent widget of the view (QWidget) |
33 @param parent parent widget of the view (QWidget) |
33 @param name name of the view widget (string) |
34 @param name name of the view widget (string) |
34 @keyparam noAttrs flag indicating, that no attributes should be shown (boolean) |
35 @keyparam noAttrs flag indicating, that no attributes should be shown (boolean) |
35 """ |
36 """ |
36 self.file = file |
37 self.file = file |
37 self.noAttrs = noAttrs |
38 self.noAttrs = noAttrs |
38 |
39 |
39 UMLDialog.__init__(self, self.file, parent) |
40 pname = project.getProjectName() |
|
41 if pname and project.isProjectSource(self.file): |
|
42 name = "{0}: {1}".format(pname, project.getRelativePath(self.file)) |
|
43 else: |
|
44 name = self.file |
|
45 UMLDialog.__init__(self, name, parent) |
40 |
46 |
41 if not name: |
47 if not name: |
42 self.setObjectName("UMLClassDiagram") |
48 self.setObjectName("UMLClassDiagram") |
43 else: |
49 else: |
44 self.setObjectName(name) |
50 self.setObjectName(name) |