mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Open external links in default browser
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
fe713d37f4
commit
09a8a85bab
2 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <QMainWindow>
|
||||
#include <QAction>
|
||||
#include <QUrl>
|
||||
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
|
@ -102,6 +103,7 @@ private slots:
|
|||
void initialUiSetup();
|
||||
|
||||
void on_actionImportCSV_triggered();
|
||||
void linkClickedSlot(QUrl url);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
|
Loading…
Add table
Reference in a new issue