1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "STEPPlugin_ImportDlg.h"
22 #include <QApplication>
26 //=============================================================================
28 //=============================================================================
29 STEPPlugin_ImportDlg::STEPPlugin_ImportDlg(QWidget *parent)
30 : SUIT_FileDlg (parent, true, true, true),
33 myCheckBox = new QCheckBox(tr("STEP_CREATE_ASSEMBLIES"), this);
35 myCheckBox->setChecked(true);
37 layout()->addWidget(myCheckBox);
40 //=============================================================================
42 //=============================================================================
43 STEPPlugin_ImportDlg::~STEPPlugin_ImportDlg()
47 //=============================================================================
49 //=============================================================================
50 bool STEPPlugin_ImportDlg::IsCreateAssemblies() const
52 return myCheckBox->isChecked();
55 //=============================================================================
57 //=============================================================================
58 QStringList STEPPlugin_ImportDlg::getOpenFileNames
59 (const QString &theInitial,
60 const QString &theFilters,
61 const QString &theCaption,
63 bool &IsCreateAssemblies)
65 STEPPlugin_ImportDlg anImpDlg(theParent);
66 QStringList aFilters = theFilters.split(";;", QString::SkipEmptyParts);
68 anImpDlg.setFileMode(ExistingFiles);
70 if (aFilters.isEmpty()) {
71 anImpDlg.setNameFilter(tr("ALL_FILES_FILTER")); // All files (*)
73 anImpDlg.setNameFilters(aFilters);
76 if (!theCaption.isEmpty()) {
77 anImpDlg.setWindowTitle(theCaption);
80 if (!theInitial.isEmpty()) {
81 anImpDlg.processPath(theInitial);
84 QStringList aFileNames;
86 if (anImpDlg.exec() == QDialog::Accepted) {
87 aFileNames = anImpDlg.selectedFiles();
88 IsCreateAssemblies = anImpDlg.IsCreateAssemblies();
91 QApplication::processEvents();