From e0225d2fa128e4125591e09840db9f2f6fde30bd Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 27 Jan 2010 09:43:31 +0000 Subject: [PATCH] For PARAVIS: use AttributeUserID instead of AttributeLocalID --- src/SalomeApp/SalomeApp_Application.cxx | 17 ++++++++++------- src/SalomeApp/SalomeApp_Application.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) 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 -- 2.39.2