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