From: vsv Date: Thu, 2 Jun 2005 10:01:09 +0000 (+0000) Subject: BUG 8828: Translate in Locked study X-Git-Tag: JFA_MERGE_TO_3_0_0__2005-07-07 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FV2_2_0_VISU_improvement;p=modules%2Fvisu.git BUG 8828: Translate in Locked study --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 8772c164..7bf12b85 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -2960,8 +2960,8 @@ bool VisuGUI::CustomPopup (QAD_Desktop* parent, QPopupMenu* thePopup, const QStr } else if ( selMode == homoPresentations ) { if (isVTKViewer) { - if ( !isStudyLocked( GetActiveStudy()->getStudyDocument() ) ) - thePopup->insertItem("Translate...", visuGUI, SLOT(TranslatePrs())); + // if ( !isStudyLocked( GetActiveStudy()->getStudyDocument() ) ) + thePopup->insertItem("Translate...", visuGUI, SLOT(TranslatePrs())); thePopup->insertItem( "Display", visuGUI, SLOT( DisplayManyPrs() ) ); thePopup->insertItem( "Erase", visuGUI, SLOT( EraseManyPrs () ) ); thePopup->insertSeparator(); @@ -3184,8 +3184,8 @@ bool VisuGUI::CustomPopup (QAD_Desktop* parent, QPopupMenu* thePopup, const QStr } if (isVTKViewer) { - if ( !isStudyLocked( GetActiveStudy()->getStudyDocument() ) ) - thePopup->insertItem("Translate...", visuGUI, SLOT(TranslatePrs())); + // if ( !isStudyLocked( GetActiveStudy()->getStudyDocument() ) ) + thePopup->insertItem("Translate...", visuGUI, SLOT(TranslatePrs())); thePopup->insertItem("Clipping planes", visuGUI, SLOT(ClippingPlanes())); if ( theParent == "Viewer" && diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.cxx b/src/VISUGUI/VisuGUI_OffsetDlg.cxx index 2ffaf7d0..4151e770 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.cxx +++ b/src/VISUGUI/VisuGUI_OffsetDlg.cxx @@ -63,7 +63,8 @@ VisuGUI_OffsetDlg::VisuGUI_OffsetDlg() mySaveChk = new QCheckBox("Save to presentation", this); TopLayout->addWidget(mySaveChk); mySaveChk->setChecked(true); - } + } else + mySaveChk = 0; // Common buttons =========================================================== QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); @@ -93,7 +94,7 @@ VisuGUI_OffsetDlg::VisuGUI_OffsetDlg() TopLayout->addWidget( GroupButtons ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( updateOffset() ) ); + connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onApply() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); @@ -141,7 +142,7 @@ void VisuGUI_OffsetDlg::onReset() bool VisuGUI_OffsetDlg::isToSave() const { - if (!VisuGUI::GetActiveStudy()->getStudyDocument()->GetProperties()->IsLocked()) + if (mySaveChk) return mySaveChk->isChecked(); else return false; @@ -191,3 +192,12 @@ void VisuGUI_OffsetDlg::reject() } QDialog::reject(); } + +void VisuGUI_OffsetDlg::onApply() +{ + float aOffset[3]; + getOffset(aOffset); + for (int i = 0; i < myPrsList.count(); i++) { + updateOffset(myPrsList.at(i), aOffset); + } +} diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.h b/src/VISUGUI/VisuGUI_OffsetDlg.h index 8ab70ca9..8772df25 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.h +++ b/src/VISUGUI/VisuGUI_OffsetDlg.h @@ -36,9 +36,10 @@ class VisuGUI_OffsetDlg: public QDialog protected slots: virtual void accept(); virtual void reject(); - void updateOffset(VISU::Prs3d_i* thePrs, float* theOffset); + void onApply(); private: + void updateOffset(VISU::Prs3d_i* thePrs, float* theOffset); // VISU::Prs3d_i* myPrs; QPtrList myPrsList; diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index b3845e82..dcd10a4c 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -1062,6 +1062,7 @@ void VisuGUI_TimeAnimationDlg::clearView() { //************************************************************************ void VisuGUI_TimeAnimationDlg::closeEvent(QCloseEvent* theEvent) { myAnimator->stopAnimation(); + myAnimator->wait(500); if (myAnimator->running() && (! myAnimator->finished())) { isClosing = true; myEvent = theEvent;