From aee3538412616d5b023f6c58ec5b82c7cd7f4816 Mon Sep 17 00:00:00 2001 From: nri Date: Thu, 8 Jan 2004 14:57:01 +0000 Subject: [PATCH] NRI : IDL includes path is added. It's necessary to modify runIDLparser script to take into this modification. --- src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx | 35 ++++++++++++++++++- src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h | 1 + 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx index 7dd7affe4..5c774aa8e 100644 --- a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx +++ b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx @@ -34,6 +34,7 @@ using namespace std; #include "QAD_Desktop.h" #include "QAD_FileDlg.h" #include "QAD_MessageBox.h" +#include "QAD_Tools.h" #include #include #include @@ -286,6 +287,36 @@ QString ToolsGUI_CatalogGeneratorDlg::getCompType() return myCompType->text().stripWhiteSpace(); } +//================================================================================= +// function : getIdlPath() +// purpose : gets IDL path of modules +//================================================================================= +QString ToolsGUI_CatalogGeneratorDlg::getIdlPath() +{ + SALOME_ModuleCatalog::ModuleCatalog_var aCatalog = + SALOME_ModuleCatalog::ModuleCatalog::_narrow( QAD_Application::getDesktop()->getCatalogue()); + + SALOME_ModuleCatalog::ListOfIAPP_Affich_var list_composants = + aCatalog->GetComponentIconeList(); + + QString IDLpath = ""; + + for (unsigned int ind = 0; ind < list_composants->length();ind++) { + QString modulename = strdup(list_composants[ind].modulename) ; + + QCString dir; + if (dir = getenv( modulename + "_ROOT_DIR")) { + IDLpath = IDLpath + "-I" + QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + + QAD_Tools::addSlash("idl") + + QAD_Tools::addSlash("salome")) + " "; + } + } + + // MESSAGE ( " IDLpath = " << IDLpath); + + return IDLpath; +} + //================================================================================= // function : onBrowseBtnClicked() // purpose : <...> (Browse) buttons slot @@ -344,6 +375,7 @@ void ToolsGUI_CatalogGeneratorDlg::updateButtonState() //================================================================================= void ToolsGUI_CatalogGeneratorDlg::onApply() { + QString IDLpath = getIdlPath(); QString XmlFile = getXmlFile(); QString IdlFile = getIdlFile(); QString Author = getAuthor(); @@ -364,13 +396,14 @@ void ToolsGUI_CatalogGeneratorDlg::onApply() else { QString command = ""; if ( getenv("KERNEL_ROOT_DIR") ) - command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/salome/runIDLparser -Wbcatalog=" + XmlFile; + command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/salome/runIDLparser " + IDLpath + " -Wbcatalog=" + XmlFile; else { QAD_MessageBox::error1( this, tr("TOOLS_ERR_ERROR"), tr("KERNEL_ROOT_DIR variable is not defined"), tr("TOOLS_BUT_OK") ); } + if (!Author.isEmpty()) command += ",author=" + Author; if (!Version.isEmpty()) command += ",version=" + Version; if (!PngFile.isEmpty()) { diff --git a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h index 58343ce45..9d474ac67 100644 --- a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h +++ b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h @@ -46,6 +46,7 @@ public: ToolsGUI_CatalogGeneratorDlg( QWidget* parent = 0, const char* name = 0 ); ~ToolsGUI_CatalogGeneratorDlg(); + QString getIdlPath(); QString getIdlFile(); QString getXmlFile(); QString getPngFile(); -- 2.39.2