From: vsr Date: Wed, 27 Jan 2010 09:43:31 +0000 (+0000) Subject: For PARAVIS: use AttributeUserID instead of AttributeLocalID X-Git-Tag: PARAVIS_29012010~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e0225d2fa128e4125591e09840db9f2f6fde30bd;p=modules%2Fgui.git For PARAVIS: use AttributeUserID instead of AttributeLocalID --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index ba3d16744..913a80e2b 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -85,6 +85,7 @@ #include #include +#include #include #include @@ -1195,9 +1196,11 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePop _PTR(SObject) aSO = stdDS->FindObjectID( aIObj->getEntry() ); if ( aSO ) { _PTR( GenericAttribute ) anAttr; - if ( aSO->FindAttribute( anAttr, "AttributeLocalID" ) ) { - _PTR(AttributeLocalID) aAttrID = anAttr; - long aId = aAttrID->Value(); + std::string auid = "AttributeUserID"; + auid += Kernel_Utils::GetGUID(Kernel_Utils::ObjectdID); + if ( aSO->FindAttribute( anAttr, auid ) ) { + _PTR(AttributeUserID) aAttrID = anAttr; + QString aId = aAttrID->Value().c_str(); if ( myExtActions.contains( aId ) ) { thePopup->addAction(myExtActions[aId]); } @@ -1554,10 +1557,10 @@ void SalomeApp_Application::createExtraActions() if (!aSectionStr.isNull()) { QStringList aSections = aSectionStr.split(':'); foreach(QString aSection, aSections) { - QString aTitle = resMgr->stringValue(aSection, "title", QString()); - int aId = resMgr->integerValue(aSection, "attributelocalid", -1); - QString aSlot = resMgr->stringValue(aSection, "method", QString()); - if (aTitle.isNull() || aSlot.isNull() || (aId == -1)) + QString aTitle = resMgr->stringValue(aSection, "title", QString()); + QString aId = resMgr->stringValue(aSection, "objectid", QString()); + QString aSlot = resMgr->stringValue(aSection, "method", QString()); + if (aTitle.isEmpty() || aSlot.isEmpty() || aId.isEmpty()) continue; QString aModuleName = resMgr->stringValue(aSection, "module", QString()); diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 491d0c10a..57c3f87f7 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -162,7 +162,7 @@ private: private: SalomeApp_NoteBookDlg* myNoteBook; - QMap myExtActions; // Map + QMap myExtActions; // Map }; #ifdef WIN32