From 757c4aab20cee9cd3699276a9b4f7a7aee4719c2 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Fri, 24 Apr 2015 17:10:55 +0200 Subject: Allow images to be added via the web This adds a new divelist context menu entry which asks for a URL. The file is retrieved and if it is an image it is added to the cache and the url is associated to dives as with local files. NB this currently only works with URLs pointing directly to images. But it should not be too hard to add the possibility to add a direction via an html file and its image tags. To test: open dives/test43.xml and delete the image and then add the URL http://euve10195.vserver.de/~robert/wreck.jpg Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'qt-ui/divelistview.h') diff --git a/qt-ui/divelistview.h b/qt-ui/divelistview.h index a6522fa9a..6e9a18215 100644 --- a/qt-ui/divelistview.h +++ b/qt-ui/divelistview.h @@ -13,6 +13,7 @@ #include #include +#include #include "models.h" class DiveListView : public QTreeView { @@ -51,6 +52,7 @@ slots: void renumberDives(); void shiftTimes(); void loadImages(); + void loadWebImages(); static QString lastUsedImageDir(); signals: @@ -78,6 +80,9 @@ private: void updateLastImageTimeOffset(int offset); int lastImageTimeOffset(); void addToTrip(int delta); + void matchImagesToDives(QStringList fileNames); + void loadImageFromURL(QUrl url); + QNetworkAccessManager manager; }; #endif // DIVELISTVIEW_H -- cgit v1.2.3-70-g09d2