瀏覽代碼

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()