if (item->isSelected()) {
const char* service = item->text(0).latin1();
const char* interface = item->parent()->text(0).latin1();
- const char* component = anApp->moduleName(item->parent()->parent()->text(0).latin1());
- SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
- if (myComponent==NULL) {
- QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
- }
- else {
- const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
- SUPERV_CNode aNode;
- if ( myService->TypeOfNode == 0 ) { // ComputeNode
- aNode = aMain->getDataflow()->CNode(*myService);
- if (CORBA::is_nil( aNode ) ) {
- QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
- return;
- }
+ //const char* component = anApp->moduleName(item->parent()->parent()->text(0).latin1());
+ if ( aSupMod->getInterfaceNameMap().contains(item->parent()->text(0)) ) {
+ const char* component = aSupMod->getInterfaceNameMap().find(item->parent()->text(0)).data();
+
+ SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
+ if (myComponent==NULL) {
+ QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
}
- else { // Factory Node
- aNode = aMain->getDataflow()->FNode(component, interface, *myService);
- if ( CORBA::is_nil( aNode ) ) {
- QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
- return;
+ else {
+ const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
+ SUPERV_CNode aNode;
+ if ( myService->TypeOfNode == 0 ) { // ComputeNode
+ aNode = aMain->getDataflow()->CNode(*myService);
+ if (CORBA::is_nil( aNode ) ) {
+ QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
+ }
+ else { // Factory Node
+ aNode = aMain->getDataflow()->FNode(component, interface, *myService);
+ if ( CORBA::is_nil( aNode ) ) {
+ QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
}
+ SUPERV::INode_var aDummyEndNode;
+ addNode( aNode, aDummyEndNode, myX, myY );
+ b = true;
}
- SUPERV::INode_var aDummyEndNode;
- addNode( aNode, aDummyEndNode, myX, myY );
- b = true;
- }
+ }
}
}
if ( !b ) {
SUPERVGUI_Main* aMain = aSupMod->getMain();
if ( !CORBA::is_nil( theNode ) && aMain ) {
-
+
aMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag, why here? -> PAL7960
int cx, cy; //to appear a new node in the top-left corner of the current viewport
aMain->addControlNode( theNode, SUPERV::CNode::_narrow( theEndNode ), true );
else
aMain->addComputeNode( theNode );
- }
+ }
}