Index: /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtMovieDialog.hh
===================================================================
--- /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtMovieDialog.hh	(revision 750)
+++ /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtMovieDialog.hh	(revision 751)
@@ -90,4 +90,5 @@
   void encode();
   void resetRecording();
+  void enabledApplyButton();
 };
 
Index: /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh
===================================================================
--- /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh	(revision 750)
+++ /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh	(revision 751)
@@ -117,5 +117,5 @@
 private:
   enum mouseActions {STYLE1,STYLE2,STYLE3,STYLE4}; 
-  enum RECORDING_STEP {WAIT,START,PAUSE,CONTINUE,STOP,READY_TO_ENCODE,ENCODE,FAILED,SUCCESS}; 
+  enum RECORDING_STEP {WAIT,START,PAUSE,CONTINUE,STOP,READY_TO_ENCODE,ENCODING,FAILED,SUCCESS}; 
 
   void createPopupMenu();
Index: /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtMovieDialog.cc
===================================================================
--- /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtMovieDialog.cc	(revision 750)
+++ /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtMovieDialog.cc	(revision 751)
@@ -244,5 +244,5 @@
   fButtonApply = new QPushButton( tr( "&Apply" ),buttonBox );
   fButtonApply->setAutoDefault( TRUE );
-  fButtonApply->setEnabled(true);
+  enabledApplyButton();
   buttonBoxLayout->addWidget(fButtonApply);
 
@@ -275,7 +275,11 @@
 
   // connect line edit signals
-  connect (fEncoderPath,SIGNAL(textEdited ( const QString&)),fButtonApply,SLOT(setEnabled(true)));
-  connect (fTempFolderPath,SIGNAL(textEdited ( const QString&)),fButtonApply,SLOT(setEnabled(true)));
-  connect (fSaveFileName,SIGNAL(textEdited ( const QString&)),fButtonApply,SLOT(setEnabled(true)));
+  connect (fEncoderPath,SIGNAL(textEdited ( const QString&)),this,SLOT(enabledApplyButton()));
+  connect (fTempFolderPath,SIGNAL(textEdited ( const QString&)),this,SLOT(enabledApplyButton()));
+  connect (fSaveFileName,SIGNAL(textEdited ( const QString&)),this,SLOT(enabledApplyButton()));
+
+  connect (fEncoderPath,SIGNAL(editingFinished ()),this,SLOT(checkAllParameters()));
+  connect (fTempFolderPath,SIGNAL(editingFinished ()),this,SLOT(checkAllParameters()));
+  connect (fSaveFileName,SIGNAL(editingFinished ()),this,SLOT(checkAllParameters()));
 
   if (fParentViewer->getEncoderPath() == "") {
@@ -442,3 +446,8 @@
 }
 
-#endif
+
+void G4OpenGLQtMovieDialog::enabledApplyButton() {
+  fButtonApply->setEnabled(true);
+}
+
+#endif
Index: /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
===================================================================
--- /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc	(revision 750)
+++ /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc	(revision 751)
@@ -2189,8 +2189,10 @@
   } else if (step == READY_TO_ENCODE) {
     txt  = "Ready to Encode...";
-  } else if (step == ENCODE) {
+  } else if (step == ENCODING) {
     txt  = "Encoding...";
   } else if (step == FAILED) {
     txt  = "Failed to encode...";
+  } else if (step == SUCCESS) {
+    txt  = "File encoded successfully";
   } else {
   }
@@ -2420,5 +2422,5 @@
   }
 
-  d->setFilter(QDir::Readable | QDir::Writable );
+  d->setFilter( QDir::Files );
   QStringList subDirList = d->entryList();
   int res = true;
@@ -2426,9 +2428,10 @@
   for (QStringList::ConstIterator it = subDirList.begin() ;(it != subDirList.end()) ; it++) {
     const QString currentFile = *it;
-    if (!d->remove(currentFile)) {
-      res = false;
-      QString file = fMovieTempFolderPath+currentFile;
-      error +="Removing file failed : "+file;
-    }
+      if (!d->remove(currentFile)) {
+        res = false;
+        QString file = fMovieTempFolderPath+currentFile;
+        error +="Removing file failed : "+file;
+      } else {
+      }
   }
   if (res) {
@@ -2578,5 +2581,5 @@
   fprintf (fp,"#\n");
   fprintf (fp,"#\n");
-  fprintf (fp,"Test*.ppm	[0-%d]\n",fRecordFrameNumber);
+  fprintf (fp,"Test*.ppm	[0-%d]\n",fRecordFrameNumber-1);
   fprintf (fp,"# can have more files here if you want...there is no limit on the number\n");
   fprintf (fp,"# of files\n");
@@ -2653,9 +2656,12 @@
 #endif
   if ((getEncoderPath() != "") && (getSaveFileName() != "")) {
+    setRecordingStatus(ENCODING);
     fProcess = new QProcess();
-    fProcess->execute (fEncoderPath, QStringList(fMovieTempFolderPath+fParameterFileName));
+    fProcess->start (fEncoderPath, QStringList(fMovieTempFolderPath+fParameterFileName));
 #if QT_VERSION > 0x040100
 	QObject ::connect(fProcess,SIGNAL(finished ( int,QProcess::ExitStatus)),
-                      this,SLOT(processFinished( int));
+                      this,SLOT(processFinished( int)));
+	QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),
+                      this,SLOT(processStdout()));
 #else
 #if QT_VERSION > 0x040000
@@ -2680,21 +2686,12 @@
 void G4OpenGLQtViewer::processStdout()
 {
-#ifdef GEANT4_QT_DEBUG
-  printf("processStdout \n");
-#endif
-#ifdef GEANT4_QT_DEBUG
-#if QT_VERSION > 0x040100
-#else
 #if QT_VERSION > 0x040000
-  printf("processStdout %s\n",fProcess->readAllStandardOutput ().data());
-#else
-  printf("processStdout %s\n",fProcess->readStdout ().data());
-
-#endif
-#endif
-#endif
-#ifdef GEANT4_QT_DEBUG
-  printf("processStdout END\n");
-#endif
+  QString tmp = fProcess->readAllStandardOutput ().data();
+#else
+  QString tmp = fProcess->readStdout ().data();
+#endif
+  int start = tmp.lastIndexOf("ESTIMATED TIME");
+  tmp = tmp.mid(start,tmp.indexOf("\n",start)-start);
+  setRecordingInfos(tmp);
 }
 
@@ -2707,31 +2704,30 @@
 
   QString txt = "";
-  if (exitCode) {
+  if (!exitCode) {
     setRecordingStatus(SUCCESS);
   } else {
-    QString txt;
 	switch (fProcess->error()) {
 	  case QProcess::FailedToStart:
-        txt = "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.";
+        txt = "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.\n";
 		break;
 	  case QProcess::Crashed:
-        txt = "The process crashed some time after starting successfully.";
+        txt = "The process crashed some time after starting successfully.\n";
 		break;
 	  case QProcess::Timedout:
-        txt = "The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again.";
+        txt = "The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again.\n";
 		break;
 	  case QProcess::WriteError:
-        txt = "An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.";
+        txt = "An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.\n";
 	    break;
 	  case QProcess::ReadError:
-        txt = "An error occurred when attempting to read from the process. For example, the process may not be running.";
+        txt = "An error occurred when attempting to read from the process. For example, the process may not be running.\n";
 	    break;
 	  case QProcess::UnknownError:
-        txt = "An unknown error occurred. This is the default return value of error().";
+        txt = "An unknown error occurred. This is the default return value of error().\n";
 		break;
     }
     setRecordingStatus(FAILED);
   }
-  setRecordingInfos(txt+"\n"+removeTempFolder());
+  setRecordingInfos(txt+removeTempFolder());
 #ifdef GEANT4_QT_DEBUG
   printf("processFinished END\n");
