|
|
@@ -70,9 +70,13 @@ class GraphicsObject(QGraphicsItemGroup):
|
|
|
self.addToGroup(anchor)
|
|
|
|
|
|
effect = QGraphicsColorizeEffect()
|
|
|
+ effect.setColor(QColor(255, 255, 255))
|
|
|
+ effect.setStrength(0.35)
|
|
|
effect.setEnabled(False)
|
|
|
self.rect.setGraphicsEffect(effect)
|
|
|
|
|
|
+ self.setToolTip("[{}] '{}'".format(self.obj.type_, self.obj.name_))
|
|
|
+
|
|
|
GraphicsObject.items.append(self)
|
|
|
|
|
|
def setText(self):
|
|
|
@@ -166,12 +170,11 @@ class GraphicsCloneDepObject(GraphicsDepObject):
|
|
|
def __init__(self, obj, childItem, parent=None):
|
|
|
super(GraphicsCloneDepObject, self).__init__(obj, childItem, parent)
|
|
|
self.bottom_anchor.setBrush(QColor("red"))
|
|
|
- self.clone_of = next((item for item in GraphicsObject.items if item.obj == obj
|
|
|
- and type(item) is GraphicsDepObject
|
|
|
- or type(item) is GraphicsRefObject))
|
|
|
+ self.clone_of = next((item for item in GraphicsObject.items if item.obj is obj
|
|
|
+ and (type(item) is GraphicsDepObject or type(item) is GraphicsRefObject)))
|
|
|
|
|
|
def html(self):
|
|
|
- return super(GraphicsCloneDepObject, self).html() + "<br/>(!) Clône"
|
|
|
+ return "* Clone *<br/>" + super(GraphicsCloneDepObject, self).html()
|
|
|
|
|
|
@property
|
|
|
def deps(self):
|
|
|
@@ -216,12 +219,11 @@ class GraphicsCloneRefObject(GraphicsRefObject):
|
|
|
def __init__(self, obj, childItem, parent=None):
|
|
|
super(GraphicsCloneRefObject, self).__init__(obj, childItem, parent)
|
|
|
self.top_anchor.setBrush(QColor("red"))
|
|
|
- self.clone_of = next((item for item in GraphicsObject.items if item.obj == obj
|
|
|
- and type(item) is GraphicsDepObject
|
|
|
- or type(item) is GraphicsRefObject))
|
|
|
+ self.clone_of = next((item for item in GraphicsObject.items if item.obj is obj
|
|
|
+ and (type(item) is GraphicsDepObject or type(item) is GraphicsRefObject)))
|
|
|
|
|
|
def html(self):
|
|
|
- return super(GraphicsCloneRefObject, self).html() + "<br/>(!) Clône"
|
|
|
+ return "* Clone *<br/>" + super(GraphicsCloneRefObject, self).html()
|
|
|
|
|
|
@property
|
|
|
def refs(self):
|
|
|
@@ -232,9 +234,11 @@ class GraphicsCloneRefObject(GraphicsRefObject):
|
|
|
pass
|
|
|
|
|
|
def hoverEnterEvent(self, *args, **kwargs):
|
|
|
+ self.setShining(True)
|
|
|
self.clone_of.setShining(True)
|
|
|
|
|
|
def hoverLeaveEvent(self, *args, **kwargs):
|
|
|
+ self.setShining(False)
|
|
|
self.clone_of.setShining(False)
|
|
|
|
|
|
class GraphicsLink(QGraphicsLineItem):
|
|
|
@@ -361,6 +365,7 @@ class Viewer(QMainWindow):
|
|
|
core.Analyse.run(source_dir)
|
|
|
|
|
|
QApplication.restoreOverrideCursor()
|
|
|
+ QMessageBox.information(self, "Analyse", "Analyse terminée: {} objets chargés en mémoire".format(len(core.Analyse.objects)))
|
|
|
|
|
|
if core.Analyse.duplicates():
|
|
|
QMessageBox.warning(self, "Risque d'instabilités", "Attention! Des doublons ont été trouvés dans les noms des objets")
|
|
|
@@ -402,29 +407,30 @@ class Viewer(QMainWindow):
|
|
|
for dep in go.obj.deps:
|
|
|
if dep not in [go.obj for go in GraphicsObject.items]:
|
|
|
gdep = GraphicsDepObject(dep, go)
|
|
|
+ if dep.deps:
|
|
|
+ _addDeps(gdep)
|
|
|
else:
|
|
|
gdep = GraphicsCloneDepObject(dep, go)
|
|
|
|
|
|
self._scene.addItem(gdep)
|
|
|
-
|
|
|
link = GraphicsLink(go, gdep)
|
|
|
self._scene.addItem(link)
|
|
|
- if dep.deps:
|
|
|
- _addDeps(gdep)
|
|
|
+
|
|
|
_addDeps(root)
|
|
|
|
|
|
def _addRefs(go):
|
|
|
for ref in go.obj.refs:
|
|
|
if ref not in [go.obj for go in GraphicsObject.items]:
|
|
|
gref = GraphicsRefObject(ref, go)
|
|
|
+ if ref.refs:
|
|
|
+ _addRefs(gref)
|
|
|
else:
|
|
|
gref = GraphicsCloneRefObject(ref, go)
|
|
|
- self._scene.addItem(gref)
|
|
|
|
|
|
+ self._scene.addItem(gref)
|
|
|
link = GraphicsLink(gref, go)
|
|
|
self._scene.addItem(link)
|
|
|
- if ref.refs:
|
|
|
- _addRefs(gref)
|
|
|
+
|
|
|
_addRefs(root)
|
|
|
|
|
|
for item in GraphicsObject.items:
|