소스 검색

retyping a node is always global

Lucas Heer 7 년 전
부모
커밋
79eb945d18
1개의 변경된 파일6개의 추가작업 그리고 17개의 파일을 삭제
  1. 6 17
      sketchUI/exm_scene.py

+ 6 - 17
sketchUI/exm_scene.py

@@ -255,28 +255,17 @@ class SketchScene(QGraphicsScene):
             self._parent.plainTextEdit.appendPlainText("Error: Already such a type: {}".format(node_type))
             return
 
-        # local or global retype?
-        scope, ok = QInputDialog.getItem(self._parent, "Select scope", "Scope", ["Local", "Global"])
-        if not ok:
-            return
-
         self._parent.plainTextEdit.appendPlainText("Performing retype of node {}".format(node_type))
         QApplication.setOverrideCursor(Qt.WaitCursor)
         retype_handler = NodeRetype()
-        if scope == "Global":
-            retype_handler.execute(self._cur_model, item.node_id, node_type, local=False)
-        else:
-            retype_handler.execute(self._cur_model, item.node_id, node_type, local=True)
+        retype_handler.execute(self._cur_model, item.node_id, node_type, local=False)
 
         # rename on screen
-        if scope == "Global":
-            for node_item in self.items():
-                if not isinstance(node_item, GraphicsNodeItem):
-                    continue
-                if node_item.get_type() == old_type:
-                    node_item.set_type(node_type)
-        else:
-            item.set_type(node_type)
+        for node_item in self.items():
+            if not isinstance(node_item, GraphicsNodeItem):
+                continue
+            if node_item.get_type() == old_type:
+                node_item.set_type(node_type)
 
         # update list widget
         self._parent.populate_types()