diff --git a/src/Gui/CommandDoc.cpp b/src/Gui/CommandDoc.cpp index 2d449542d..5c6a91185 100644 --- a/src/Gui/CommandDoc.cpp +++ b/src/Gui/CommandDoc.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include "Action.h" #include "Application.h" @@ -559,7 +560,7 @@ DEF_STD_CMD_A(StdCmdProjectInfo); StdCmdProjectInfo::StdCmdProjectInfo() :Command("Std_ProjectInfo") { - // seting the + // seting the sGroup = QT_TR_NOOP("File"); sMenuText = QT_TR_NOOP("Project i&nformation..."); sToolTipText = QT_TR_NOOP("Show details of the currently active project"); @@ -590,7 +591,7 @@ DEF_STD_CMD_A(StdCmdProjectUtil); StdCmdProjectUtil::StdCmdProjectUtil() :Command("Std_ProjectUtil") { - // seting the + // seting the sGroup = QT_TR_NOOP("Tools"); sWhatsThis = "Std_ProjectUtil"; sMenuText = QT_TR_NOOP("Project utility..."); @@ -1077,9 +1078,11 @@ void StdCmdDelete::activated(int iMsg) for (std::vector::iterator lt = links.begin(); lt != links.end(); ++lt) { if ( (!(*lt)->getTypeId().isDerivedFrom(App::DocumentObjectGroup::getClassTypeId())) && + (!(*lt)->getTypeId().isDerivedFrom(App::Origin::getClassTypeId())) && (!rSel.isSelected(*lt)) && (!(*lt)->getTypeId().isDerivedFrom(Base::Type::fromName("Part::BodyBase"))) ){ + // TODO Do something with this hack of Part::BodyBase (2015-09-09, Fat-Zer) autoDeletion = false; affectedLabels.insert(QString::fromUtf8((*lt)->Label.getValue())); } @@ -1099,7 +1102,7 @@ void StdCmdDelete::activated(int iMsg) "Are you sure you want to continue?\n\n"); for (const auto ¤tLabel : affectedLabels) bodyMessageStream << currentLabel << '\n'; - + int ret = QMessageBox::question(Gui::getMainWindow(), qApp->translate("Std_Delete", "Object dependencies"), bodyMessage, QMessageBox::Yes, QMessageBox::No); @@ -1158,7 +1161,7 @@ void StdCmdRefresh::activated(int iMsg) //testing the changes of properties. //openCommand("Refresh active document"); doCommand(Doc,"App.activeDocument().recompute()"); - //commitCommand(); + //commitCommand(); } } diff --git a/src/Gui/ViewProviderOriginFeature.cpp b/src/Gui/ViewProviderOriginFeature.cpp index 6770b05d8..b87ce919d 100644 --- a/src/Gui/ViewProviderOriginFeature.cpp +++ b/src/Gui/ViewProviderOriginFeature.cpp @@ -38,6 +38,7 @@ #endif #include +#include #include "SoFCSelection.h" #include "Window.h" @@ -176,3 +177,14 @@ void ViewProviderOriginFeature::setDisplayMode (const char* ModeName) setDisplayMaskMode("Base"); ViewProviderGeometryObject::setDisplayMode(ModeName); } + +bool ViewProviderOriginFeature::onDelete(const std::vector &) { + App::OriginFeature *feat = static_cast ( getObject() ); + // Forbid deletion if there is an origin thes feature belongs to + + if ( feat->getOrigin () ) { + return false; + } else { + return true; + } +} diff --git a/src/Gui/ViewProviderOriginFeature.h b/src/Gui/ViewProviderOriginFeature.h index adc185c61..588cd3eda 100644 --- a/src/Gui/ViewProviderOriginFeature.h +++ b/src/Gui/ViewProviderOriginFeature.h @@ -65,6 +65,7 @@ public: protected: virtual void onChanged ( const App::Property* prop ); + virtual bool onDelete ( const std::vector & ); protected: SoSeparator * pOriginFeatureRoot; SoScale * pScale;