mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-20 10:17:16 +01:00
see #2561 operation of making an interface a subinterface should be
performed using undo/redo command. Also, this should take care of inconvenient scrolling of the object tree after this operation.
This commit is contained in:
parent
433b845837
commit
bbf03ad49c
@ -1,5 +1,10 @@
|
|||||||
2011-07-09 vadim <vadim@netcitadel.com>
|
2011-07-09 vadim <vadim@netcitadel.com>
|
||||||
|
|
||||||
|
* ObjectManipulator_slots.cpp (makeSubinterface): see #2561
|
||||||
|
operation of making an interface a subinterface should be
|
||||||
|
performed using undo/redo command. Also, this should take care of
|
||||||
|
inconvenient scrolling of the object tree after this operation.
|
||||||
|
|
||||||
* ObjectManipulator.cpp (addSubinterfaceSubmenu): see #2562 "Crash
|
* ObjectManipulator.cpp (addSubinterfaceSubmenu): see #2562 "Crash
|
||||||
when making an interface that has subinterfaces a subinterface of
|
when making an interface that has subinterfaces a subinterface of
|
||||||
another interfrace". If an interface has subinterfaces, it should
|
another interfrace". If an interface has subinterfaces, it should
|
||||||
|
|||||||
@ -127,7 +127,10 @@ void FWCmdMoveObject::redo()
|
|||||||
new_parent->add(obj);
|
new_parent->add(obj);
|
||||||
current_parent = new_parent;
|
current_parent = new_parent;
|
||||||
}
|
}
|
||||||
if (fwbdebug) qDebug() << "FWCmdMoveObject::redo() obj->ref_counter="
|
if (fwbdebug) qDebug() << "FWCmdMoveObject::redo()"
|
||||||
|
<< "obj: " << obj->getName().c_str()
|
||||||
|
<< "(" << obj->getTypeName().c_str() << ")"
|
||||||
|
<< "obj->ref_counter="
|
||||||
<< obj->getRefCounter();
|
<< obj->getRefCounter();
|
||||||
if (reference_holders.size())
|
if (reference_holders.size())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -510,18 +510,27 @@ void ObjectManipulator::makeSubinterface(QAction *act)
|
|||||||
{
|
{
|
||||||
obj = *i;
|
obj = *i;
|
||||||
|
|
||||||
|
if (obj->getParent() == new_parent_interface) continue;
|
||||||
|
|
||||||
if (fwbdebug)
|
if (fwbdebug)
|
||||||
qDebug() << "ObjectManipulator::makeSubinterface"
|
qDebug() << "ObjectManipulator::makeSubinterface"
|
||||||
<< "obj=" << obj
|
<< "obj=" << obj
|
||||||
<< obj->getName().c_str()
|
<< obj->getName().c_str()
|
||||||
<< "new parent:" << new_parent_interface->getName().c_str();
|
<< "new parent:" << new_parent_interface->getName().c_str();
|
||||||
|
|
||||||
new_parent_interface->reparent(obj);
|
// new_parent_interface->reparent(obj);
|
||||||
}
|
|
||||||
|
|
||||||
FWObject *h = Host::getParentHost(new_parent_interface);
|
map<int, set<FWObject*> > reference_holders;
|
||||||
QCoreApplication::postEvent(
|
FWCmdMoveObject *cmd = new FWCmdMoveObject(
|
||||||
mw, new reloadObjectTreeEvent(m_project->getFileName()));
|
m_project,
|
||||||
|
obj->getParent(),
|
||||||
|
new_parent_interface,
|
||||||
|
obj,
|
||||||
|
reference_holders,
|
||||||
|
QString("Make an interface a subinterface"),
|
||||||
|
0);
|
||||||
|
m_project->undoStack->push(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
ot->freezeSelection(false);
|
ot->freezeSelection(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user