mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
b73b312673
commit
fb24210ad9
2 changed files with 15 additions and 0 deletions
|
@ -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) \
|
#define SHOW_SELECTIVE(_component) \
|
||||||
if (what._component) \
|
if (what._component) \
|
||||||
ui._component->setText(displayed_dive._component);
|
ui._component->setText(displayed_dive._component);
|
||||||
|
@ -1627,6 +1637,9 @@ void MainTab::showAndTriggerEditSelective(struct dive_components what)
|
||||||
void MainTab::contextMenuEvent(QContextMenuEvent *event)
|
void MainTab::contextMenuEvent(QContextMenuEvent *event)
|
||||||
{
|
{
|
||||||
QMenu popup(this);
|
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 selected images"), this, SLOT(removeSelectedPhotos()));
|
||||||
popup.addAction(tr("Delete all images"), this, SLOT(removeAllPhotos()));
|
popup.addAction(tr("Delete all images"), this, SLOT(removeAllPhotos()));
|
||||||
QAction *actionTaken = popup.exec(event->globalPos());
|
QAction *actionTaken = popup.exec(event->globalPos());
|
||||||
|
|
|
@ -98,6 +98,8 @@ slots:
|
||||||
void photoDoubleClicked(const QString filePath);
|
void photoDoubleClicked(const QString filePath);
|
||||||
void removeSelectedPhotos();
|
void removeSelectedPhotos();
|
||||||
void removeAllPhotos();
|
void removeAllPhotos();
|
||||||
|
void addPhotosFromFile();
|
||||||
|
void addPhotosFromURL();
|
||||||
void showLocation();
|
void showLocation();
|
||||||
void enableGeoLookupEdition();
|
void enableGeoLookupEdition();
|
||||||
void disableGeoLookupEdition();
|
void disableGeoLookupEdition();
|
||||||
|
|
Loading…
Add table
Reference in a new issue