]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Provide more user-friendly behaviour if AVI recording is not available: warning on... V4_0a2 before_AutoTools
authorjfa <jfa@opencascade.com>
Thu, 22 Mar 2007 10:31:23 +0000 (10:31 +0000)
committerjfa <jfa@opencascade.com>
Thu, 22 Mar 2007 10:31:23 +0000 (10:31 +0000)
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISUGUI/VisuGUI_TimeAnimation.h
src/VVTK/VVTK_MainWindow.cxx

index de870423d5453fbbadedd316ee80aa2f972d136d..b59b4e4f5c7190cce73d0a36b6801a55e5a73cf1 100644 (file)
@@ -907,6 +907,9 @@ msgstr "Error"
 msgid "VisuGUI_TimeAnimationDlg::MSG_NO_ANIMATIONDATA"
 msgstr "There is no data for animation"
 
+msgid "VisuGUI_TimeAnimationDlg::MSG_NO_AVI_MAKER"
+msgstr "Tool jpeg2yuv, necessary for AVI recording, is not available.\nPlease, refer to the documentation."
+
 
 #: VisuGUI_VectorsDlg.cxx
 
@@ -1786,6 +1789,9 @@ msgstr "Stop recording"
 msgid "VVTK_MainWindow::DSC_VVTK_RECORDING_STOP"
 msgstr "Stop recording"
 
+msgid "VVTK_MainWindow::MSG_NO_AVI_MAKER"
+msgstr "Tool jpeg2yuv, necessary for AVI recording, is not available.\nPlease, refer to the documentation."
+
 msgid "VVTK_MainWindow1::LBL_TOOLBAR_GAUSS_LABEL"
 msgstr "Gauss Viewer Tools"
 
@@ -2144,4 +2150,4 @@ msgid "VISU_PLOT3D"
 msgstr "Plot3D"
 
 msgid "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE"
-msgstr "Scalar Map on Def. Shape"
\ No newline at end of file
+msgstr "Scalar Map on Def. Shape"
index 27f53ab99a8985193d35775488be94f3fb2bd01d..18a4ce073e19694f4b2da0fc686f481269d77532 100644 (file)
@@ -1245,29 +1245,29 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
           this, SLOT( onCheckDump(bool) ));
   aSaveLay->addMultiCellWidget(mySaveAVICheck, 3, 3, 0, 2);
 
-  QLabel* aPathAVILbl = new QLabel("Path:", aSaveBox);
-  aPathAVILbl->setEnabled(false);
-  connect(mySaveAVICheck, SIGNAL( toggled(bool)),
-          aPathAVILbl, SLOT( setEnabled(bool) ));
-  aSaveLay->addWidget(aPathAVILbl, 4, 0);
+  myPathAVILbl = new QLabel("Path:", aSaveBox);
+  myPathAVILbl->setEnabled(false);
+  //connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+  //        myPathAVILbl, SLOT( setEnabled(bool) ));
+  aSaveLay->addWidget(myPathAVILbl, 4, 0);
 
   myPathAVIEdit = new QLineEdit(aSaveBox);
   myPathAVIEdit->setReadOnly(true);
   myPathAVIEdit->setEnabled(false);
-  connect(mySaveAVICheck, SIGNAL( toggled(bool)),
-          myPathAVIEdit, SLOT( setEnabled(bool) ));
+  //connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+  //        myPathAVIEdit, SLOT( setEnabled(bool) ));
   aSaveLay->addWidget(myPathAVIEdit, 4, 1);
 
-  QPushButton* aBrowseAVIBtn = new QPushButton("Browse...", aSaveBox);
-  aBrowseAVIBtn->setEnabled(false);
-  connect(mySaveAVICheck, SIGNAL( toggled(bool)),
-         aBrowseAVIBtn, SLOT( setEnabled(bool) ));
-  connect(aBrowseAVIBtn, SIGNAL( clicked()),
+  myBrowseAVIBtn = new QPushButton("Browse...", aSaveBox);
+  myBrowseAVIBtn->setEnabled(false);
+  //connect(mySaveAVICheck, SIGNAL( toggled(bool)),
+  //        myBrowseAVIBtn, SLOT( setEnabled(bool) ));
+  connect(myBrowseAVIBtn, SIGNAL( clicked()),
          this, SLOT( onBrowseAVI() ));
-  aSaveLay->addWidget(aBrowseAVIBtn, 4, 2);
+  aSaveLay->addWidget(myBrowseAVIBtn, 4, 2);
 
   mySaveAVICheck->setChecked(false);
-  mySaveAVICheck->setEnabled(myAnimator->checkAVIMaker());
+  //mySaveAVICheck->setEnabled(myAnimator->checkAVIMaker());
 
   TopLayout->addMultiCellWidget(aSaveBox, 7, 7, 0, 3);
 
@@ -1560,12 +1560,33 @@ void VisuGUI_TimeAnimationDlg::onCheckDump(bool)
     } else {
       myAnimator->dumpTo("");
     }
-    mySaveAVICheck->setEnabled(!mySaveCheck->isChecked() && myAnimator->checkAVIMaker());
+    //mySaveAVICheck->setEnabled(!mySaveCheck->isChecked() && myAnimator->checkAVIMaker());
+    mySaveAVICheck->setEnabled(!mySaveCheck->isChecked());
   }
   else if (source == mySaveAVICheck) {
     if (mySaveAVICheck->isChecked()) {
-      if (mySaveCheck->isChecked())
-       mySaveCheck->setChecked(false);
+      if (!myAnimator->checkAVIMaker()) {
+        // AVI maker is not available
+        SUIT_MessageBox::warn1(this, tr("ERROR"), tr("MSG_NO_AVI_MAKER"), tr("&OK"));
+        mySaveAVICheck->setChecked(false);
+      }
+      else {
+        if (mySaveCheck->isChecked()) {
+          mySaveCheck->setChecked(false);
+        }
+        myPathAVILbl->setEnabled(true);
+        myPathAVIEdit->setEnabled(true);
+        myBrowseAVIBtn->setEnabled(true);
+      }
+    }
+    else {
+      // it is necessary in case of not available AVI maker,
+      // because otherwise they will stay enabled
+      // (??? slots, connected on SIGNAL(toggled(bool)) of mySaveAVICheck,
+      // works in wrong order ???)
+      myPathAVILbl->setEnabled(false);
+      myPathAVIEdit->setEnabled(false);
+      myBrowseAVIBtn->setEnabled(false);
     }
     mySaveCheck->setEnabled(!mySaveAVICheck->isChecked());
   }
index f717b3f68c7550edb66c9a037e8a3ea233328c9f..9b18330d3df55d7872ad4766bc671746a846463b 100644 (file)
@@ -205,8 +205,10 @@ class VisuGUI_TimeAnimationDlg: public QDialog
     bool myCloseBtnClicked;
     QCloseEvent* myEvent;
 
-    QCheckBox* mySaveAVICheck;
-    QLineEdit* myPathAVIEdit;
+    QCheckBox*   mySaveAVICheck;
+    QLineEdit*   myPathAVIEdit;
+    QLabel*      myPathAVILbl;
+    QPushButton* myBrowseAVIBtn;
 
     QPushButton* myPublishBtn;
     QPushButton* mySaveBtn;
index 63cf2bc078700bf64049d14eff02a292faf45db5..80a3345c36be3422da7ef61f0ac2abe594cd9cc4 100644 (file)
@@ -47,6 +47,7 @@
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_ToolButton.h"
 #include "SUIT_Accel.h"
+#include "SUIT_MessageBox.h"
 #include "QtxAction.h"
 
 #include <qimage.h>
@@ -115,9 +116,9 @@ VVTK_MainWindow
   connect( myStopAction, SIGNAL( activated() ), this, SLOT( OnStopRecording() ) );
   
   myRecorder = VVTK_Recorder::New();
-  myRecorder->CheckExistAVIMaker();
-  if(myRecorder->ErrorStatus())
-    myRecordingToolBar->setEnabled(false);
+  //myRecorder->CheckExistAVIMaker();
+  //if(myRecorder->ErrorStatus())
+  //  myRecordingToolBar->setEnabled(false);
 }
 
 //----------------------------------------------------------------------------
@@ -191,17 +192,23 @@ VVTK_MainWindow
 //----------------------------------------------------------------------------
 void VVTK_MainWindow::OnStartRecording()
 {
-  VVTK_RecorderDlg* aRecorderDlg = new VVTK_RecorderDlg( this, myRecorder );
+  myRecorder->CheckExistAVIMaker();
+  if (myRecorder->ErrorStatus()) {
+    SUIT_MessageBox::warn1(this, tr("ERROR"), tr("MSG_NO_AVI_MAKER"), tr("&OK"));
+  }
+  else {
+    VVTK_RecorderDlg* aRecorderDlg = new VVTK_RecorderDlg( this, myRecorder );
 
-  if( !aRecorderDlg->exec() )
-    return;
+    if( !aRecorderDlg->exec() )
+      return;
 
-  myStartAction->setEnabled( false );
-  myPlayAction->setEnabled( false );
-  myPauseAction->setEnabled( true );
-  myStopAction->setEnabled( true );
+    myStartAction->setEnabled( false );
+    myPlayAction->setEnabled( false );
+    myPauseAction->setEnabled( true );
+    myStopAction->setEnabled( true );
 
-  myRecorder->Record();
+    myRecorder->Record();
+  }
 }
 
 //----------------------------------------------------------------------------