]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
For PARAVIS: use AttributeUserID instead of AttributeLocalID
authorvsr <vsr@opencascade.com>
Wed, 27 Jan 2010 09:43:31 +0000 (09:43 +0000)
committervsr <vsr@opencascade.com>
Wed, 27 Jan 2010 09:43:31 +0000 (09:43 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h

index ba3d167444ef6723b960a247c18d04abcbfab079..913a80e2ba39428b5a8746c4f0b0e0e2fdf75235 100644 (file)
@@ -85,6 +85,7 @@
 #include <QMenu>
 
 #include <SALOMEDSClient_ClientFactory.hxx>
+#include <Basics_Utils.hxx>
 
 #include <SALOME_ListIteratorOfListIO.hxx>
 #include <SALOME_ListIO.hxx>
@@ -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());
index 491d0c10ab9de29368419c45f68df084298db535..57c3f87f71ff4e5da4ae3b592ef01cb723bc1ab0 100644 (file)
@@ -162,7 +162,7 @@ private:
 
 private:
   SalomeApp_NoteBookDlg*              myNoteBook;
-  QMap<long, QAction*>                myExtActions; // Map <AttributeLocalID, QAction>
+  QMap<QString, QAction*>             myExtActions; // Map <AttributeUserID, QAction>
 };
 
 #ifdef WIN32