From 3dce28e00b37dbc9320e812dcd95c2f76ed1e5c8 Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 20 Nov 2018 13:44:37 +0300 Subject: [PATCH] Make native file extension .shaper for SALOME version --- src/SHAPERGUI/SHAPERGUI_DataModel.cpp | 2 +- src/XGUI/XGUI_Workshop.cpp | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/SHAPERGUI/SHAPERGUI_DataModel.cpp b/src/SHAPERGUI/SHAPERGUI_DataModel.cpp index 304dc616c..015fde137 100644 --- a/src/SHAPERGUI/SHAPERGUI_DataModel.cpp +++ b/src/SHAPERGUI/SHAPERGUI_DataModel.cpp @@ -122,7 +122,7 @@ bool SHAPERGUI_DataModel::save(QStringList& theFiles) aMgr->blockAutoUpdate(false); //aWorkShop->saveDocument(QString(aTmpDir.c_str()), aFileNames); - aWorkShop->setCurrentDataFile(aTmp + "shaper.opp"); + aWorkShop->setCurrentDataFile(aTmp + "shaper.shaper"); aWorkShop->onSave(); QString aName = aWorkShop->currentDataFile(); std::string aa = aName.toStdString(); diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 2e135c8d9..54d240e86 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -170,8 +170,15 @@ QString XGUI_Workshop::MOVE_TO_END_COMMAND = QObject::tr("Move to the end"); //#define DEBUG_FEATURE_NAME //#define DEBUG_CLEAN_HISTORY - +#ifdef HAVE_SALOME +static QString MyFilter(QObject::tr("OpenParts files (*.shaper *.opp)")); +static QString MyFilter2(QObject::tr("OpenParts files (*.shaper)")); +static QString MyExtension(".shaper"); +#else static QString MyFilter(QObject::tr("OpenParts files (*.opp)")); +static QString MyFilter2(QObject::tr("OpenParts files (*.opp)")); +static QString MyExtension(".opp"); +#endif //****************************************************** @@ -1082,10 +1089,10 @@ bool XGUI_Workshop::onSaveAs() if(!myOperationMgr->abortAllOperations(XGUI_OperationMgr::XGUI_InformationMessage)) return false; myCurrentFile = QFileDialog::getSaveFileName(desktop(), tr("Select name to save file..."), - QString(), MyFilter); + QString(), MyFilter2); if (!myCurrentFile.isNull()) { - if (!myCurrentFile.endsWith(".opp")) { - myCurrentFile += ".opp"; + if (!myCurrentFile.endsWith(MyExtension)) { + myCurrentFile += MyExtension; } } else -- 2.39.2