File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
plugins/gui/src/context_manager_widget Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -263,8 +263,18 @@ namespace hal
263263
264264 UserActionCompound* act = new UserActionCompound;
265265 act->setUseCreatedObject ();
266+
267+ // TODO: check whether name + " (Copy)" is already in use
266268 act->addAction (new ActionCreateObject (UserActionObjectType::ContextView,clicked_context->name () + " (Copy)" ));
267- act->addAction (new ActionAddItemsToObject (clicked_context->modules (),clicked_context->gates ()));
269+
270+ ActionAddItemsToObject* actAddItems = new ActionAddItemsToObject (clicked_context->modules (),clicked_context->gates ());
271+ GridPlacement plc;
272+ QMap<Node, QPoint> contextNodeMap = clicked_context->getLayouter ()->nodeToPositionMap ();
273+ for (auto it = contextNodeMap.begin (); it != contextNodeMap.end (); it++)
274+ plc.insert (it.key (), it.value ());
275+ actAddItems->setPlacementHint (plc);
276+ act->addAction (actAddItems);
277+
268278 act->exec ();
269279 }
270280
You can’t perform that action at this time.
0 commit comments