mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-12 16:13:13 +02:00
see #2562 "Crash when making an interface that has subinterfaces a
subinterface of another interfrace". If an interface has subinterfaces, it should not be allowed to become subinterface of another interface.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2011-07-09 vadim <vadim@netcitadel.com>
|
||||||
|
|
||||||
|
* 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
|
||||||
|
not be allowed to become subinterface of another interface.
|
||||||
|
|
||||||
2011-07-08 vadim <vadim@netcitadel.com>
|
2011-07-08 vadim <vadim@netcitadel.com>
|
||||||
|
|
||||||
* ObjectManipulator_slots.cpp (makeSubinterface): see #2561 "Add
|
* ObjectManipulator_slots.cpp (makeSubinterface): see #2561 "Add
|
||||||
|
|||||||
@@ -896,21 +896,29 @@ void ObjectManipulator::addSubinterfaceSubmenu(
|
|||||||
const list<FWObject*> &top_level_interfaces)
|
const list<FWObject*> &top_level_interfaces)
|
||||||
{
|
{
|
||||||
QMenu *submenu = menu->addMenu( tr("Make subinterface of..."));
|
QMenu *submenu = menu->addMenu( tr("Make subinterface of..."));
|
||||||
|
|
||||||
|
int submenu_items_counter = 0;
|
||||||
list<FWObject*>::const_iterator it;
|
list<FWObject*>::const_iterator it;
|
||||||
for (it=top_level_interfaces.begin(); it!=top_level_interfaces.end(); ++it)
|
for (it=top_level_interfaces.begin(); it!=top_level_interfaces.end(); ++it)
|
||||||
{
|
{
|
||||||
Interface *intf = Interface::cast(*it);
|
Interface *intf = Interface::cast(*it);
|
||||||
|
|
||||||
bool skip_selected_interface = false;
|
bool skip_interface = false;
|
||||||
foreach(FWObject *obj, getCurrentObjectTree()->getSelectedObjects())
|
foreach(FWObject *obj, getCurrentObjectTree()->getSelectedObjects())
|
||||||
{
|
{
|
||||||
if (obj == intf)
|
if (obj == intf)
|
||||||
{
|
{
|
||||||
skip_selected_interface = true;
|
skip_interface = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!intf->validateChild(obj))
|
||||||
|
{
|
||||||
|
skip_interface = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (skip_selected_interface) continue;
|
if (skip_interface) continue;
|
||||||
if (intf->isLoopback()) continue;
|
if (intf->isLoopback()) continue;
|
||||||
|
|
||||||
// can not add interfaces to a read-only parent interface
|
// can not add interfaces to a read-only parent interface
|
||||||
@@ -931,7 +939,11 @@ void ObjectManipulator::addSubinterfaceSubmenu(
|
|||||||
|
|
||||||
connect( submenu, SIGNAL(triggered(QAction*)),
|
connect( submenu, SIGNAL(triggered(QAction*)),
|
||||||
this, SLOT(makeSubinterface(QAction*)));
|
this, SLOT(makeSubinterface(QAction*)));
|
||||||
|
|
||||||
|
submenu_items_counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
submenu->setEnabled(submenu_items_counter != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ObjectManipulator::getDeleteMenuState(FWObject *obj)
|
bool ObjectManipulator::getDeleteMenuState(FWObject *obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user