From 9c8d698c3b5d49b84083b87d766d3185ea394115 Mon Sep 17 00:00:00 2001 From: isn Date: Wed, 24 Jun 2015 10:36:10 +0300 Subject: [PATCH] refs #603 --- src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx | 46 +++++++++++++----------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx index 583def4b..621193da 100644 --- a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx @@ -79,35 +79,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)) + if (anExt == "sx") { - UpdateView(anEntities); - commitDocOperation(); - commit(); - } - else - { - 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(); -- 2.39.2