From 867613b15a9b2e4d02a4aa21421788a2e73abe78 Mon Sep 17 00:00:00 2001 From: dmv Date: Tue, 28 Oct 2008 07:39:00 +0000 Subject: [PATCH] Modification, Transformation. IDs of elements are missing, if selection with rectange is used. --- src/SMESHGUI/SMESHGUI_RotationDlg.cxx | 3 +++ src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx | 5 +++- src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 3 +++ src/SMESHGUI/SMESHGUI_TranslationDlg.cxx | 30 +++++++++++++++++------- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index f564198de..b76cfa308 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -651,7 +651,10 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument() myBusy = true; if (myEditCurrentArgument == (QWidget*)LineEditElements) { + LineEditElements->setEnabled(true); LineEditElements->setText(aString); + LineEditElements->repaint(); + LineEditElements->setEnabled(false); setNewMeshName(); } myBusy = false; diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index 8090b5455..4f8711a04 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -583,7 +583,10 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument() return; myBusy = true; - myEditCurrentArgument->setText(aString); + LineEditElements->setEnabled(true); + LineEditElements->setText(aString); + LineEditElements->repaint(); + LineEditElements->setEnabled(false); myBusy = false; // OK diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 214cca5e0..932104d4d 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -741,7 +741,10 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument() myBusy = true; if (myEditCurrentArgument == (QWidget*)LineEditElements) { + LineEditElements->setEnabled(true); LineEditElements->setText(aString); + LineEditElements->repaint(); + LineEditElements->setEnabled(false); setNewMeshName(); } myBusy = false; diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 0b0a48889..a4859f5e4 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -80,6 +80,23 @@ enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action type +/*! + \class BusyLocker + \brief Simple 'busy state' flag locker. + \internal +*/ + +class BusyLocker +{ +public: + //! Constructor. Sets passed boolean flag to \c true. + BusyLocker( bool& busy ) : myBusy( busy ) { myBusy = true; } + //! Destructor. Clear external boolean flag passed as parameter to the constructor to \c false. + ~BusyLocker() { myBusy = false; } +private: + bool& myBusy; //! External 'busy state' boolean flag +}; + #define SPACING 6 #define MARGIN 11 @@ -527,7 +544,7 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText) QLineEdit* send = (QLineEdit*)sender(); if (myBusy) return; - myBusy = true; + BusyLocker lock( myBusy ); if (send == LineEditElements) myNbOkElements = 0; @@ -567,8 +584,6 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText) buttonOk->setEnabled(true); buttonApply->setEnabled(true); } - - myBusy = false; } //================================================================================= @@ -578,19 +593,17 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText) void SMESHGUI_TranslationDlg::SelectionIntoArgument() { if (myBusy) return; - + BusyLocker lock( myBusy ); // clear myActor = 0; QString aString = ""; - myBusy = true; if (myEditCurrentArgument == (QWidget*)LineEditElements) { LineEditElements->setText(aString); myNbOkElements = 0; buttonOk->setEnabled(false); buttonApply->setEnabled(false); } - myBusy = false; if (!GroupButtons->isEnabled()) // inactive return; @@ -707,12 +720,13 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument() } } - myBusy = true; if (myEditCurrentArgument == (QWidget*)LineEditElements) { + LineEditElements->setEnabled(true); LineEditElements->setText(aString); + LineEditElements->repaint(); + LineEditElements->setEnabled(false); setNewMeshName(); } - myBusy = false; // OK if (myNbOkElements) { -- 2.39.2