aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Sergey Starosek <sergey.starosek@gmail.com>2013-12-05 14:02:25 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-05 07:31:29 -0800
commit09a8a85bab620dd119a601e9cadbd0333385acbc (patch)
tree999d9508160472ed17c1b9322480d7d740ecd754 /qt-ui/mainwindow.cpp
parentfe713d37f4439831ec32325a72590cdab7cde052 (diff)
downloadsubsurface-09a8a85bab620dd119a601e9cadbd0333385acbc.tar.gz
Open external links in default browser
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index e049179e8..c9b003d3a 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -17,6 +17,7 @@
#include <QWebView>
#include <QTableView>
#include <QDesktopWidget>
+#include <QDesktopServices>
#include "divelistview.h"
#include "starwidget.h"
@@ -489,6 +490,8 @@ void MainWindow::on_actionUserManual_triggered()
{
if(!helpView){
helpView = new QWebView();
+ helpView->page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
+ connect(helpView, SIGNAL(linkClicked(QUrl)), this, SLOT(linkClickedSlot(QUrl)));
}
QString searchPath = getSubsurfaceDataPath("Documentation");
if (searchPath != "") {
@@ -500,6 +503,11 @@ void MainWindow::on_actionUserManual_triggered()
helpView->show();
}
+void MainWindow::linkClickedSlot(QUrl url)
+{
+ QDesktopServices::openUrl(url);
+}
+
QString MainWindow::filter()
{
QString f;