#include <ModelAPI_Validator.h>
#include <ModelAPI_Tools.h>
#include <ModelAPI_ResultField.h>
+#include <ModuleBase_IconFactory.h>
//#include <PartSetPlugin_Part.h>
#include <ExchangePlugin_ExportPart.h>
#include <ExchangePlugin_ImportPart.h>
+#include <ExchangePlugin_Import.h>
#include <GeomAPI_Pnt.h>
#include <GeomAPI_ShapeExplorer.h>
// Load translations
QStringList aLangs;
aLangs << "*_en.ts"; // load by default eng translations
+
+ /// If version of OCCT is 7.4.0 or more then it means that
+ /// this is version of SALOME older then 9.4.0
+#if OCC_VERSION_HEX >= 0x070400
+ QString aCurrLang = aResMgr->language();
+#else
QString aCurrLang = aResMgr->stringValue("language", "language", "en");
+#endif
+
if(aCurrLang != "en") {
aLangs << "*_" + aCurrLang + ".ts"; // then replace with translated files
}
QIcon(), QKeySequence(),
false, "MEN_DESK_FILE");
connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onImportPart()));
+
+ aAction = salomeConnector()->addDesktopCommand("IMPORT_SHAPE_CMD", tr("Import shape..."),
+ tr("Import shape from a file"),
+ ModuleBase_IconFactory::loadIcon("icons/Exchange/import.png"),
+ QKeySequence(), false, "MEN_DESK_FILE");
+ connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onImportShape()));
+
salomeConnector()->addDesktopMenuSeparator("MEN_DESK_FILE");
#else
}
}
+//******************************************************
+void XGUI_Workshop::onImportShape()
+{
+ if (abortAllOperations()) {
+ ModuleBase_OperationFeature* anImportOp = dynamic_cast<ModuleBase_OperationFeature*>(
+ module()->createOperation(ExchangePlugin_Import::ID()));
+ operationMgr()->startOperation(anImportOp);
+ }
+}
+
//******************************************************
void XGUI_Workshop::onExportPart()
{
}
QObjectPtrList anObjects = mySelector->selection()->selectedObjects();
+ if (anObjects.isEmpty())
+ return;
+
if (!abortAllOperations())
return;