From 1e6973180403e513c6c9469ec92751f083f5ff3c Mon Sep 17 00:00:00 2001 From: Danilo Cesar Lemes de Paula Date: Thu, 22 Aug 2013 16:20:47 -0300 Subject: use QWebView to show the user manual Looks like the QTextBrowser can't render the manual correctly. Also, QWebView provides a better way to find contents on a webpage, which is an important feature for an user manual (to be implemented). Signed-off-by: Danilo Cesar Lemes de Paula --- qt-ui/mainwindow.cpp | 8 ++++---- qt-ui/mainwindow.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index a78b84565..75f18000c 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include "divelistview.h" #include "starwidget.h" @@ -411,14 +411,14 @@ void MainWindow::on_actionAboutSubsurface_triggered() void MainWindow::on_actionUserManual_triggered() { if(!helpView){ - helpView = new QTextBrowser(); + helpView = new QWebView(); } QString searchPath = getSubsurfaceDataPath("Documentation"); if (searchPath != "") { QUrl url(searchPath.append("/user-manual.html")); - helpView->setSource(url); + helpView->setUrl(url); } else { - helpView->setText(tr("Cannot find the Subsurface manual")); + helpView->setHtml(tr("Cannot find the Subsurface manual")); } helpView->show(); } diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 2009740fe..0b0b0055d 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -29,7 +29,7 @@ class DiveListView; class GlobeGPS; class MainTab; class ProfileGraphicsView; -class QTextBrowser; +class QWebView; enum MainWindowTitleFormat { MWTF_DEFAULT, MWTF_FILENAME }; @@ -110,7 +110,7 @@ private: Ui::MainWindow *ui; QAction *actionNextDive; QAction *actionPreviousDive; - QTextBrowser *helpView; + QWebView *helpView; QString filter(); bool askSaveChanges(); void writeSettings(); -- cgit v1.2.3-70-g09d2