]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #603
authorisn <isn@opencascade.com>
Wed, 24 Jun 2015 07:36:10 +0000 (10:36 +0300)
committerisn <isn@opencascade.com>
Wed, 24 Jun 2015 07:36:10 +0000 (10:36 +0300)
src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx

index 583def4b7de8537cdede5f688640555a96ae588f..621193da245d77efb6c273047237fc4364558440 100644 (file)
@@ -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<Handle_HYDROData_Entity> anEntities;
-    if (aSinusXImporter.Import(aFileName, doc(), anEntities)) 
+    if (anExt == "sx")
     {
-      UpdateView(anEntities);
-      commitDocOperation();
-      commit();
-    }
-    else
-    {
-      abort();
+      HYDROData_SinusX aSinusXImporter;
+      NCollection_Sequence<Handle_HYDROData_Entity> 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();