]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL11978:
authorenk <enk@opencascade.com>
Wed, 19 Apr 2006 11:49:29 +0000 (11:49 +0000)
committerenk <enk@opencascade.com>
Wed, 19 Apr 2006 11:49:29 +0000 (11:49 +0000)
Unexpected behavior of the Animation / Save pictures to directory functionality

src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISUGUI/VisuGUI_TimeAnimation.h
src/VISU_I/VISU_TimeAnimation.cxx

index 2feb8519e976e661efd9ef43d75944b5a5f543ca..895d10fb072841ebd5969877554c4e3d76eeab41 100644 (file)
@@ -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());
+}
index ec35e0d2abe14b3fd53008a890eaa4ee0db2d44b..a96a6f2e614bbee65d551ab40a2677249e9e785d 100644 (file)
@@ -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;
index 60e896e200a7c29470ee324e92e3c7370e46ef51..f2b8e1c815f24863c5115f19b51094373f9241a1 100644 (file)
@@ -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;