From: adv Date: Mon, 9 Sep 2013 05:59:49 +0000 (+0000) Subject: Dump to Python operation for GUI part corrected. X-Git-Tag: BR_hydro_v_0_1~58 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e46fa98950f0fde61621f135311f09debeb74e9b;p=modules%2Fhydro.git Dump to Python operation for GUI part corrected. --- diff --git a/src/HYDROGUI/HYDROGUI_DataModel.cxx b/src/HYDROGUI/HYDROGUI_DataModel.cxx index fc7a3838..09910953 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModel.cxx @@ -54,6 +54,7 @@ #include #include +#include HYDROGUI_DataModel::HYDROGUI_DataModel( CAM_Module* theModule ) : LightApp_DataModel( theModule ) @@ -155,25 +156,24 @@ bool HYDROGUI_DataModel::dumpPython( const QString& theURL, bool isMultiFile, QStringList& theListOfFiles ) { + LightApp_DataModel::dumpPython( theURL, theStudy, isMultiFile, theListOfFiles ); + int aStudyId = theStudy->id(); + LightApp_Study* aStudy = ::qobject_cast( theStudy ); Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( aStudyId ); - if( aDocument.IsNull() ) + if ( aDocument.IsNull() || !aStudy ) return false; - QString aFileToExport = theURL; - - if ( isMultiFile ) - { - // each module's dump is written into a separate Python file - } - - - QApplication::setOverrideCursor( Qt::WaitCursor ); + QString aFileToExport = aStudy->GetTmpDir( theURL.toLatin1().constData(), isMultiFile ).c_str(); + aFileToExport += QString( QDir::separator() ) + "HYDRO.py"; bool aRes = aDocument->DumpToPython( aFileToExport ); - QApplication::restoreOverrideCursor(); + if ( aRes ) + { + theListOfFiles.append( aFileToExport ); + } return aRes; }