1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-18 09:18:23 +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:
Vadim Kurland 2011-07-09 16:42:37 -07:00
parent 433b845837
commit bbf03ad49c
3 changed files with 23 additions and 6 deletions

View File

@ -1,5 +1,10 @@
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
when making an interface that has subinterfaces a subinterface of
another interfrace". If an interface has subinterfaces, it should

View File

@ -127,7 +127,10 @@ void FWCmdMoveObject::redo()
new_parent->add(obj);
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();
if (reference_holders.size())
{

View File

@ -510,18 +510,27 @@ void ObjectManipulator::makeSubinterface(QAction *act)
{
obj = *i;
if (obj->getParent() == new_parent_interface) continue;
if (fwbdebug)
qDebug() << "ObjectManipulator::makeSubinterface"
<< "obj=" << obj
<< obj->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);
QCoreApplication::postEvent(
mw, new reloadObjectTreeEvent(m_project->getFileName()));
map<int, set<FWObject*> > reference_holders;
FWCmdMoveObject *cmd = new FWCmdMoveObject(
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);
}