Commit de849432 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - webkit now optional. If not found, a message box pops up and shows...

[CHANGE] - webkit now optional. If not found, a message box pops up and shows the link to the help which then is opened in the user's browser.
parent 223c8d53
...@@ -45,6 +45,11 @@ SET( QT_LIBS ${QT_QTCORE_LIBRARY} ...@@ -45,6 +45,11 @@ SET( QT_LIBS ${QT_QTCORE_LIBRARY}
${QT_QTOPENGL_LIBRARY} ${QT_QTOPENGL_LIBRARY}
${QT_QTWEBKIT_LIBRARY} ) ${QT_QTWEBKIT_LIBRARY} )
# If Qt4 Webkit is not available:
IF( NOT QT_QTWEBKIT_FOUND )
ADD_DEFINITIONS( "-DQT4GUI_NOWEBKIT" )
ENDIF()
# --------------------------------------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------------------------------------
# Add sources as target # Add sources as target
# --------------------------------------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------------------------------------
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <QtGui/QMenuBar> #include <QtGui/QMenuBar>
#include <QtGui/QMessageBox> #include <QtGui/QMessageBox>
#include <QtGui/QTextEdit> #include <QtGui/QTextEdit>
#include <QtWebKit/QWebView>
#include <QtGui/QShortcut> #include <QtGui/QShortcut>
#include <QtGui/QSlider> #include <QtGui/QSlider>
#include <QtGui/QVBoxLayout> #include <QtGui/QVBoxLayout>
...@@ -46,6 +45,10 @@ ...@@ -46,6 +45,10 @@
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtGui/QInputDialog> #include <QtGui/QInputDialog>
#ifndef QT4GUI_NOWEBKIT
#include <QtWebKit/QWebView>
#endif
#include "core/common/WColor.h" #include "core/common/WColor.h"
#include "core/common/WIOTools.h" #include "core/common/WIOTools.h"
#include "core/common/WProjectFileIO.h" #include "core/common/WProjectFileIO.h"
...@@ -790,6 +793,8 @@ void WMainWindow::openAboutDialog() ...@@ -790,6 +793,8 @@ void WMainWindow::openAboutDialog()
void WMainWindow::openOpenWalnutHelpDialog() void WMainWindow::openOpenWalnutHelpDialog()
{ {
std::string filename( WPathHelper::getDocPath().file_string() + "/openwalnut-qt4/OpenWalnutHelp.html" ); std::string filename( WPathHelper::getDocPath().file_string() + "/openwalnut-qt4/OpenWalnutHelp.html" );
#ifndef QT4GUI_NOWEBKIT
std::string content = readFileIntoString( filename ); std::string content = readFileIntoString( filename );
QWidget* window = new QWidget( this, Qt::Window ); QWidget* window = new QWidget( this, Qt::Window );
...@@ -806,6 +811,10 @@ void WMainWindow::openOpenWalnutHelpDialog() ...@@ -806,6 +811,10 @@ void WMainWindow::openOpenWalnutHelpDialog()
view->setHtml( content.c_str(), QUrl( location ) ); view->setHtml( content.c_str(), QUrl( location ) );
view->show(); view->show();
layout->addWidget( view ); layout->addWidget( view );
#else
QMessageBox::information( this, "Help", QString::fromStdString( "Sorry! Your version of OpenWalnut was not compiled with embedded help. "
"To open the help pages, use this link: <a href="+filename+">Help</a>." ) );
#endif
} }
void WMainWindow::setPresetViewLeft() void WMainWindow::setPresetViewLeft()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment