diff options
author | Guido Lerch <guido.lerch@gmail.com> | 2015-10-20 21:02:41 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-11-03 08:31:04 -0800 |
commit | 3c3523f9b8af25a2eb28042e0de3c527c33506eb (patch) | |
tree | f7dc36bd7f1fe367ef071e98318104d0f07dd368 /desktop-widgets | |
parent | 6381425476e651bcd8e739303815b7be13e62a47 (diff) | |
download | subsurface-3c3523f9b8af25a2eb28042e0de3c527c33506eb.tar.gz |
Context menu for images
Just add a context menu for now - the following commits will make this
useful.
Signed-off-by: Guido Lerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/maintab.cpp | 9 | ||||
-rw-r--r-- | desktop-widgets/maintab.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/desktop-widgets/maintab.cpp b/desktop-widgets/maintab.cpp index c7961735a..7b4c4b9d1 100644 --- a/desktop-widgets/maintab.cpp +++ b/desktop-widgets/maintab.cpp @@ -1610,3 +1610,12 @@ void MainTab::showAndTriggerEditSelective(struct dive_components what) weightModel->changed = true; } } + +void MainTab::contextMenuEvent(QContextMenuEvent *event) +{ + QMenu popup(this); + popup.addAction(tr("Delete selected images"), this, SLOT(removeSelectedPhotos())); + popup.addAction(tr("Delete all images"), this, SLOT(removeAllPhotos())); + QAction *actionTaken = popup.exec(event->globalPos()); + event->accept(); +} diff --git a/desktop-widgets/maintab.h b/desktop-widgets/maintab.h index 20b4da690..7b2bb863b 100644 --- a/desktop-widgets/maintab.h +++ b/desktop-widgets/maintab.h @@ -54,6 +54,7 @@ public: void refreshDisplayedDiveSite(); void nextInputField(QKeyEvent *event); void showAndTriggerEditSelective(struct dive_components what); + void contextMenuEvent(QContextMenuEvent *event); signals: void addDiveFinished(); |