diff options
author | Tim Wootton <tim@tee-jay.demon.co.uk> | 2013-12-18 21:55:53 +0000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-18 14:07:41 -0800 |
commit | ecc33e6375461087975543f8f6281928d7c9a4b3 (patch) | |
tree | 01f1a10bbc9a90c3e27ad7f6c42eae3627d468e9 /qt-ui | |
parent | 77c2c4c5adbc13ac72b5e6c18546187fd43396f2 (diff) | |
download | subsurface-ecc33e6375461087975543f8f6281928d7c9a4b3.tar.gz |
Adds unhide to profile menu context menu
Unhide menu is only shown when hidden events exist.
Also updates relavent manual section.
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 20 | ||||
-rw-r--r-- | qt-ui/profilegraphics.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 19fe81d91..2db6d9009 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -161,6 +161,17 @@ void ProfileGraphicsView::contextMenuEvent(QContextMenuEvent* event) m.addAction(action); break; } + bool some_hidden = false; + for (int i = 0; i < evn_used; i++) { + if (ev_namelist[i].plot_ev == false) { + some_hidden = true; + break; + } + } + if (some_hidden) { + action = m.addAction(tr("Unhde all events"), this, SLOT(unhideEvents())); + action->setData(event->globalPos()); + } m.exec(event->globalPos()); } @@ -213,6 +224,15 @@ void ProfileGraphicsView::hideEvents() } } +void ProfileGraphicsView::unhideEvents() +{ + QAction *action = qobject_cast<QAction*>(sender()); + for (int i = 0; i < evn_used; i++) { + ev_namelist[i].plot_ev = true; + } + plot(current_dive, TRUE); +} + void ProfileGraphicsView::removeEvent() { QAction *action = qobject_cast<QAction*>(sender()); diff --git a/qt-ui/profilegraphics.h b/qt-ui/profilegraphics.h index 29315a749..c9d1ef2e6 100644 --- a/qt-ui/profilegraphics.h +++ b/qt-ui/profilegraphics.h @@ -150,6 +150,7 @@ public slots: void on_scaleAction(); void changeGas(); void hideEvents(); + void unhideEvents(); void removeEvent(); void addBookmark(); private: |