From c972c7cbd9461041cc2cf8689e32f9a8fd04f66f Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 31 May 2013 06:26:08 +0900 Subject: Display the Subsurface manual in the help widget This adds a helper function to determine the Subsurface data directory (are we running from build directory? installed on Linux? installed on Mac? - still need to add support for Windows). This same function is then used by both the setup for Marble and for the help browser. This assumes that the user-manual.html file has actually been built and installed (which we don't do by default with the current Makefile). Right now there are rendering issues with our manual in the help browser widget - I'm sure this can be fixed... Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index b70bb1ab9..d3cd951d8 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -23,6 +23,7 @@ #include "../dive.h" #include "../divelist.h" #include "../pref.h" +#include "../helpers.h" #include "modeldelegates.h" #include "models.h" #include "downloadfromdivecomputer.h" @@ -267,7 +268,13 @@ void MainWindow::on_actionUserManual_triggered() if(!helpView){ helpView = new QTextBrowser(); } - helpView->setText(tr("HTML of Help menu here.")); + QString searchPath = getSubsurfaceDataPath("Documentation"); + if (searchPath != "") { + QUrl url(searchPath.append("/user-manual.html")); + helpView->setSource(url); + } else { + helpView->setText(tr("Cannot find the Subsurface manual")); + } helpView->show(); } @@ -500,7 +507,7 @@ void MainWindow::closeEvent(QCloseEvent *event) helpView->close(); helpView->deleteLater(); } - + if (unsaved_changes() && (askSaveChanges() == FALSE)) { event->ignore(); return; -- cgit v1.2.3-70-g09d2