// but I didn't compare the performance for each case.
PyLockWrapper lck; // acquire GIL
PyObjWrapper extensionUnpacker = PyImport_ImportModule((char*)"SalomeOnDemandTK.extension_unpacker");
+ PyObjWrapper runSalomeOnDemand = PyImport_ImportModule((char*)"runSalomeOnDemand");
// Loop via selected extensions files
foreach(QString path, paths)
}
// Add an extension to GUI
+ QFileInfo extFileInfo(path);
+ QString extName = extFileInfo.baseName();
if (moduleAction)
{
- QFileInfo extFileInfo(path);
- QString extName = extFileInfo.baseName();
moduleAction->insertExtension(extName);
}
+
+ // Update environment of salome
+ PyObjWrapper update_env = PyObject_CallMethod(
+ runSalomeOnDemand, (char*)"set_selext_env", (char*)"ss", extRootDir, extName.toStdString().c_str());
+ if (!update_env)
+ {
+ SUIT_MessageBox::warning(desktop(), tr("WRN_WARNING"), tr("WRN_FAILED_UPDATE_ENV").arg(extName + "_env.py") );
+ continue;
+ }
}
// Udate actions only once after all of them were already inserted
<source>WRN_FAILED_UNPACK_EXTENSION</source>
<translation>Failed to unpack a salome extension from file: %1.</translation>
</message>
+ <message>
+ <source>WRN_FAILED_UPDATE_ENV</source>
+ <translation>Failed to update salome environment from file: %1.</translation>
+ </message>
<message>
<source>WRN_FAILED_REMOVE_EXTENSION</source>
<translation>Failed to remove a salome extension: %1.</translation>
<source>WRN_FAILED_UNPACK_EXTENSION</source>
<translation>Échec de la décompression d'une extension salome à partir d'un fichier: %1.</translation>
</message>
+ <message>
+ <source>WRN_FAILED_UPDATE_ENV</source>
+ <translation>Échec de la mise à jour de l'environnement de salome à partir du fichier: %1.</translation>
+ </message>
<message>
<source>WRN_FAILED_REMOVE_EXTENSION</source>
<translation>Échec de la suppression d'une extension Salomé: %1.</translation>