Changeset 732 for trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
- Timestamp:
- Feb 27, 2008, 11:49:37 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r731 r732 301 301 ,fHoldRotateEvent(false) 302 302 ,fAutoMove(false) 303 ,fEncoderPath("") 304 ,fTempFolderPath("/temp") 305 ,fMovieParametersDialog(NULL) 303 306 { 304 307 #ifdef GEANT4_QT_DEBUG 305 fEncoderPath = "";306 308 printf("G4OpenGLQtViewer::G4OpenGLQtViewer \n"); 307 309 #endif … … 1458 1460 1459 1461 void G4OpenGLQtViewer::showMovieParametersDialog() { 1460 if (! movieParametersDialog) {1461 movieParametersDialog= new G4OpenGLQtMovieDialog(this,GLWindow);1462 } 1463 movieParametersDialog->show();1462 if (!fMovieParametersDialog) { 1463 fMovieParametersDialog= new G4OpenGLQtMovieDialog(this,GLWindow); 1464 } 1465 fMovieParametersDialog->show(); 1464 1466 } 1465 1467 … … 2074 2076 2075 2077 if ((event->key() == Qt::Key_Return) || (event->key() == Qt::Key_Enter)){ // end of video 2076 GLWidget->setCaption( tr( " Stop Recording " ));2077 2078 G4cout << "Stop Recording \n" << G4endl; 2078 2079 G4cout << "Saving /temp/output.mpg \n" << G4endl; … … 2089 2090 fRecordFrames = !fRecordFrames; 2090 2091 if (fRecordFrames) { 2091 GLWidget->setCaption( tr( " Start Recording " ));2092 2092 G4cout << " Start Recording \n" << G4endl; 2093 2093 } else { 2094 GLWidget->setCaption( tr( " Pause Recording" ));2095 2094 G4cout << "Pause Recording \n" << G4endl; 2096 2095 } … … 2135 2134 2136 2135 if (search.waitForFinished()) { 2137 fEncoderPath = QString ::fromLocal8Bit(search.readAll());2136 fEncoderPath = QString(QString::fromLocal8Bit(search.readAll())).trimmed(); 2138 2137 // if not found, return "not found" 2139 2138 if (fEncoderPath.contains(" ")) { … … 2150 2149 /** 2151 2150 * set the new encoder path 2151 * @return true if the path exist and file is executable, false otherwise 2152 2152 */ 2153 void G4OpenGLQtViewer::setEncoderPath(QString path) { 2153 bool G4OpenGLQtViewer::setEncoderPath(QString path) { 2154 QFile *f = new QFile(path); 2155 if (!f->exists()) { 2156 #ifdef GEANT4_QT_DEBUG 2157 printf("G4OpenGLQtViewer::setEncoderPath NOT E XIST\n"); 2158 #endif 2159 return false; 2160 } 2161 if (!(f->permissions() & QFile::ExeUser)) { 2162 #ifdef GEANT4_QT_DEBUG 2163 printf("G4OpenGLQtViewer::setEncoderPath No WRITE ACCES\n"); 2164 #endif 2165 return false; 2166 } 2154 2167 fEncoderPath = path; 2155 } 2168 return true; 2169 } 2170 2171 /** 2172 * set the temp folder path 2173 * @return true if the path exist and we could write in, false otherwise 2174 */ 2175 bool G4OpenGLQtViewer::setTempFolderPath(QString path) { 2176 2177 QDir *d = new QDir(path); 2178 if (!d->exists(path)) { 2179 return false; 2180 } 2181 2182 d->setFilter( QDir::Dirs | QDir::Readable | QDir::Writable ); 2183 QStringList subDirList = d->entryList(); 2184 bool found = false; 2185 2186 for (QStringList::ConstIterator it = subDirList.begin() ;(it != subDirList.end()) ; it++) { 2187 const QString currentDir = *it; 2188 2189 if (currentDir == ".") { // we found it 2190 found = true; 2191 } 2192 } 2193 2194 if (!found) 2195 return false; 2196 2197 fTempFolderPath = path; 2198 return true; 2199 } 2200 2201 /** @return the temp folder path 2202 */ 2203 QString G4OpenGLQtViewer::getTempFolderPath() { 2204 return fTempFolderPath ; 2205 } 2206 2207 2156 2208 2157 2209
Note: See TracChangeset
for help on using the changeset viewer.