summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-30 10:54:06 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-31 05:32:41 +0900
commit7f732559d893964210181202a417d7c300b3cf19 (patch)
treeddffb94dc1fae07867bf905b02ea79fca1a0dd40
parent32d8051404498cdba8b43c49d1b2aba5fb97818c (diff)
downloadsubsurface-7f732559d893964210181202a417d7c300b3cf19.tar.gz
Added preliminary support for a Manual Display Widget.
Added a preliminary support for a manual display widget, it's a very basic HTML text-browser, so it can have hyperlinks, images and everything that a 1995 browser has. The long term plan is to subsittute this manual by a more modern 'help' using QGraphicsView, that will interact on the application level. See #121 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r--qt-ui/mainwindow.cpp15
-rw-r--r--qt-ui/mainwindow.h3
2 files changed, 14 insertions, 4 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 79e3f2c7d..b70bb1ab9 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -15,7 +15,7 @@
#include <QCloseEvent>
#include <QApplication>
#include <QFontMetrics>
-
+#include <QTextBrowser>
#include "divelistview.h"
#include "starwidget.h"
@@ -35,7 +35,7 @@ MainWindow* mainWindow()
return instance;
}
-MainWindow::MainWindow() : ui(new Ui::MainWindow())
+MainWindow::MainWindow() : ui(new Ui::MainWindow()), helpView(0)
{
ui->setupUi(this);
setWindowIcon(QIcon(":subsurface-icon"));
@@ -264,7 +264,11 @@ void MainWindow::on_actionAboutSubsurface_triggered()
void MainWindow::on_actionUserManual_triggered()
{
- qDebug("actionUserManual");
+ if(!helpView){
+ helpView = new QTextBrowser();
+ }
+ helpView->setText(tr("HTML of Help menu here."));
+ helpView->show();
}
QString MainWindow::filter()
@@ -492,6 +496,11 @@ void MainWindow::writeSettings()
void MainWindow::closeEvent(QCloseEvent *event)
{
+ if (helpView && helpView->isVisible()){
+ helpView->close();
+ helpView->deleteLater();
+ }
+
if (unsaved_changes() && (askSaveChanges() == FALSE)) {
event->ignore();
return;
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 36b174284..f3e728176 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -29,6 +29,7 @@ class DiveListView;
class GlobeGPS;
class MainTab;
class ProfileGraphicsView;
+class QTextBrowser;
class MainWindow : public QMainWindow
{
@@ -93,7 +94,7 @@ private:
Ui::MainWindow *ui;
QAction *actionNextDive;
QAction *actionPreviousDive;
-
+ QTextBrowser *helpView;
QString filter();
bool askSaveChanges();
void writeSettings();