Quellcode durchsuchen

DetailsDialog: suppression de mention ok

olivier.massot vor 7 Jahren
Ursprung
Commit
6264cdf278
2 geänderte Dateien mit 10 neuen und 3 gelöschten Zeilen
  1. 8 3
      Viewer.py
  2. 2 0
      core.py

+ 8 - 3
Viewer.py

@@ -461,11 +461,12 @@ class Viewer(QMainWindow):
         obj = core.Analyse.objects[index]
 
         dlg = DetailsDialog(obj, self)
-
         dlg.show()
         r = dlg.exec_()
+
         if r:
-            pass
+            core.Analyse.build_trees()
+            self.maj_scene_with(obj)
 
     def test(self):
         self.run(Path(__file__).parent / r"test\source")
@@ -479,6 +480,8 @@ class Viewer(QMainWindow):
         if e.key() == Qt.Key_Control:
             self.ui.view.setDragMode(QGraphicsView.RubberBandDrag)
 
+
+
 class DetailsDialog(QDialog):
 
     def __init__(self, obj, parent=None):
@@ -494,6 +497,7 @@ class DetailsDialog(QDialog):
         self.ui.btn_add.clicked.connect(self.add_mention)
         self.ui.btn_edit.clicked.connect(self.edit_mention)
         self.ui.btn_del.clicked.connect(self.del_mention)
+        self.ui.btn_ok.clicked.connect(self.ok)
 
         self.ui.lbl_title.setText("{}: {}".format(self.obj.type_, self.obj.name_))
 
@@ -504,7 +508,6 @@ class DetailsDialog(QDialog):
 
         self.load_table()
 
-
     def load_table(self):
         self.ui.tbl_mentions.setSortingEnabled(False)
         self.ui.tbl_mentions.clearContents()
@@ -551,4 +554,6 @@ class DetailsDialog(QDialog):
         del self.obj.mentions[index]
         self.load_table()
 
+    def ok(self):
+        self.done(1)
 

+ 2 - 0
core.py

@@ -198,6 +198,7 @@ class Analyse():
         total = len(cls.objects)
         for index, subject in enumerate(cls.objects):
             cls.report(index, total * 2)
+            subject.deps = []
 
             for mention in subject.mentions:
                 if not mention.obj in subject.deps and not mention.obj is subject:
@@ -205,6 +206,7 @@ class Analyse():
 
         for index, subject in enumerate(cls.objects):
             cls.report(total + index, total * 2)
+            subject.refs = []
 
             for obj in cls.objects:
                 if obj is subject: