mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 21:03:23 +00:00
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 <danilo.eu@gmail.com>
This commit is contained in:
parent
2fb2918607
commit
1e69731804
3 changed files with 7 additions and 7 deletions
|
@ -106,7 +106,7 @@ ifeq ($(strip $(QMAKE)),)
|
|||
$(error Could not find qmake or qmake-qt4 in $$PATH for the Qt4 version they failed)
|
||||
endif
|
||||
|
||||
QT_MODULES = QtGui QtSvg QtNetwork
|
||||
QT_MODULES = QtGui QtSvg QtNetwork QtWebKit
|
||||
QT_CORE = QtCore
|
||||
MOC = $(shell $(PKGCONFIG) --variable=moc_location QtCore)
|
||||
UIC = $(shell $(PKGCONFIG) --variable=uic_location QtGui)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <QCloseEvent>
|
||||
#include <QApplication>
|
||||
#include <QFontMetrics>
|
||||
#include <QTextBrowser>
|
||||
#include <QWebView>
|
||||
#include <QTableView>
|
||||
#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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue