#
IF(${WINDOWS})
- FIND_LIBRARY(OpenGL_LIB OpenGL32 "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib")
- FIND_LIBRARY(GlU_LIB GlU32 "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib")
+ IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") # if platform is Windows 64 bit
+ FIND_LIBRARY(OpenGL_LIB OpenGL32 HINTS "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib/x64")
+ FIND_LIBRARY(GlU_LIB GlU32 HINTS "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib/x64")
+ ELSE("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+ FIND_LIBRARY(OpenGL_LIB OpenGL32 "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib")
+ FIND_LIBRARY(GlU_LIB GlU32 "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib")
+ ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
ELSE(${WINDOWS})
FIND_LIBRARY(OpenGL_LIB GL)
FIND_LIBRARY(GlU_LIB GLU)
#include <QFileInfo>
#include <QWebView>
#include <QMenuBar>
+#include <QMessageBox>
#include <QToolBar>
#include <QMenu>
#include <QStatusBar>
if ( url.scheme() == "file" ) {
QString filename = url.toLocalFile();
if ( QFileInfo( filename ).suffix().toLower() == "pdf" ) {
+ int i = -1;
#ifdef WIN32
- ::system( QString( "start %2" ).arg( filename ).toLatin1().constData() );
+ i = ::system( QString( "start %2" ).arg( filename ).toLatin1().constData() );
#else
// special processing of PDF files
QStringList readers;
- readers << "xdg-open" << "acroread" << "kpdf" << "kghostview" << "xpdf";
- int i;
+ readers << "xdg-open" << "acroread"<< "okular" << "evince" << "kpdf" << "kghostview" << "xpdf";
foreach ( QString r, readers ) {
QString reader = QString( "/usr/bin/%1" ).arg( r );
if ( QFileInfo( reader ).exists() ) {
- i = ::system( QString( "%1 %2" ).arg( reader ).arg( url.toLocalFile() ).toLatin1().constData() );
- // If Salome Qt version is lower than the system one, on KDE an unresolved symbol is raised
- // In this case, we try to launch the pdf viewer after unsetting the LD_LIBRARY_PATH environnement variable
// Warning: the test on the return value of ::system does not work if the command ends with '&'
- if (i != 0)
- i = ::system( QString( "unset LD_LIBRARY_PATH ; %1 %2" ).arg( reader ).arg( url.toLocalFile() ).toLatin1().constData() );
- if (i == 0)
- break;
+ i = ::system( QString( "%1 %2" ).arg( reader ).arg( url.toLocalFile() ).toLatin1().constData() );
+ if (i != 0) {
+ // If Salome Qt version is lower than the system one, on KDE an unresolved symbol is raised
+ // In this case, we can try to launch the pdf viewer after unsetting the LD_LIBRARY_PATH environnement variable
+ i = ::system( QString( "unset LD_LIBRARY_PATH ; %1 %2" ).arg( reader ).arg( url.toLocalFile() ).toLatin1().constData() );
+ }
+ if (i == 0) {
+ break;
+ }
}
}
#endif // WIN32
+ if (i != 0) {
+ QMessageBox::warning(this, tr("Opening pdf file"), tr("Impossible to open the pdf file: no viewer found or compatible."));
+ }
}
}
myWebView->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );