Salome HOME
0022626: EDF 8453 GEOM: order with SubShapeAllSortedCentres
[modules/geom.git] / src / ImportExportGUI / ImportExportGUI_ImportXAODlg.cxx
index c4681af62c244442a897df051f6fbe15c00f2d84..5272fa78856eff463a70660f913ca39180668a5b 100644 (file)
@@ -1,20 +1,21 @@
-//  Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  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
-//  version 2.1 of the License.
+// 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
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
 #include <DlgRef.h>
 #include <GeometryGUI.h>
@@ -24,6 +25,7 @@
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_OverrideCursor.h>
+#include <SUIT_FileDlg.h>
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
 #include <LightApp_SelectionMgr.h>
@@ -101,7 +103,7 @@ ImportExportGUI_ImportXAODlg::ImportExportGUI_ImportXAODlg(GeometryGUI* geometry
     layout->addWidget(gbxExport);
 
     // set help
-    setHelpFileName("create_importxao_page.html");
+    setHelpFileName("xao_format_page.html");
 
     Init();
 }
@@ -191,12 +193,11 @@ bool ImportExportGUI_ImportXAODlg::ClickOnApply()
 //=================================================================================
 void ImportExportGUI_ImportXAODlg::btnFileSelectClicked()
 {
-    QString selFile = QFileDialog::getOpenFileName(this, tr("GEOM_SELECT_EXPORT_XAO"),
-                                                   QString(), tr("XAO_FILES"));
-    if (!selFile.isEmpty())
-    {
-        ledFileName->setText(selFile);
-    }
+  QString file = SUIT_FileDlg::getFileName(this, ledFileName->text(), 
+                                           tr("XAO_FILES"), 
+                                           tr("GEOM_SELECT_IMPORT_XAO"));
+  if ( !file.isEmpty() )
+    ledFileName->setText( file );
 }
 
 //=================================================================================
@@ -254,7 +255,7 @@ bool ImportExportGUI_ImportXAODlg::execute()
     GEOM::ListOfFields_var fields;
 
     GEOM::GEOM_IInsertOperations_var ieOp = GEOM::GEOM_IInsertOperations::_narrow(getOperation());
-    res = ieOp->ImportXAO(fileName.toStdString().c_str(), shape, subShapes, groups, fields);
+    res = ieOp->ImportXAO(fileName.toUtf8().constData(), shape, subShapes, groups, fields);
 
     if (!shape->_is_nil())
     {