aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Guido Lerch <guido.lerch@gmail.com>2015-10-20 22:36:59 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-03 08:31:41 -0800
commitfb24210ad9430262a20c4f55f7007000f2c3bee9 (patch)
treee7fd1311a5079458eaf1b1df7b9152936d7f5bce /desktop-widgets/maintab.cpp
parentb73b3126730c45883f97a546a9b2526ceee6426a (diff)
downloadsubsurface-fb24210ad9430262a20c4f55f7007000f2c3bee9.tar.gz
Context menu for images: add loading from file / web
Signed-off-by: Guido Lerch <guido.lerch@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/maintab.cpp')
-rw-r--r--desktop-widgets/maintab.cpp13
1 files changed, 13 insertions, 0 deletions
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());