Index: /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtMovieDialog.hh
===================================================================
--- /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtMovieDialog.hh	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtMovieDialog.hh	(revision 754)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4OpenGLQtMovieDialog.hh,v 1.5 2008/01/30 10:54:13 lgarnier Exp $
+// $Id: G4OpenGLQtMovieDialog.hh,v 1.1 2008/03/10 16:57:04 lgarnier Exp $
 // GEANT4 tag $Name: 
 //
Index: /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh
===================================================================
--- /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh	(revision 754)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4OpenGLQtViewer.hh,v 1.7 2008/01/30 10:54:13 lgarnier Exp $
+// $Id: G4OpenGLQtViewer.hh,v 1.9 2008/03/11 16:05:56 lgarnier Exp $
 // GEANT4 tag $Name:  $
 //
@@ -134,4 +134,5 @@
   void setRecordingStatus(RECORDING_STEP);
   void setRecordingInfos(QString);
+  QString getProcessErrorMsg();
 
 
@@ -205,6 +206,7 @@
   void toggleAux(bool);
   void toggleFullScreen(bool);
-  void processFinished(int);
-  void processStdout();
+  void processEncodeFinished();
+  void processLookForFinished();
+  void processEncodeStdout();
   // Only use for Qt>4.0
   //  void dialogClosed();
Index: /trunk/geant4/visualization/OpenGL/include/G4OpenGLViewer.hh
===================================================================
--- /trunk/geant4/visualization/OpenGL/include/G4OpenGLViewer.hh	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/include/G4OpenGLViewer.hh	(revision 754)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4OpenGLViewer.hh,v 1.21 2007/11/10 14:50:01 allison Exp $
+// $Id: G4OpenGLViewer.hh,v 1.22 2008/03/10 16:57:04 lgarnier Exp $
 // GEANT4 tag $Name:  $
 //
Index: /trunk/geant4/visualization/OpenGL/src/G4OpenGLImmediateSceneHandler.cc
===================================================================
--- /trunk/geant4/visualization/OpenGL/src/G4OpenGLImmediateSceneHandler.cc	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/src/G4OpenGLImmediateSceneHandler.cc	(revision 754)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4OpenGLImmediateSceneHandler.cc,v 1.28 2008/01/04 22:07:01 allison Exp $
+// $Id: G4OpenGLImmediateSceneHandler.cc,v 1.29 2008/02/18 08:53:49 asaim Exp $
 // GEANT4 tag $Name:  $
 //
@@ -171,5 +171,6 @@
   glPushMatrix();
   glLoadIdentity();
-  glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX);
+//////  glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX);
+  glOrtho (-1., 1., -1., 1., -1., 1.);
   glMatrixMode (GL_MODELVIEW);
   glPushMatrix();
Index: /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc
===================================================================
--- /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtExportDialog.cc	(revision 754)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4OpenGLQtExportDialog.cc,v 1.6 2008/01/30 10:54:13 lgarnier Exp $
+// $Id: G4OpenGLQtExportDialog.cc,v 1.7 2008/03/10 16:57:04 lgarnier Exp $
 // GEANT4 tag $Name:  $
 //
Index: /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtMovieDialog.cc
===================================================================
--- /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtMovieDialog.cc	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtMovieDialog.cc	(revision 754)
@@ -25,10 +25,10 @@
 //
 //
-// $Id: G4OpenGLQtMovieDialog.cc,v 1.6 2008/02/15 10:54:13 lgarnier Exp $
+// $Id: G4OpenGLQtMovieDialog.cc,v 1.3 2008/03/11 16:05:56 lgarnier Exp $
 // GEANT4 tag $Name:  $
 //
 // 
 
-#define GEANT4_QT_DEBUG
+//#define GEANT4_QT_DEBUG
 #ifdef G4VIS_BUILD_OPENGLQT_DRIVER
 
@@ -70,5 +70,7 @@
     fParentViewer(parentViewer)
 {
+#if QT_VERSION > 0x030200
   setModal(false);
+#endif
 #if QT_VERSION < 0x040000
   setCaption( tr( " Movie parameters" ));
@@ -96,5 +98,11 @@
 
   fEncoderStatus = new QLabel(encoderGroupBox);
+
+#if QT_VERSION > 0x040000
   fEncoderStatus->setWordWrap(true);
+#else
+  fEncoderStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
+#endif
+
   fEncoderStatus->setText("");
 
@@ -133,5 +141,9 @@
 
   fTempFolderStatus = new QLabel(tempFolderGroupBox);
+#if QT_VERSION > 0x040000
   fTempFolderStatus->setWordWrap(true);
+#else
+  fTempFolderStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
+#endif
   fTempFolderStatus->setText("");
 
@@ -172,5 +184,9 @@
 
   fSaveFileStatus = new QLabel(saveFileGroupBox);
+#if QT_VERSION > 0x040000
   fSaveFileStatus->setWordWrap(true);
+#else
+  fSaveFileStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
+#endif
   fSaveFileStatus->setText("");
 
@@ -198,5 +214,5 @@
   // label
 
-  QLabel *infoLabel = new QLabel("  Press SPACE to Start/Pause video recording \n  Press RETURN to Stop video recording");
+  QLabel *infoLabel = new QLabel("  Press SPACE to Start/Pause video recording \n  Press RETURN to Stop video recording",this);
 
   // global status
@@ -205,11 +221,23 @@
 
   fRecordingStatus = new QLabel(statusGroupBox);
+#if QT_VERSION > 0x040000
   fRecordingStatus->setWordWrap(true);
+#else
+  fRecordingStatus->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
+#endif
   QPalette palette( fRecordingStatus->palette() );
+#if QT_VERSION > 0x040000
   palette.setColor( QPalette::Text, Qt::green);
+#else
+  palette.setColor( QColorGroup::Text, Qt::green);
+#endif
   fRecordingStatus->setPalette(palette);
 
   fRecordingInfos = new QLabel(statusGroupBox);
+#if QT_VERSION > 0x040000
   fRecordingInfos->setWordWrap(true);
+#else
+  fRecordingInfos->setAlignment ( Qt::AlignAuto |Qt::WordBreak );
+#endif
   setRecordingInfos("");
 
@@ -298,7 +326,17 @@
 void G4OpenGLQtMovieDialog::selectEncoderPathAction()
 {
+#if QT_VERSION < 0x040000
+  QString nomFich =  QFileDialog::getOpenFileName ( ".",
+                                                    NULL,
+                                                    this,
+                                                    "Select your encoder",
+                                                    tr("Select your encoder ..."));
+#else
   QString nomFich =  QFileDialog::getOpenFileName ( this,
                                                     "Select your encoder",
                                                     tr("Select your encoder ...")); 
+
+#endif
+
   if (nomFich == "") {
     return;
@@ -311,7 +349,16 @@
 void G4OpenGLQtMovieDialog::selectTempPathAction()
 {
+#if QT_VERSION < 0x040000
+  QString nomFich =  QFileDialog::getOpenFileName ( ".",
+                                                    NULL,
+                                                    this,
+                                                    "Select temporary folder",
+                                                    tr("Select temporary folder ..."));
+#else
   QString nomFich =  QFileDialog::getOpenFileName ( this,
                                                     "Select temporary folder",
                                                     tr("Select temporary folder ...")); 
+
+#endif
   if (nomFich == "") {
     return;
@@ -324,7 +371,16 @@
 void G4OpenGLQtMovieDialog::selectSaveFileNameAction()
 {
+#if QT_VERSION < 0x040000
+  QString nomFich =  QFileDialog::getSaveFileName ( ".",
+                                                    NULL,
+                                                    this,
+                                                    "Select saved file",
+                                                    tr("Select saved file ..."));
+#else
   QString nomFich =  QFileDialog::getSaveFileName ( this,
                                                     "Select saved file",
                                                     tr("Select saved file ...")); 
+
+#endif
   if (nomFich == "") {
     return;
@@ -372,5 +428,9 @@
   fEncoderStatus->setText(temp);
   if (temp != "") {
+#if QT_VERSION > 0x040000
     palette.setColor( QPalette::Base, Qt::red);
+#else
+    palette.setColor( QColorGroup::Base, Qt::red);
+#endif
     if (fParentViewer->isReadyToEncode()) {
       setRecordingInfos("No valid encode defined, screen capture had been saved in the temp folder in ppm format.\nPlease define a encoder and clic on Apply button");
@@ -378,5 +438,9 @@
     status = false;
   } else {
+#if QT_VERSION > 0x040000
     palette.setColor( QPalette::Base, Qt::white);
+#else
+    palette.setColor( QColorGroup::Base, Qt::white);
+#endif
     fEncoderPath->setText(fParentViewer->getEncoderPath());
   }
@@ -398,8 +462,16 @@
   fTempFolderStatus->setText(temp);
   if (temp != "") {
+#if QT_VERSION > 0x040000
     palette.setColor( QPalette::Base, Qt::red);
+#else
+    palette.setColor( QColorGroup::Base, Qt::red);
+#endif
     status = false;
   } else {
+#if QT_VERSION > 0x040000
     palette.setColor( QPalette::Base, Qt::white);
+#else
+    palette.setColor( QColorGroup::Base, Qt::white);
+#endif
     fTempFolderPath->setText(fParentViewer->getTempFolderPath());
   }
@@ -421,8 +493,16 @@
   fSaveFileStatus->setText(temp);
   if (temp != "") { 
+#if QT_VERSION > 0x040000
     palette.setColor( QPalette::Base, Qt::red);
+#else
+    palette.setColor( QColorGroup::Base, Qt::red);
+#endif
     status = false;
   } else {
+#if QT_VERSION > 0x040000
     palette.setColor( QPalette::Base, Qt::white);
+#else
+    palette.setColor( QColorGroup::Base, Qt::white);
+#endif
     fSaveFileName->setText(fParentViewer->getSaveFileName());
   }
Index: /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
===================================================================
--- /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc	(revision 754)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4OpenGLQtViewer.cc,v 1.10 2008/01/30 10:54:13 lgarnier Exp $
+// $Id: G4OpenGLQtViewer.cc,v 1.15 2008/03/11 16:31:09 lgarnier Exp $
 // GEANT4 tag $Name:  $
 //
@@ -36,5 +36,5 @@
 #ifdef G4VIS_BUILD_OPENGLQT_DRIVER
 
-#define GEANT4_QT_DEBUG
+//#define GEANT4_QT_DEBUG
 
 #include "G4OpenGLQtViewer.hh"
@@ -308,5 +308,5 @@
   ,fMovieParametersDialog(NULL)
   ,fRecordingStep(WAIT)
-
+  ,fProcess(NULL)
 {
 
@@ -324,5 +324,10 @@
 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
 {
+#if QT_VERSION < 0x040000
+  G4cout <<removeTempFolder().ascii() <<G4endl;
+#else
   G4cout <<removeTempFolder().toStdString().c_str() <<G4endl;
+#endif
+
 #ifdef GEANT4_QT_DEBUG
   printf("G4OpenGLQtViewer::~G4OpenGLQtViewer \n");
@@ -2237,20 +2242,19 @@
   
    //look for encoderPath
-     QProcess search;
-     search.setReadChannelMode(QProcess::MergedChannels);
-     search.start ("which mpeg_encode");
-  
-     if (search.waitForFinished()) {
-       fEncoderPath = QString(QString::fromLocal8Bit(search.readAll())).trimmed();
-       // if not found, return "not found"
-       if (fEncoderPath.contains(" ")) {
-         fEncoderPath = "";
-       } else if (!fEncoderPath.contains("mpeg_encode")) {
-         fEncoderPath = "";
-       }
-     }
-     setEncoderPath(fEncoderPath);
-// init temp folder
-  setTempFolderPath(QDir::temp ().absolutePath ());
+     fProcess = new QProcess();
+     
+#if QT_VERSION < 0x040000
+     QObject ::connect(fProcess,SIGNAL(LaunchFinished ()),
+		       this,SLOT(processLookForFinished()));
+     fProcess->setCommunication(QProcess::DupStderr);
+     fProcess->setArguments(QStringList("which mpeg_encode"));
+     fProcess->start();
+#else
+     QObject ::connect(fProcess,SIGNAL(finished ( int)),
+		       this,SLOT(processLookForFinished()));
+     fProcess->setReadChannelMode(QProcess::MergedChannels);
+     fProcess->start ("which mpeg_encode");
+#endif
+  
 }
 
@@ -2270,20 +2274,19 @@
     return "File does not exist";
   }
-  // check if it is not a dir
-  QDir dir(path);
-  dir.setFilter( QDir::Dirs);
-  QStringList subDirList = dir.entryList();
-
-  if (!subDirList.isEmpty()) {
-    return "This is a directory";
-  }
-
+
+#if QT_VERSION < 0x040000
+  path =  QDir::cleanDirPath(path);
+#else
   path =  QDir::cleanPath(path);
-  QFile *f = new QFile(path);
+#endif
+  QFileInfo *f = new QFileInfo(path);
   if (!f->exists()) {
     return "File does not exist";
-  }
-  if (!(f->permissions() & QFile::ExeUser)) {
+  } else if (f->isDir()) {
+    return "This is a directory";
+  } else if (!f->isExecutable()) {
     return "File exist but is not executable";
+  } else if (!f->isFile()) {
+    return "This is not a file";
   }
   fEncoderPath = path;
@@ -2327,24 +2330,19 @@
     return "Path does not exist";
   }
+#if QT_VERSION < 0x040000
+  path =  QDir::cleanDirPath(path);
+#else
   path =  QDir::cleanPath(path);
-  QDir *d = new QDir(path);
-  if (!d->exists(path)) {
+#endif
+  QFileInfo *d = new QFileInfo(path);
+  if (!d->exists()) {
     return "Path does not exist";
-  }
-
-  d->setFilter( QDir::Dirs | QDir::Readable | QDir::Writable );
-  QStringList subDirList = d->entryList();
-  bool found = false;
-
-  for (QStringList::ConstIterator it = subDirList.begin() ;(it != subDirList.end()) ; it++) {
-    const QString currentDir = *it;
-    
-    if (currentDir == ".") { // we found it
-      found = true;
-    }
-  }
-
-  if (!found)
-    return "Path exist, but is not write accessible";
+  } else if (!d->isDir()) {
+    return "This is not a directory";
+  } else if (!d->isReadable()) {
+    return path +" is read protected";
+  } else if (!d->isWritable()) {
+    return path +" is write protected";
+  }
   
   fTempFolderPath = path;
@@ -2367,34 +2365,20 @@
     return "Path does not exist";
   }
-  // check if it is not a dir
-  QDir tmp(path);
-  tmp.setFilter( QDir::Dirs);
-  QStringList subDirListTmp = tmp.entryList();
-
-  if (!subDirListTmp.isEmpty()) {
-    return "This is a directory";
-  }
-
+
+#if QT_VERSION < 0x040000
+  path =  QDir::cleanDirPath(path);
+#else
   path =  QDir::cleanPath(path);
-  QFileInfo *fileInfo = new QFileInfo(path);
-  QDir dir = fileInfo->absoluteDir();
-  if (!dir.exists()) {
-    return "Folder does not exist";
-  }
-
-  dir.setFilter( QDir::Dirs | QDir::Writable );
-  QStringList subDirList = dir.entryList();
-  bool found = false;
-
-  for (QStringList::ConstIterator it = subDirList.begin() ;(it != subDirList.end()) ; it++) {
-    const QString currentDir = *it;
-    
-    if (currentDir == ".") { // we found it
-      found = true;
-    }
-  }
-
-  if (!found)
-    return "Path exist, but is not write accessible";
+#endif
+  QFileInfo *d = new QFileInfo(path);
+  if (!d->exists()) {
+    return "Path does not exist";
+  } else if (!d->isFile()) {
+    return "This is not a file";
+  } else if (!d->isReadable()) {
+    return path +" is read protected";
+  } else if (!d->isWritable()) {
+    return path +" is write protected";
+  }
   
   fSaveFileName = path;
@@ -2420,6 +2404,15 @@
     return tmp;
   }
-  QString path = QString(QDir::separator())+"QtMovie_"+QDateTime::currentDateTime ().toString("dd-MM-yyyy_hh-mm-ss")+QString(QDir::separator()); 
+#if QT_VERSION < 0x040000
+  QString sep = QChar(QDir::separator());
+#else
+  QString sep = QDir::separator();
+#endif
+  QString path = sep+"QtMovie_"+QDateTime::currentDateTime ().toString("dd-MM-yyyy_hh-mm-ss")+sep; 
+#if QT_VERSION < 0x040000
+  QDir *d = new QDir(QDir::cleanDirPath(fTempFolderPath));
+#else
   QDir *d = new QDir(QDir::cleanPath(fTempFolderPath));
+#endif
   // check if it is already present
   if (d->exists(path)) {
@@ -2442,5 +2435,9 @@
     return "";
   }
+#if QT_VERSION < 0x040000
+  QDir *d = new QDir(QDir::cleanDirPath(fMovieTempFolderPath));
+#else
   QDir *d = new QDir(QDir::cleanPath(fMovieTempFolderPath));
+#endif
   if (!d->exists()) {
     return "";  // already remove
@@ -2483,5 +2480,5 @@
   FILE* fp;
 #if QT_VERSION < 0x040000
-  fp = fopen (QString(fMovieTempFolderPath+fParameterFileName).ascii, "w");
+  fp = fopen (QString(fMovieTempFolderPath+fParameterFileName).ascii(), "w");
 #else
   fp = fopen (QString(fMovieTempFolderPath+fParameterFileName).toStdString().c_str(), "w");
@@ -2683,22 +2680,28 @@
     setRecordingStatus(ENCODING);
     fProcess = new QProcess();
+    
+#if QT_VERSION < 0x040000
+    QObject ::connect(fProcess,SIGNAL(launchFinished ()),
+                      this,SLOT(processEncodeFinished()));
+    QObject ::connect(fProcess,SIGNAL(readyReadStdOut ()),
+                      this,SLOT(processEncodeStdout()));
+    fProcess->setCommunication(QProcess::DupStderr);
+    fProcess->setArguments(QStringList(fEncoderPath));
+    fProcess->addArgument(fMovieTempFolderPath+fParameterFileName);
+    fProcess->start();
+#else
+#if QT_VERSION > 0x040100
+    QObject ::connect(fProcess,SIGNAL(finished ( int,QProcess::ExitStatus)),
+                      this,SLOT(processEncodeFinished()));
+    QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),
+                      this,SLOT(processEncodeStdout()));
+#else
+    QObject ::connect(fProcess,SIGNAL(finished ( int)),
+                      this,SLOT(processEncodeFinished()));
+    QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),
+                      this,SLOT(processEncodeStdout()));
+#endif
+    fProcess->setReadChannelMode(QProcess::MergedChannels);
     fProcess->start (fEncoderPath, QStringList(fMovieTempFolderPath+fParameterFileName));
-#if QT_VERSION > 0x040100
-	QObject ::connect(fProcess,SIGNAL(finished ( int,QProcess::ExitStatus)),
-                      this,SLOT(processFinished( int)));
-	QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),
-                      this,SLOT(processStdout()));
-#else
-#if QT_VERSION > 0x040000
-	QObject ::connect(fProcess,SIGNAL(finished ( int)),
-                      this,SLOT(processFinished( int)));
-	QObject ::connect(fProcess,SIGNAL(readyReadStandardOutput ()),
-                      this,SLOT(processStdout()));
-#else
-	QObject ::connect(fProcess,SIGNAL(finished ( int)),
-                      this,SLOT(processFinished( int)));
-	QObject ::connect(fProcess,SIGNAL(readyReadStdOut ()),
-                      this,SLOT(processStdout()));
-#endif
 #endif
   }
@@ -2709,53 +2712,99 @@
 
 
-void G4OpenGLQtViewer::processStdout()
+void G4OpenGLQtViewer::processEncodeStdout()
 {
 #if QT_VERSION > 0x040000
   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);
+#else
+  QString tmp = fProcess->readStdout ().data();
+  int start = tmp.findRev("ESTIMATED TIME");
+  tmp = tmp.mid(start,tmp.find("\n",start)-start);
+#endif
   setRecordingInfos(tmp);
 }
 
 
-void G4OpenGLQtViewer::processFinished(int exitCode)
+void G4OpenGLQtViewer::processEncodeFinished()
 {
 #ifdef GEANT4_QT_DEBUG
-  printf("processFinished \n");
+  printf("processEncodeFinished \n");
 #endif
 
   QString txt = "";
-  if (!exitCode) {
+  txt = getProcessErrorMsg();
+  if (txt == "") {
     setRecordingStatus(SUCCESS);
   } else {
-	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.\n";
-		break;
-	  case QProcess::Crashed:
-        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.\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.\n";
-	    break;
-	  case QProcess::ReadError:
-        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().\n";
-		break;
-    }
     setRecordingStatus(FAILED);
   }
   setRecordingInfos(txt+removeTempFolder());
 #ifdef GEANT4_QT_DEBUG
-  printf("processFinished END\n");
-#endif
+  printf("processEncodeFinished END\n");
+#endif
+}
+
+
+void G4OpenGLQtViewer::processLookForFinished() 
+ {
+
+  QString txt = getProcessErrorMsg();
+  if (txt != "") {
+    fEncoderPath = "";
+  } else {
+#if QT_VERSION > 0x040000
+    fEncoderPath = QString(fProcess->readAllStandardOutput ().data()).trimmed();
+#else
+    fEncoderPath = QString(fProcess->readStdout ().data()).simplifyWhiteSpace();
+#endif
+    // if not found, return "not found"
+    if (fEncoderPath.contains(" ")) {
+      fEncoderPath = "";
+    } else if (!fEncoderPath.contains("mpeg_encode")) {
+      fEncoderPath = "";
+    }
+    setEncoderPath(fEncoderPath);
+  }
+  // init temp folder
+#if QT_VERSION > 0x040000
+  setTempFolderPath(QDir::temp ().absolutePath ());
+#else
+  // Let's have a try
+  setTempFolderPath("/tmp/");
+#endif
+}
+
+
+QString G4OpenGLQtViewer::getProcessErrorMsg()
+ {
+   QString txt = "";
+#if QT_VERSION < 0x040000
+   if (!fProcess->normalExit ()) {
+     txt = "Exist status "+ fProcess->exitStatus ();
+   }
+#else
+   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.\n";
+     break;
+   case QProcess::Crashed:
+     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.\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.\n";
+     break;
+   case QProcess::ReadError:
+     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().\n";
+     break;
+   }
+#endif
+   return txt;
 }
 
Index: /trunk/geant4/visualization/OpenGL/src/G4OpenGLSceneHandler.cc
===================================================================
--- /trunk/geant4/visualization/OpenGL/src/G4OpenGLSceneHandler.cc	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/src/G4OpenGLSceneHandler.cc	(revision 754)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4OpenGLSceneHandler.cc,v 1.52 2008/01/04 22:07:01 allison Exp $
+// $Id: G4OpenGLSceneHandler.cc,v 1.53 2008/02/01 06:26:45 allison Exp $
 // GEANT4 tag $Name:  $
 //
@@ -467,4 +467,7 @@
 
   G4bool clipping = pViewer->fVP.IsSection() || pViewer->fVP.IsCutaway();
+
+  // Lighting disabled unless otherwise requested
+  glDisable (GL_LIGHTING);
 
   switch (drawing_style) {
@@ -494,5 +497,4 @@
       }
     }
-    glDisable (GL_LIGHTING);
     glColor3d (c.GetRed (), c.GetGreen (), c.GetBlue ());
     break;
@@ -526,5 +528,4 @@
     glDepthFunc (GL_LEQUAL);    //??? was GL_ALWAYS
     glDisable (GL_CULL_FACE);
-    glDisable (GL_LIGHTING);
     glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
     glColor3d (c.GetRed (), c.GetGreen (), c.GetBlue ());
@@ -604,4 +605,7 @@
 		 // having glBegin/End pairs *inside* loop in the more
 		 // usual case of no hidden line removal.
+
+      // Lighting disabled unless otherwise requested
+      glDisable (GL_LIGHTING);
 
       // Draw through stencil...
@@ -712,4 +716,5 @@
   glDisable (GL_STENCIL_TEST);  // Revert to default for next primitive.
   glDepthMask (1);              // Revert to default for next primitive.
+  glDisable (GL_LIGHTING);      // Revert to default for next primitive.
 }
 
Index: /trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc
===================================================================
--- /trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredQtViewer.cc	(revision 754)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4OpenGLStoredQtViewer.cc,v 1.9 2008/01/30 10:54:13 lgarnier Exp $
+// $Id: G4OpenGLStoredQtViewer.cc,v 1.13 2008/03/11 16:31:09 lgarnier Exp $
 // GEANT4 tag $Name:  $
 //
@@ -34,5 +34,5 @@
 #ifdef G4VIS_BUILD_OPENGLQT_DRIVER
 
-#define GEANT4_QT_DEBUG
+//#define GEANT4_QT_DEBUG
 
 #include "G4OpenGLStoredQtViewer.hh"
@@ -361,5 +361,9 @@
 #endif
   if (hasPendingEvents ())
-    G4MouseMoveEvent(event->x(),event->y(),event->buttons(),true);
+#if QT_VERSION < 0x040000
+    G4MouseMoveEvent(event->x(),event->y(),event->state());
+#else
+    G4MouseMoveEvent(event->x(),event->y(),event->buttons());
+#endif
 }
 
Index: /trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc
===================================================================
--- /trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/src/G4OpenGLStoredSceneHandler.cc	(revision 754)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4OpenGLStoredSceneHandler.cc,v 1.35 2008/01/04 22:07:01 allison Exp $
+// $Id: G4OpenGLStoredSceneHandler.cc,v 1.36 2008/02/18 08:53:49 asaim Exp $
 // GEANT4 tag $Name:  $
 //
@@ -133,5 +133,6 @@
     glPushMatrix();
     glLoadIdentity();
-    glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX);
+//    glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX);
+    glOrtho (-1., 1., -1., 1., -1., 1.);
     glMatrixMode (GL_MODELVIEW);
     glPushMatrix();
Index: /trunk/geant4/visualization/OpenGL/src/G4OpenGLViewer.cc
===================================================================
--- /trunk/geant4/visualization/OpenGL/src/G4OpenGLViewer.cc	(revision 753)
+++ /trunk/geant4/visualization/OpenGL/src/G4OpenGLViewer.cc	(revision 754)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4OpenGLViewer.cc,v 1.34 2007/05/24 18:27:13 allison Exp $
-// GEANT4 tag $Name: HEAD $
+// $Id: G4OpenGLViewer.cc,v 1.36 2008/03/10 16:57:04 lgarnier Exp $
+// GEANT4 tag $Name:  $
 //
 // 
@@ -372,16 +372,14 @@
   
   G4int size = 5000000;
-
-  GLfloat* feedback_buffer;
-  GLint returned;
-  FILE* file;
-  
-  feedback_buffer = new GLfloat[size];
+  GLfloat* feedback_buffer = new GLfloat[size];
   glFeedbackBuffer (size, GL_3D_COLOR, feedback_buffer);
   glRenderMode (GL_FEEDBACK);
   
   DrawView();
+
+  GLint returned;
   returned = glRenderMode (GL_RENDER);
   
+  FILE* file;
   if (print_string) {
     file = fopen (print_string, "w");
