From 56a8a18ec7662acd66454b5e8b624127c0577784 Mon Sep 17 00:00:00 2001 From: Sergey POKHODENKO Date: Fri, 8 May 2015 15:26:05 +0300 Subject: [PATCH] Issue #539: import step - *.stp files --- src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp | 2 +- src/ExchangePlugin/ExchangePlugin_Validators.cpp | 10 +++++++--- src/ExchangePlugin/ExchangePlugin_Validators.h | 2 +- src/ExchangePlugin/plugin-Exchange.xml | 2 +- src/ModuleBase/ModuleBase_WidgetFileSelector.cpp | 9 ++++++--- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index f3f53a273..57a4e933a 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -87,7 +87,7 @@ bool ExchangePlugin_ImportFeature::importFile(const std::string& theFileName) TopoDS_Shape aShape; if (aFormatName == "BREP") { aShape = BREPImport::Import(aFileName, aFormatName, anError, anUnknownLabel); - } else if (aFormatName == "STEP") { + } else if (aFormatName == "STEP" || aFormatName == "STP") { aShape = STEPImport::Import(aFileName, aFormatName, anError, anUnknownLabel); } // Check if shape is valid diff --git a/src/ExchangePlugin/ExchangePlugin_Validators.cpp b/src/ExchangePlugin/ExchangePlugin_Validators.cpp index c001a0c3f..5dc974e72 100644 --- a/src/ExchangePlugin/ExchangePlugin_Validators.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Validators.cpp @@ -12,6 +12,7 @@ #include #include +#include #include bool ExchangePlugin_ImportFormatValidator::parseFormats(const std::list& theArguments, @@ -26,9 +27,12 @@ bool ExchangePlugin_ImportFormatValidator::parseFormats(const std::list& theArguments, - std::list& outFormats); + std::list& outFormats); public: /** * Returns true is the file-name attribute correctly corresponds to the set of diff --git a/src/ExchangePlugin/plugin-Exchange.xml b/src/ExchangePlugin/plugin-Exchange.xml index 76a107e82..36f2801d5 100644 --- a/src/ExchangePlugin/plugin-Exchange.xml +++ b/src/ExchangePlugin/plugin-Exchange.xml @@ -8,7 +8,7 @@ id="import_file_selector" title="Import file" path=""> - + diff --git a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp index ac79ba823..f997592d1 100644 --- a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp @@ -17,14 +17,15 @@ #include -#include #include +#include +#include #include #include #include #include +#include #include -#include #include #include @@ -131,7 +132,9 @@ QString ModuleBase_WidgetFileSelector::formatsString() const QStringList aValidatorFormats = getValidatorFormats(); foreach(QString eachFormat, aValidatorFormats) { - aResult << QString("%1 files (*.%1)").arg(eachFormat); + QStringList aFormatList = eachFormat.split("|"); + aResult << QString("%1 files (%2)").arg(aFormatList.value(0)) + .arg(QStringList(aFormatList).replaceInStrings(QRegExp("^(.*)$"), "*.\\1").join(" ")); } aResult << QString("All files (*.*)"); return aResult.join(";;"); -- 2.39.2