summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
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
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')
-rw-r--r--desktop-widgets/maintab.cpp13
-rw-r--r--desktop-widgets/maintab.h2
2 files changed, 15 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());
diff --git a/desktop-widgets/maintab.h b/desktop-widgets/maintab.h
index c3f6649a8..d4f7aaaa9 100644
--- a/desktop-widgets/maintab.h
+++ b/desktop-widgets/maintab.h
@@ -98,6 +98,8 @@ slots:
void photoDoubleClicked(const QString filePath);
void removeSelectedPhotos();
void removeAllPhotos();
+ void addPhotosFromFile();
+ void addPhotosFromURL();
void showLocation();
void enableGeoLookupEdition();
void disableGeoLookupEdition();