From 3c3523f9b8af25a2eb28042e0de3c527c33506eb Mon Sep 17 00:00:00 2001 From: Guido Lerch Date: Tue, 20 Oct 2015 21:02:41 +0200 Subject: [PATCH] Context menu for images Just add a context menu for now - the following commits will make this useful. Signed-off-by: Guido Lerch Signed-off-by: Dirk Hohndel --- desktop-widgets/maintab.cpp | 9 +++++++++ desktop-widgets/maintab.h | 1 + 2 files changed, 10 insertions(+) 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();