From: vsv Date: Fri, 14 Feb 2020 11:45:23 +0000 (+0300) Subject: Issue #3138: Create Import, Export sub-menus in File menu X-Git-Tag: V9_5_0a1~14^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=112f1783c84a66139c1e7d5fcec75bf4bbb6d667;p=modules%2Fshaper.git Issue #3138: Create Import, Export sub-menus in File menu --- diff --git a/src/ExchangePlugin/plugin-Exchange.xml b/src/ExchangePlugin/plugin-Exchange.xml index f62481945..d47c5cd83 100644 --- a/src/ExchangePlugin/plugin-Exchange.xml +++ b/src/ExchangePlugin/plugin-Exchange.xml @@ -13,14 +13,13 @@ tooltip="Select the part to import the document" /> + helpfile="importFeature.html" internal="1"> + helpfile="exportFeature.html" internal="1"> #include #include +#include #include #include @@ -472,38 +473,43 @@ void XGUI_Workshop::initMenu() // Add commands to a file menu - aAction = salomeConnector()->addDesktopCommand("SAVEAS_CMD", tr("Export native..."), - tr("Export the current document into a native file"), - QIcon(), QKeySequence(), - false, "MEN_DESK_FILE"); - connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onSaveAs())); - - aAction = salomeConnector()->addDesktopCommand("OPEN_CMD", tr("Import native..."), + // Import sub-menu + aAction = salomeConnector()->addDesktopCommand("OPEN_CMD", tr("Part set..."), tr("Import native file"), QIcon(), QKeySequence(), - false, "MEN_DESK_FILE"); + false, "MEN_DESK_FILE", tr("Import"), 10, 10); connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onOpen())); - salomeConnector()->addDesktopMenuSeparator("MEN_DESK_FILE"); - aAction = salomeConnector()->addDesktopCommand("EXPORT_PART_CMD", tr("Export part..."), - tr("Export a part of the current document into a file"), - QIcon(), QKeySequence(), - false, "MEN_DESK_FILE"); - connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onExportPart())); - - aAction = salomeConnector()->addDesktopCommand("IMPORT_PART_CMD", tr("Import part..."), + aAction = salomeConnector()->addDesktopCommand("IMPORT_PART_CMD", tr("Part..."), tr("Import structure of a part"), QIcon(), QKeySequence(), - false, "MEN_DESK_FILE"); + false, "MEN_DESK_FILE", tr("Import"), 10, 10); connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onImportPart())); - aAction = salomeConnector()->addDesktopCommand("IMPORT_SHAPE_CMD", tr("Import shape..."), - tr("Import shape from a file"), + aAction = salomeConnector()->addDesktopCommand("IMPORT_SHAPE_CMD", tr("From CAD format..."), + tr("Import shape from a CAD format file"), ModuleBase_IconFactory::loadIcon("icons/Exchange/import.png"), - QKeySequence(), false, "MEN_DESK_FILE"); + QKeySequence(), false, "MEN_DESK_FILE", tr("Import"), 10, 10); connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onImportShape())); - salomeConnector()->addDesktopMenuSeparator("MEN_DESK_FILE"); + // Export sub-menu + aAction = salomeConnector()->addDesktopCommand("SAVEAS_CMD", tr("Part set..."), + tr("Export the current document into a native file"), + QIcon(), QKeySequence(), + false, "MEN_DESK_FILE", tr("Export"), 10, 11); + connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onSaveAs())); + + aAction = salomeConnector()->addDesktopCommand("EXPORT_PART_CMD", tr("Part..."), + tr("Export a part of the current document into a file"), + QIcon(), QKeySequence(), + false, "MEN_DESK_FILE", tr("Export"), 10, 11); + connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onExportPart())); + + aAction = salomeConnector()->addDesktopCommand("EXPORT_SHAPE_CMD", tr("To CAD format..."), + tr("Export shape to a CAD format file"), + ModuleBase_IconFactory::loadIcon("icons/Exchange/export.png"), + QKeySequence(), false, "MEN_DESK_FILE", tr("Export"), 10, 11); + connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onExportShape())); #else // File commands group @@ -1321,6 +1327,17 @@ void XGUI_Workshop::onImportShape() } } +//****************************************************** +void XGUI_Workshop::onExportShape() +{ + if (abortAllOperations()) { + ModuleBase_OperationFeature* anExportOp = dynamic_cast( + module()->createOperation(ExchangePlugin_ExportFeature::ID())); + myPropertyPanel->updateApplyPlusButton(anExportOp->feature()); + operationMgr()->startOperation(anExportOp); + } +} + //****************************************************** void XGUI_Workshop::onExportPart() { diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index 2a3eacc14..18f9cd77c 100644 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -405,12 +405,15 @@ signals: /// Import part structure from a file void onImportPart(); - /// Import part structure from a file + /// Import shape from a file void onImportShape(); /// Export features to a file void onExportPart(); + /// Export a shape to a file + void onExportShape(); + #ifndef HAVE_SALOME /// Exit application void onExit(); diff --git a/src/XGUI/XGUI_msg_fr.ts b/src/XGUI/XGUI_msg_fr.ts index f6e80a045..666c30458 100644 --- a/src/XGUI/XGUI_msg_fr.ts +++ b/src/XGUI/XGUI_msg_fr.ts @@ -204,6 +204,10 @@ Windows Fenêtres + + Iso-lines... + Iso-lines... + XGUI_DataTree @@ -539,7 +543,7 @@ Export native... - Exporter natif... + Exporter natif... Export the current document into a native file @@ -547,7 +551,7 @@ Import native... - Importer natif... + Importer natif... Import native file @@ -667,7 +671,7 @@ Supprimer des objets du panneau à afficher ? Export part... - Partie export... + Partie export... Export a part of the current document into a file @@ -675,11 +679,47 @@ Supprimer des objets du panneau à afficher ? Import part... - Importer une partie... + Importer une partie... Import structure of a part Structure d'importation d'une pièce + + Part set... + Ensemble de parties... + + + Import + Importation + + + Part... + Partie... + + + From CAD format... + A partir du format CAO... + + + Import shape from a CAD format file + Importer une forme à partir d'un fichier au format CAO + + + Export + Exporter + + + To CAD format... + Au format CAO... + + + Number of Iso-lines + Nombre de Iso-lignes + + + Export shape to a CAD format file + Exportation de la forme vers un fichier au format CAO +