From: nds Date: Tue, 15 Dec 2015 06:36:42 +0000 (+0300) Subject: It removes commented not used code. X-Git-Tag: V_2.1.0~190 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f4f5e51326a1846df7684d7fbf5b8315b12a29de;p=modules%2Fshaper.git It removes commented not used code. --- diff --git a/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp b/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp index 0f5ebcfc1..851a74834 100644 --- a/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp @@ -59,7 +59,6 @@ const double PSEUDO_ZERO = 1.e-20; ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* theParent, int thePrecision) : QDoubleSpinBox(theParent), myCleared(false), - //myIsModified(false), myIsEmitKeyPressEvent(false) { // VSR 01/07/2010: Disable thousands separator for spin box @@ -78,8 +77,6 @@ ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* theParent, int thePr connect(lineEdit(), SIGNAL(textChanged( const QString& )), this, SLOT(onTextChanged( const QString& ))); - - //connect(this, SIGNAL(valueChanged(const QString&)), this, SLOT(onValueChanged(const QString&))); } /*! @@ -353,24 +350,8 @@ QValidator::State ModuleBase_DoubleSpinBox::validate(QString& str, int& pos) con void ModuleBase_DoubleSpinBox::onTextChanged(const QString& ) { myCleared = false; - //myIsModified = true; } -/*void ModuleBase_DoubleSpinBox::onValueChanged(const QString& theValue) -{ - myIsModified = true; -} - -bool ModuleBase_DoubleSpinBox::isModified() const -{ - return myIsModified; -} - -void ModuleBase_DoubleSpinBox::clearModified() -{ - myIsModified = false; -}*/ - bool ModuleBase_DoubleSpinBox::enableKeyPressEvent(const bool& theEnable) { bool aPreviousValue = myIsEmitKeyPressEvent; diff --git a/src/ModuleBase/ModuleBase_DoubleSpinBox.h b/src/ModuleBase/ModuleBase_DoubleSpinBox.h index d0b20e6ac..ec18e3500 100644 --- a/src/ModuleBase/ModuleBase_DoubleSpinBox.h +++ b/src/ModuleBase/ModuleBase_DoubleSpinBox.h @@ -49,12 +49,6 @@ Q_OBJECT /// Validate current value virtual QValidator::State validate(QString&, int&) const; - /// Returns true if the current value is modified by has not been applyed yet - //virtual bool isModified() const; - - /// Clears modified state - //void clearModified(); - /// Change enable/disable internal state to emit key press event /// \param theEnable if true, the signal is emitted /// \return the previous value @@ -69,8 +63,6 @@ signals: protected slots: /// Called on text changed virtual void onTextChanged(const QString&); - /// Called on value changed - //void onValueChanged(const QString& theValue); protected: /// Removes extra trailing zero symbols @@ -90,8 +82,6 @@ signals: /// Precision value int myPrecision; - /// Boolean value whether the spin box content is modified - //bool myIsModified; }; #endif diff --git a/src/ModuleBase/ModuleBase_IErrorMgr.h b/src/ModuleBase/ModuleBase_IErrorMgr.h index 701a49f80..9f595fdbb 100644 --- a/src/ModuleBase/ModuleBase_IErrorMgr.h +++ b/src/ModuleBase/ModuleBase_IErrorMgr.h @@ -34,10 +34,6 @@ public: /// \return Currently installed property panel ModuleBase_IPropertyPanel* propertyPanel() const { return myPropertyPanel; } -public slots: - /// SLOT, that is called after the operation is validated and feature validation errors have changed. - //virtual void onValidationStateChanged() = 0; - protected slots: /// Process values changed event for processing feature attribute validation errors. virtual void onWidgetChanged() = 0; diff --git a/src/ModuleBase/ModuleBase_IntSpinBox.cpp b/src/ModuleBase/ModuleBase_IntSpinBox.cpp index 197bfc22e..b35755ea9 100755 --- a/src/ModuleBase/ModuleBase_IntSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_IntSpinBox.cpp @@ -8,27 +8,10 @@ #include ModuleBase_IntSpinBox::ModuleBase_IntSpinBox(QWidget* theParent) -: QSpinBox(theParent)//, - //myIsModified(false) +: QSpinBox(theParent) { - //connect(this, SIGNAL(valueChanged(const QString&)), this, SLOT(onValueChanged(const QString&))); } -/*void ModuleBase_IntSpinBox::onValueChanged(const QString& theValue) -{ - myIsModified = true; -} - -bool ModuleBase_IntSpinBox::isModified() const -{ - return myIsModified; -} - -void ModuleBase_IntSpinBox::clearModified() -{ - myIsModified = false; -}*/ - void ModuleBase_IntSpinBox::keyPressEvent(QKeyEvent *theEvent) { switch (theEvent->key()) { diff --git a/src/ModuleBase/ModuleBase_IntSpinBox.h b/src/ModuleBase/ModuleBase_IntSpinBox.h index 565e43714..551e5f0b8 100755 --- a/src/ModuleBase/ModuleBase_IntSpinBox.h +++ b/src/ModuleBase/ModuleBase_IntSpinBox.h @@ -26,23 +26,9 @@ public: explicit ModuleBase_IntSpinBox(QWidget* theParent = 0); virtual ~ModuleBase_IntSpinBox() {}; - /// Returns true if the current value is modified by has not been applyed yet - //virtual bool isModified() const; - - /// Clears modified state - //void clearModified(); - -protected slots: - /// Called on value changed - //void onValueChanged(const QString& theValue); - protected: /// Called on key press event virtual void keyPressEvent(QKeyEvent* theEvent); - -private: - /// Boolean value whether the spin box content is modified - //bool myIsModified; }; #endif diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 06cfe0c04..bd42f7844 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -159,10 +159,8 @@ QList ModuleBase_WidgetDoubleValue::getControls() const bool ModuleBase_WidgetDoubleValue::processEnter() { bool isModified = getValueState() == ModifiedInPP; - //bool isModified = mySpinBox->isModified(); if (isModified) { emit valuesChanged(); - //mySpinBox->clearModified(); mySpinBox->selectAll(); } return isModified; diff --git a/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp b/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp index 431a387f8..c0e683f89 100644 --- a/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp +++ b/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp @@ -36,7 +36,7 @@ #include ExpressionEditor::ExpressionEditor(QWidget* theParent) -: QPlainTextEdit(theParent), myCompletedAndSelected(false), myIsModified(false) +: QPlainTextEdit(theParent), myCompletedAndSelected(false) { myCompleter = new QCompleter(this); myCompleter->setWidget(this); @@ -114,8 +114,6 @@ void ExpressionEditor::performCompletion(const QString& theCompletionPrefix) void ExpressionEditor::keyPressEvent(QKeyEvent* theEvent) { - bool anIsModified = myIsModified; - if (myCompletedAndSelected && handledCompletedAndSelected(theEvent)) return; myCompletedAndSelected = false; @@ -173,16 +171,6 @@ QString ExpressionEditor::placeHolderText() const return myPlaceHolderText; } -bool ExpressionEditor::isModified() const -{ - return myIsModified; -} - -void ExpressionEditor::clearModified() -{ - myIsModified = false; -} - void ExpressionEditor::paintEvent( QPaintEvent* theEvent ) { QPlainTextEdit::paintEvent( theEvent ); @@ -214,7 +202,6 @@ void ExpressionEditor::paintEvent( QPaintEvent* theEvent ) void ExpressionEditor::onTextChanged() { - myIsModified = true; emit valueModified(); } @@ -314,11 +301,9 @@ QList ModuleBase_WidgetExprEditor::getControls() const bool ModuleBase_WidgetExprEditor::processEnter() { - //bool isModified = myEditor->isModified(); bool isModified = getValueState() == ModifiedInPP; if (isModified) { emit valuesChanged(); - //myEditor->clearModified(); myEditor->selectAll(); } return isModified; diff --git a/src/ModuleBase/ModuleBase_WidgetExprEditor.h b/src/ModuleBase/ModuleBase_WidgetExprEditor.h index e05a1ecf4..b7af4cfb5 100644 --- a/src/ModuleBase/ModuleBase_WidgetExprEditor.h +++ b/src/ModuleBase/ModuleBase_WidgetExprEditor.h @@ -45,12 +45,6 @@ class ExpressionEditor: public QPlainTextEdit /// Returns placeholder list QString placeHolderText() const; - /// Returns true if the current value is modified by has not been applyed yet - bool isModified() const; - - /// Clears modified state - void clearModified(); - public slots: /// Insert additional string for completion /// \param theCompletion a string to insert @@ -92,9 +86,6 @@ private: QCompleter* myCompleter; bool myCompletedAndSelected; QString myPlaceHolderText; - - /// Boolean value whether the spin box content is modified - bool myIsModified; }; /** diff --git a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp index 4cae38f12..308aef0ff 100644 --- a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp @@ -143,10 +143,8 @@ QList ModuleBase_WidgetIntValue::getControls() const bool ModuleBase_WidgetIntValue::processEnter() { bool isModified = getValueState() == ModifiedInPP; - //bool isModified = mySpinBox->isModified(); if (isModified) { emit valuesChanged(); - //mySpinBox->clearModified(); mySpinBox->selectAll(); } return isModified; diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index cd2de7748..ccc53c217 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -515,14 +515,10 @@ void PartSet_WidgetPoint2D::initializeValueByActivate() bool PartSet_WidgetPoint2D::processEnter() { - //bool isModified = myXSpin->isModified() || myYSpin->isModified(); bool isModified = getValueState() == ModifiedInPP; if (isModified) { - bool isXModified = myXSpin->hasFocus();//myXSpin->isModified(); + bool isXModified = myXSpin->hasFocus(); emit valuesChanged(); - //onValuesChanged(); - //myXSpin->clearModified(); - //myYSpin->clearModified(); if (isXModified) myXSpin->selectAll(); else diff --git a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp index 829380cef..71d002025 100644 --- a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp +++ b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp @@ -120,11 +120,9 @@ void PartSet_WidgetPoint2dDistance::onMouseMove(ModuleBase_IViewWindow* theWnd, bool PartSet_WidgetPoint2dDistance::processEnter() { - //bool isModified = mySpinBox->isModified(); bool isModified = getValueState() == ModifiedInPP; if (isModified) { emit valuesChanged(); - //mySpinBox->clearModified(); mySpinBox->selectAll(); } return isModified; diff --git a/src/XGUI/XGUI_ErrorMgr.h b/src/XGUI/XGUI_ErrorMgr.h index 7295a52a4..7970f6ec0 100644 --- a/src/XGUI/XGUI_ErrorMgr.h +++ b/src/XGUI/XGUI_ErrorMgr.h @@ -44,10 +44,6 @@ public: /// \param theFeature a feature void updateAcceptAllAction(const FeaturePtr& theFeature); -public slots: - /// Reimplemented from ModuleBase_ErrorMgr::onValidationStateChanged(). - //virtual void onValidationStateChanged(); - protected slots: /// Reimplemented from ModuleBase_ErrorMgr::onWidgetChanged(). virtual void onWidgetChanged(); diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 9015698d5..5271d1836 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -221,7 +221,6 @@ void XGUI_OperationMgr::setApplyEnabled(const bool theEnabled) if (aFOperation) { workshop()->errorMgr()->updateActions(aFOperation->feature()); } - //emit validationStateChanged(theEnabled); } void XGUI_OperationMgr::updateApplyOfOperations(ModuleBase_Operation* theOperation) @@ -553,20 +552,6 @@ bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent) case Qt::Key_Return: case Qt::Key_Enter: { isAccepted = onProcessEnter(); - /*ModuleBase_Operation* aOperation = currentOperation(); - ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel(); - ModuleBase_ModelWidget* aActiveWgt = aPanel->activeWidget(); - if (!aActiveWgt || !aActiveWgt->processEnter()) { - if (!myWorkshop->module()->processEnter(aActiveWgt ? aActiveWgt->attributeID() : "")) { - ModuleBase_OperationFeature* aFOperation = dynamic_cast(currentOperation()); - if (!aFOperation || myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty()) { - emit keyEnterReleased(); - commitOperation(); - } - else - isAccepted = false; - } - }*/ } break; case Qt::Key_N: diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 145ddd367..5f7303a78 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -163,8 +163,6 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) SLOT(onOperationCommitted(ModuleBase_Operation*))); connect(myOperationMgr, SIGNAL(operationAborted(ModuleBase_Operation*)), SLOT(onOperationAborted(ModuleBase_Operation*))); - //connect(myOperationMgr, SIGNAL(validationStateChanged(bool)), - // myErrorMgr, SLOT(onValidationStateChanged())); #ifndef HAVE_SALOME connect(myMainWindow, SIGNAL(exitKeySequence()), SLOT(onExit())); @@ -396,21 +394,6 @@ void XGUI_Workshop::onAcceptActionClicked() } } -//****************************************************** -/*void XGUI_Workshop::onValidationStateChanged(bool theEnabled) -{ - XGUI_OperationMgr* anOperationMgr = operationMgr(); - if (anOperationMgr) { - ModuleBase_OperationFeature* aFOperation = dynamic_cast - (anOperationMgr->currentOperation()); - if (aFOperation) { - QAction* anAction = myActionsMgr->operationStateAction(XGUI_ActionsMgr::Accept); - myErrorMgr->updateActionState(anAction, aFOperation->feature(), theEnabled); - } - } -}*/ - - //****************************************************** void XGUI_Workshop::deactivateActiveObject(const ObjectPtr& theObject, const bool theUpdateViewer) { @@ -1062,8 +1045,6 @@ void XGUI_Workshop::createDockWidgets() connect(myPropertyPanel, SIGNAL(enterClicked()), myOperationMgr, SLOT(onProcessEnter())); - //connect(myOperationMgr, SIGNAL(validationStateChanged(bool)), - // this, SLOT(onValidationStateChanged(bool))); } //****************************************************** diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index 1d1fa3fee..c032b9324 100755 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -399,15 +399,6 @@ private: /// the operation can be committed and do it if it returns true. void onAcceptActionClicked(); - /// Listens the corresponded signal from operation manager and send it with the Ok - /// action to operation manager. - /// \param theEnabled an enabled state for the action - //void onValidationStateChanged(bool theEnabled); - - //connect(myOperationMgr, SIGNAL(validationStateChanged(bool)), - // aOkAct, SLOT(setEnabled(bool))); - - private: /// Init menu void initMenu();