X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ImportSinusXOp.cxx;h=6b3f9eb0f06b8d25ff2448a9a4f71e6418f12e6e;hb=541470db80142c32e3812a7b79e26727df1dcece;hp=583def4b7de8537cdede5f688640555a96ae588f;hpb=27b1abdc88719c5bce7a8d2f49612cd155e80d21;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx index 583def4b..6b3f9eb0 100644 --- a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx @@ -1,8 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// Copyright (C) 2014-2015 EDF-R&D // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either @@ -79,35 +75,39 @@ void HYDROGUI_ImportSinusXOp::onApply() return; } - QString aFileName = myFileDlg->selectedFile(); - if ( aFileName.isEmpty() ) - { - abort(); - return; - } - - QString anExt = aFileName.split('.', QString::SkipEmptyParts).back(); + QStringList aFileNames = myFileDlg->selectedFiles(); + bool IsImported = false; + + QApplication::setOverrideCursor( Qt::WaitCursor ); + startDocOperation(); - if (anExt == "sx") + foreach (QString aFileName, aFileNames) { - QApplication::setOverrideCursor( Qt::WaitCursor ); + if ( aFileName.isEmpty() ) + continue; - startDocOperation(); + QString anExt = aFileName.split('.', QString::SkipEmptyParts).back(); - HYDROData_SinusX aSinusXImporter; - NCollection_Sequence anEntities; - if (aSinusXImporter.Import(aFileName, doc(), anEntities)) - { - UpdateView(anEntities); - commitDocOperation(); - commit(); - } - else + if (anExt == "sx") { - abort(); + HYDROData_SinusX aSinusXImporter; + NCollection_Sequence anEntities; + if (aSinusXImporter.Import(aFileName, doc(), anEntities)) + { + UpdateView(anEntities); + IsImported = true; + } } } + if (IsImported) + { + commitDocOperation(); + commit(); + } + else + abort(); + module()->update( UF_Model | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init ); QApplication::restoreOverrideCursor();