From fb24210ad9430262a20c4f55f7007000f2c3bee9 Mon Sep 17 00:00:00 2001 From: Guido Lerch Date: Tue, 20 Oct 2015 22:36:59 +0200 Subject: Context menu for images: add loading from file / web Signed-off-by: Guido Lerch Signed-off-by: Dirk Hohndel --- desktop-widgets/maintab.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'desktop-widgets/maintab.cpp') diff --git a/desktop-widgets/maintab.cpp b/desktop-widgets/maintab.cpp index 5c6d831f8..864c24782 100644 --- a/desktop-widgets/maintab.cpp +++ b/desktop-widgets/maintab.cpp @@ -1584,6 +1584,16 @@ void MainTab::removeAllPhotos() } } +void MainTab::addPhotosFromFile() +{ + MainWindow::instance()->dive_list()->loadImages(); +} + +void MainTab::addPhotosFromURL() +{ + MainWindow::instance()->dive_list()->loadWebImages(); +} + #define SHOW_SELECTIVE(_component) \ if (what._component) \ ui._component->setText(displayed_dive._component); @@ -1627,6 +1637,9 @@ void MainTab::showAndTriggerEditSelective(struct dive_components what) void MainTab::contextMenuEvent(QContextMenuEvent *event) { QMenu popup(this); + popup.addAction(tr("Load image(s) from file(s)"), this, SLOT(addPhotosFromFile())); + popup.addAction(tr("Load image(s) from web"), this, SLOT(addPhotosFromURL())); + popup.addSeparator(); popup.addAction(tr("Delete selected images"), this, SLOT(removeSelectedPhotos())); popup.addAction(tr("Delete all images"), this, SLOT(removeAllPhotos())); QAction *actionTaken = popup.exec(event->globalPos()); -- cgit v1.2.3-70-g09d2