From: enk Date: Wed, 19 Apr 2006 11:49:29 +0000 (+0000) Subject: Fix for Bug IPAL11978: X-Git-Tag: T3_2_0b1_pre1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=92442635d385923731f64ce531a896e535ac2f3b;p=modules%2Fvisu.git Fix for Bug IPAL11978: Unexpected behavior of the Animation / Save pictures to directory functionality --- diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 2feb8519..895d10fb 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -1116,6 +1116,8 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu aSaveLay->addWidget(myPicsFormat, 1, 2); connect(mySaveCheck, SIGNAL( toggled(bool)), myPicsFormat, SLOT( setEnabled(bool) )); + connect(myPicsFormat, SIGNAL( activated (int)), + this, SLOT( onPicsFormatChanged())); QLabel* aPathLbl = new QLabel("Path:", aSaveBox); aPathLbl->setEnabled(false); @@ -1273,9 +1275,9 @@ void VisuGUI_TimeAnimationDlg::onPlayPressed() if (myPlayBtn->isOn() && (!myAnimator->running())) { myPlayBtn->setIconSet(MYpausePixmap); if (mySaveCheck->isChecked()) { - QStrList aDumpFormats = QImageIO::outputFormats(); - myAnimator->setDumpFormat(aDumpFormats.at(myPicsFormat->currentItem())); - myAnimator->dumpTo(myPathEdit->text()); + onPicsFormatChanged(); + onPathChanged(); + } else if (mySaveAVICheck->isChecked()) { myAnimator->setDumpFormat("AVI"); myAnimator->dumpTo(myPathAVIEdit->text()); @@ -1412,6 +1414,7 @@ void VisuGUI_TimeAnimationDlg::onBrowse() QString aPath = SUIT_FileDlg::getExistingDirectory(this, aDir, "Select path"); if (!aPath.isEmpty()) myPathEdit->setText(Qtx::addSlash(aPath)); + onPathChanged(); } //------------------------------------------------------------------------ @@ -1439,8 +1442,12 @@ void VisuGUI_TimeAnimationDlg::onCheckDump(bool) const QObject* source = sender(); if (source == mySaveCheck) { if (mySaveCheck->isChecked()) { + onPicsFormatChanged(); + onPathChanged(); if (mySaveAVICheck->isChecked()) mySaveAVICheck->setChecked(false); + } else { + myAnimator->dumpTo(""); } mySaveAVICheck->setEnabled(!mySaveCheck->isChecked() && myAnimator->checkAVIMaker()); } @@ -1502,3 +1509,16 @@ void VisuGUI_TimeAnimationDlg::restoreFromStudy(_PTR(SObject) theAnimation) myAnimator->restoreFromStudy(theAnimation); mySaveBtn->setEnabled(myAnimator->isSavedInStudy()); } + +//------------------------------------------------------------------------ +void VisuGUI_TimeAnimationDlg::onPicsFormatChanged() +{ + QStrList aDumpFormats = QImageIO::outputFormats(); + myAnimator->setDumpFormat(aDumpFormats.at(myPicsFormat->currentItem())); +} + +//------------------------------------------------------------------------ +void VisuGUI_TimeAnimationDlg::onPathChanged() +{ + myAnimator->dumpTo(myPathEdit->text()); +} diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.h b/src/VISUGUI/VisuGUI_TimeAnimation.h index ec35e0d2..a96a6f2e 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.h +++ b/src/VISUGUI/VisuGUI_TimeAnimation.h @@ -163,6 +163,10 @@ class VisuGUI_TimeAnimationDlg: public QDialog void onHelp(); void saveToStudy(); void publishToStudy(); + /*!Sets dump format for myAnimator (setDumpFormat(...)), from myPicsFormat.*/ + void onPicsFormatChanged(); + /*!Sets path for myAnimator (dumpTo(...)), from myPathEdit.*/ + void onPathChanged(); private: QSlider* mySlider; diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index 60e896e2..f2b8e1c8 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -624,6 +624,7 @@ void VISU_TimeAnimation::run() } } int delay = (int)(1000. * k / mySpeed); + isDumping = !myDumpPath.isEmpty(); if (delay < 1 && isDumping) { // We must unlock mutex for some time before grabbing to allow view updating delay = 1;