From: vsv Date: Fri, 22 Nov 2019 13:02:17 +0000 (+0300) Subject: Issue #3069: Do not ask confirmation for operation closing if it doesn't produce... X-Git-Tag: V9_5_0a1~166^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4a4df92151313b04bcedb6b59001658c7038f931;p=modules%2Fshaper.git Issue #3069: Do not ask confirmation for operation closing if it doesn't produce persistent result --- diff --git a/src/Config/Config_FeatureMessage.cpp b/src/Config/Config_FeatureMessage.cpp index 4728b95f8..e21246920 100644 --- a/src/Config/Config_FeatureMessage.cpp +++ b/src/Config/Config_FeatureMessage.cpp @@ -41,6 +41,7 @@ Config_FeatureMessage::Config_FeatureMessage(const Events_ID theId, const void* myIsTitleInToolbar = true; myIsApplyContinue = false; myHideFacesPanel = false; + myAbortConfirmation = true; } Config_FeatureMessage::~Config_FeatureMessage() @@ -250,3 +251,13 @@ void Config_FeatureMessage::setHideFacesPanel(bool theValue) { myHideFacesPanel = theValue; } + +bool Config_FeatureMessage::isAbortConfirmation() const +{ + return myAbortConfirmation; +} + +void Config_FeatureMessage::setAbortConfirmation(bool theValue) +{ + myAbortConfirmation = theValue; +} diff --git a/src/Config/Config_FeatureMessage.h b/src/Config/Config_FeatureMessage.h index 89b7ada65..8228256a8 100644 --- a/src/Config/Config_FeatureMessage.h +++ b/src/Config/Config_FeatureMessage.h @@ -56,6 +56,7 @@ class Config_FeatureMessage : public Events_Message bool myIsAutoPreview; ///< Preview computation is performed automatically bool myIsTitleInToolbar; ///< False if title should not be displayed in the toolbar bool myHideFacesPanel; ///< Show or Hide HideFaces panel. By default is False + bool myAbortConfirmation; ///< Ask confirmation of abort of the feature from user /// True if the feature can have Apply/Continue button in its property panel bool myIsApplyContinue; @@ -123,6 +124,7 @@ class Config_FeatureMessage : public Events_Message CONFIG_EXPORT bool isTitleInToolbar() const; /// If true - then HideFaces panel has to be shown CONFIG_EXPORT bool isHideFacesPanel() const; + CONFIG_EXPORT bool isAbortConfirmation() const; ///Set feature's Id CONFIG_EXPORT void setId(const std::string& id); @@ -162,6 +164,8 @@ class Config_FeatureMessage : public Events_Message CONFIG_EXPORT void setTitleInToolbar(bool theValue); ///Set flag to display title in toolbar CONFIG_EXPORT void setHideFacesPanel(bool theValue); + ///Set flag to display title in toolbar + CONFIG_EXPORT void setAbortConfirmation(bool theValue); ///Set Apply/Continue state; ///If true - the feature can have Apply/Continue button in its property panel CONFIG_EXPORT void setApplyContinue(bool isModal); diff --git a/src/Config/Config_FeatureReader.cpp b/src/Config/Config_FeatureReader.cpp index 512137c92..7254b5577 100644 --- a/src/Config/Config_FeatureReader.cpp +++ b/src/Config/Config_FeatureReader.cpp @@ -182,6 +182,9 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theFeatureNode, bool isHideFaces = getBooleanAttribute(theFeatureNode, HIDEFACES_PANEL, false); outFeatureMessage->setHideFacesPanel(isHideFaces); + bool isConfirmAbort = getBooleanAttribute(theFeatureNode, ABORT_CONFIRMATION, true); + outFeatureMessage->setAbortConfirmation(isConfirmAbort); + //if (isInternal) { // //Internal feature has no visual representation. // return; diff --git a/src/Config/Config_Keywords.h b/src/Config/Config_Keywords.h index 70ca0db2a..21af73c07 100644 --- a/src/Config/Config_Keywords.h +++ b/src/Config/Config_Keywords.h @@ -78,6 +78,7 @@ const static char* GROUP_TOOLBAR = "toolbar"; const static char* FEATURE_ICON = "icon"; const static char* FEATURE_TEXT = "title"; const static char* HELP_FILE = "helpfile"; +const static char* ABORT_CONFIRMATION = "abort_confirmation"; const static char* HIDEFACES_PANEL = "hidefaces_panel"; const static char* FEATURE_KEYSEQUENCE = "keysequence"; const static char* FEATURE_NESTED = "nested"; diff --git a/src/Config/Config_WidgetAPI.h b/src/Config/Config_WidgetAPI.h index 8f3a826af..055097cb7 100644 --- a/src/Config/Config_WidgetAPI.h +++ b/src/Config/Config_WidgetAPI.h @@ -77,7 +77,6 @@ class Config_WidgetAPI */ CONFIG_EXPORT bool getBooleanAttribute(const char* theAttributeName, bool theDefault) const; - protected: /// These fields are accessible for ModuleBase_WidgetFactory only CONFIG_EXPORT Config_WidgetAPI(std::string theRawXml); //! Pass to the next (sibling) node of widget's xml definition. If impossible, returns false diff --git a/src/ExchangePlugin/plugin-Exchange.xml b/src/ExchangePlugin/plugin-Exchange.xml index 8b8cd1a1d..b2da9c048 100644 --- a/src/ExchangePlugin/plugin-Exchange.xml +++ b/src/ExchangePlugin/plugin-Exchange.xml @@ -12,7 +12,7 @@ + helpfile="dumpFeature.html" abort_confirmation="false"> + icon="icons/Features/measurement.png" helpfile="measurementFeature.html" abort_confirmation="false"> diff --git a/src/ModuleBase/CMakeLists.txt b/src/ModuleBase/CMakeLists.txt index 265c140f5..37f13abdd 100644 --- a/src/ModuleBase/CMakeLists.txt +++ b/src/ModuleBase/CMakeLists.txt @@ -55,7 +55,6 @@ SET(PROJECT_HEADERS ModuleBase_ListView.h ModuleBase_ModelWidget.h ModuleBase_Operation.h - ModuleBase_OperationAction.h ModuleBase_OperationDescription.h ModuleBase_OperationFeature.h ModuleBase_PageBase.h @@ -125,7 +124,6 @@ SET(PROJECT_MOC_HEADERS ModuleBase_ModelDialogWidget.h ModuleBase_ModelWidget.h ModuleBase_Operation.h - ModuleBase_OperationAction.h ModuleBase_OperationFeature.h ModuleBase_PagedContainer.h ModuleBase_PageGroupBox.h @@ -182,7 +180,6 @@ SET(PROJECT_SOURCES ModuleBase_ListView.cpp ModuleBase_ModelWidget.cpp ModuleBase_Operation.cpp - ModuleBase_OperationAction.cpp ModuleBase_OperationDescription.cpp ModuleBase_OperationFeature.cpp ModuleBase_PageBase.cpp diff --git a/src/ModuleBase/ModuleBase_IPropertyPanel.cpp b/src/ModuleBase/ModuleBase_IPropertyPanel.cpp index df66658a7..cd8b25c40 100644 --- a/src/ModuleBase/ModuleBase_IPropertyPanel.cpp +++ b/src/ModuleBase/ModuleBase_IPropertyPanel.cpp @@ -78,3 +78,14 @@ ModuleBase_ModelWidget* ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget } return aFirstWidget; } + +bool ModuleBase_IPropertyPanel::isModified() const +{ + bool isModified = false; + QList aWidgets = modelWidgets(); + foreach(ModuleBase_ModelWidget* aWgt, aWidgets) { + bool aRes = aWgt->isModified(); + isModified |= aRes; + } + return isModified; +} diff --git a/src/ModuleBase/ModuleBase_IPropertyPanel.h b/src/ModuleBase/ModuleBase_IPropertyPanel.h index a4f954ea0..16fdecf13 100644 --- a/src/ModuleBase/ModuleBase_IPropertyPanel.h +++ b/src/ModuleBase/ModuleBase_IPropertyPanel.h @@ -88,6 +88,9 @@ public: /// The method is called on accepting of operation virtual void onAcceptData() = 0; + /// Returns True if data of its feature was modified during operation + virtual bool isModified() const; + /// Returns the first widget, where canAcceptFocus returns true /// \return a widget or null static ModuleBase_ModelWidget* findFirstAcceptingValueWidget( diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index 3d667f6f1..e29e8856b 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -310,6 +310,9 @@ Q_OBJECT /// for current feature. By default does nothing virtual void showInformativePage() {} + /// Returns True if data of its attribute was modified + virtual bool isModified() const { return false; } + signals: /// The signal about widget values are to be changed void beforeValuesChanged(); diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index 305586509..81da1e47d 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -40,6 +40,8 @@ #include #include +#include +#include #include @@ -177,3 +179,17 @@ bool ModuleBase_Operation::isGranted(QString theId) const { return myGrantedIds.contains(theId); } + +bool ModuleBase_Operation::isModified() const +{ + if (myDescription->hasXmlRepresentation()) { + Config_WidgetAPI aWidgetApi(myDescription->xmlRepresentation().toStdString()); + if (!aWidgetApi.getBooleanAttribute(ABORT_CONFIRMATION, true)) + return false; + } + //if (myPropertyPanel) + // return myPropertyPanel->isModified(); + //return false; + // Most of operation causes creation of a feature + return true; +} diff --git a/src/ModuleBase/ModuleBase_Operation.h b/src/ModuleBase/ModuleBase_Operation.h index ecc4c7c07..6ce75a839 100644 --- a/src/ModuleBase/ModuleBase_Operation.h +++ b/src/ModuleBase/ModuleBase_Operation.h @@ -80,10 +80,7 @@ Q_OBJECT virtual bool isGranted(QString theId) const; /// Returns True if data of its feature was modified during operation - virtual bool isModified() const { return myIsModified; } - - /// Change the modified state of the operation - void setIsModified(const bool theIsModified) { myIsModified = theIsModified; } + virtual bool isModified() const; /// Returns operations Id from it's description QString id() const; diff --git a/src/ModuleBase/ModuleBase_OperationAction.cpp b/src/ModuleBase/ModuleBase_OperationAction.cpp deleted file mode 100644 index c55c69300..000000000 --- a/src/ModuleBase/ModuleBase_OperationAction.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#include "ModuleBase_OperationAction.h" - -ModuleBase_OperationAction::ModuleBase_OperationAction(const QString& theId, QObject* theParent) - : ModuleBase_Operation(theId, theParent) -{ -} - -ModuleBase_OperationAction::~ModuleBase_OperationAction() -{ -} - -bool ModuleBase_OperationAction::commit() -{ - // the action is supposed to perform a single modification, - // so the operation returns modified state - setIsModified(true); - - return ModuleBase_Operation::commit(); -} diff --git a/src/ModuleBase/ModuleBase_OperationAction.h b/src/ModuleBase/ModuleBase_OperationAction.h deleted file mode 100644 index 35b9acfea..000000000 --- a/src/ModuleBase/ModuleBase_OperationAction.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -#ifndef ModuleBase_OperationAction_H -#define ModuleBase_OperationAction_H - -#include - -#include - -/*! - * \class ModuleBase_OperationAction - * \ingroup GUI - * \brief Base class for action operations - * - * This is an action-like operation, which modifies the structure of data through - * starting/comitting transactions in the document. This operations are single stepped, - * and have no filled property panel, like Delete/Detach. - */ - -class MODULEBASE_EXPORT ModuleBase_OperationAction : public ModuleBase_Operation -{ -Q_OBJECT - - public: - /// Constructor - /// \param theId the operation identifier - /// \param theParent the QObject parent - ModuleBase_OperationAction(const QString& theId = "", QObject* theParent = 0); - /// Destructor - virtual ~ModuleBase_OperationAction(); - - public slots: - /// Commits the operation. Change is modified state to true value. - /// \return the result of commit - virtual bool commit(); -}; - -#endif diff --git a/src/ModuleBase/ModuleBase_OperationFeature.cpp b/src/ModuleBase/ModuleBase_OperationFeature.cpp index aa2d464fc..98cbc7440 100644 --- a/src/ModuleBase/ModuleBase_OperationFeature.cpp +++ b/src/ModuleBase/ModuleBase_OperationFeature.cpp @@ -175,22 +175,6 @@ FeaturePtr ModuleBase_OperationFeature::createFeature(const bool theFlushMessage std::shared_ptr aDoc = ModelAPI_Session::get()->activeDocument(); myFeature = aDoc->addFeature(getDescription()->operationId().toStdString()); } - if (myFeature) { // TODO: generate an error if feature was not created - setIsModified(true); - // Model update should call "execute" of a feature. - //myFeature->execute(); - // Init default values - /*QList aWidgets = getDescription()->modelWidgets(); - QList::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end(); - for (; anIt != aLast; anIt++) { - (*anIt)->storeValue(aFeature); - }*/ - } - - //if (theFlushMessage) { - // Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED)); - // Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); - //} return myFeature; } @@ -249,7 +233,6 @@ bool ModuleBase_OperationFeature::start() #ifdef DEBUG_OPERATION_START qDebug("ModuleBase_OperationFeature::start -- begin"); #endif - setIsModified(false); QString anId = getDescription()->operationId(); if (myIsEditing) { anId = anId.append(EditSuffix()); diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 54cc1d3ce..c07a5f4b1 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -230,3 +230,18 @@ bool ModuleBase_WidgetDoubleValue::processEnter() } return isModified; } + +bool ModuleBase_WidgetDoubleValue::isModified() const +{ + QString aText = mySpinBox->text(); + if (aText.isEmpty()) + return false; + + if (myHasDefault) { + bool aOk = false; + double aVal = aText.toDouble(&aOk); + if (!aOk || aVal == myDefaultVal) + return false; + } + return true; +} \ No newline at end of file diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.h b/src/ModuleBase/ModuleBase_WidgetDoubleValue.h index 4854ffe7a..db658ac8b 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.h +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.h @@ -58,6 +58,9 @@ Q_OBJECT /// \return a control list virtual QList getControls() const; + /// Returns True if data of its feature was modified during operation + virtual bool isModified() const; + public slots: // Delayed value chnged: when user starts typing something, // it gives him a 0,5 second to finish typing, when sends valueChnaged() signal diff --git a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp index 0e131bb1d..25bee53c8 100644 --- a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp @@ -230,3 +230,18 @@ bool ModuleBase_WidgetIntValue::processEnter() } return isModified; } + +bool ModuleBase_WidgetIntValue::isModified() const +{ + QString aText = mySpinBox->text(); + if (aText.isEmpty()) + return false; + + if (myHasDefault) { + bool aOk = false; + int aVal = aText.toInt(&aOk); + if (!aOk || aVal == myDefVal) + return false; + } + return true; +} \ No newline at end of file diff --git a/src/ModuleBase/ModuleBase_WidgetIntValue.h b/src/ModuleBase/ModuleBase_WidgetIntValue.h index 7fb7d13f4..955e3aa97 100644 --- a/src/ModuleBase/ModuleBase_WidgetIntValue.h +++ b/src/ModuleBase/ModuleBase_WidgetIntValue.h @@ -58,6 +58,9 @@ Q_OBJECT /// \return a control list virtual QList getControls() const; + /// Returns True if data of its feature was modified during operation + virtual bool isModified() const; + protected: /// Returns true if the event is processed. virtual bool processEnter(); diff --git a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp index e915477ed..f5429cc3f 100644 --- a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp +++ b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp @@ -160,3 +160,8 @@ bool ModuleBase_WidgetLineEdit::processEnter() } return isModified; } + +bool ModuleBase_WidgetLineEdit::isModified() const +{ + return !myLineEdit->text().isEmpty(); +} \ No newline at end of file diff --git a/src/ModuleBase/ModuleBase_WidgetLineEdit.h b/src/ModuleBase/ModuleBase_WidgetLineEdit.h index 05d6b1ed5..c1622c4aa 100644 --- a/src/ModuleBase/ModuleBase_WidgetLineEdit.h +++ b/src/ModuleBase/ModuleBase_WidgetLineEdit.h @@ -51,6 +51,9 @@ class MODULEBASE_EXPORT ModuleBase_WidgetLineEdit : public ModuleBase_ModelWidge /// Redefinition of virtual method virtual QList getControls() const; + /// Returns True if data of its feature was modified during operation + virtual bool isModified() const; + protected: /// Returns true if the event is processed. virtual bool processEnter(); diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 337aa8acf..4897b5704 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -1180,3 +1180,8 @@ void ModuleBase_WidgetMultiSelector::onShowOnly(bool theChecked) } else Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY)); } + +bool ModuleBase_WidgetMultiSelector::isModified() const +{ + return myListView->getControl()->count() > 0; +} \ No newline at end of file diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h index f34e18ef5..08aa13a39 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h @@ -115,6 +115,9 @@ class MODULEBASE_EXPORT ModuleBase_WidgetMultiSelector : public ModuleBase_Widge /// The slot is called when user press Ok or OkPlus buttons in the parent property panel virtual void onFeatureAccepted(); + /// Returns True if data of its feature was modified during operation + virtual bool isModified() const; + public slots: /// Slot is called on selection type changed void onSelectionTypeChanged(); diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index c8d37d5d3..127c7621e 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -238,3 +238,9 @@ void ModuleBase_WidgetShapeSelector::updateSelectionName() } } } + +//******************************************************************** +bool ModuleBase_WidgetShapeSelector::isModified() const +{ + return !myTextLine->text().isEmpty(); +} \ No newline at end of file diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h index 61b51810d..916259660 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h @@ -94,6 +94,9 @@ Q_OBJECT /// \return a control list virtual QList getControls() const; + /// Returns True if data of its feature was modified during operation + virtual bool isModified() const; + protected: /// Saves the internal parameters to the given feature /// \return True in success diff --git a/src/PartSet/PartSet_MenuMgr.cpp b/src/PartSet/PartSet_MenuMgr.cpp index 06ebaefa6..e458403a2 100644 --- a/src/PartSet/PartSet_MenuMgr.cpp +++ b/src/PartSet/PartSet_MenuMgr.cpp @@ -35,7 +35,6 @@ #include #include -#include #include #include #include @@ -313,8 +312,8 @@ void PartSet_MenuMgr::onLineDetach(QAction* theAction) XGUI_Workshop* aWorkshop = aConnector->workshop(); ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation(); - ModuleBase_OperationAction* anOpAction = new ModuleBase_OperationAction( - tr("Detach %1").arg(aLine->data()->name().c_str()), myModule); + ModuleBase_Operation* anOpAction = + new ModuleBase_Operation(tr("Detach %1").arg(aLine->data()->name().c_str()), myModule); bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation); XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr(); // the active nested sketch operation should be aborted unconditionally @@ -373,11 +372,11 @@ void PartSet_MenuMgr::setAuxiliary(const bool isChecked) QAction* anAction = action("AUXILIARY_CMD"); //SessionPtr aMgr = ModelAPI_Session::get(); - ModuleBase_OperationAction* anOpAction = 0; + ModuleBase_Operation* anOpAction = 0; XGUI_ModuleConnector* aConnector = dynamic_cast(myModule->workshop()); XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr(); if (isUseTransaction) { - anOpAction = new ModuleBase_OperationAction(anAction->text(), myModule); + anOpAction = new ModuleBase_Operation(anAction->text(), myModule); bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation); bool isCommitted; diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index cc7c8b7f8..0def06c60 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -54,7 +54,6 @@ #include #include -#include #include #include #include @@ -968,7 +967,7 @@ bool PartSet_Module::deleteObjects() // 3. start operation QString aDescription = aWorkshop->contextMenuMgr()->action("DELETE_CMD")->text(); - ModuleBase_OperationAction* anOpAction = new ModuleBase_OperationAction(aDescription, this); + ModuleBase_Operation* anOpAction = new ModuleBase_Operation(aDescription, this); // the active nested sketch operation should be aborted unconditionally // the Delete action should be additionally granted for the Sketch operation diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 00cf24153..60db4013c 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -55,7 +55,7 @@ #include #include -#include +#include #include #include diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index f159dd4b5..b8857fecf 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -628,8 +628,8 @@ void XGUI_OperationMgr::onOperationStopped() } } if (aResultOp) { - bool isModified = aCurrentOperation->isModified(); - aResultOp->setIsModified(aResultOp->isModified() || isModified); + //bool isModified = aCurrentOperation->isModified(); + //aResultOp->setIsModified(aResultOp->isModified() || isModified); resumeOperation(aResultOp); onValidateOperation(); } diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 9b7166a14..b00a040be 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -103,7 +103,6 @@ #include #include #include -#include #include #include #include @@ -1924,7 +1923,7 @@ void XGUI_Workshop::deleteObjects() bool aDone = false; QString aDescription = contextMenuMgr()->action("DELETE_CMD")->text() + " %1"; aDescription = aDescription.arg(XGUI_Tools::unionOfObjectNames(anObjects, ", ")); - ModuleBase_OperationAction* anOpAction = new ModuleBase_OperationAction(aDescription, module()); + ModuleBase_Operation* anOpAction = new ModuleBase_Operation(aDescription, module()); operationMgr()->startOperation(anOpAction); @@ -2081,7 +2080,7 @@ void XGUI_Workshop::cleanHistory() // 1. start operation aDescription += "by deleting of " + aDescription.arg(XGUI_Tools::unionOfObjectNames(anObjects, ", ")); - ModuleBase_OperationAction* anOpAction = new ModuleBase_OperationAction(aDescription, module()); + ModuleBase_Operation* anOpAction = new ModuleBase_Operation(aDescription, module()); operationMgr()->startOperation(anOpAction); // WORKAROUND, should be done before each object remove, if it presents in XGUI_DataModel tree