diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-02 21:23:52 +0100 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2019-02-07 16:06:43 +0100 |
commit | 8a8063c1cd7b8e5eae861a8d7eeb89e7e3251e03 (patch) | |
tree | 261d1a78d4c21378e08380def3775823b82fe079 /profile-widget/profilewidget2.h | |
parent | 07b0df215f5562657a3a2c9dd20a95d489e8dcd3 (diff) | |
download | subsurface-8a8063c1cd7b8e5eae861a8d7eeb89e7e3251e03.tar.gz |
Profile: add "synchronous" mode for picture plotting
The thumbnails were fetched in the background to achieve a
snappier UI. The problem with that is that on LaTeX etc.
export only placeholder thumbnails were shown.
Therefore, implement a synchronous mode. This only tries
to fetch cached thumbnails or calculate thumbnails for
images. Videos and remote files are not supported.
Fixes #1963
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/profilewidget2.h')
-rw-r--r-- | profile-widget/profilewidget2.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h index 679abcf1d..300e46e39 100644 --- a/profile-widget/profilewidget2.h +++ b/profile-widget/profilewidget2.h @@ -75,7 +75,7 @@ public: ProfileWidget2(QWidget *parent = 0); void resetZoom(); void scale(qreal sx, qreal sy); - void plotDive(const struct dive *d = 0, bool force = false, bool clearPictures = false); + void plotDive(const struct dive *d = 0, bool force = false, bool clearPictures = false, bool plotPicturesSynchronously = false); void setupItem(AbstractProfilePolygonItem *item, DiveCartesianAxis *vAxis, int vData, int hData, int zValue); void setPrintMode(bool mode, bool grayscale = false); bool getPrintMode(); @@ -173,6 +173,7 @@ private: /*methods*/ void createPPGas(PartialPressureGasItem *item, int verticalColumn, color_index_t color, color_index_t colorAlert, const double *thresholdSettingsMin, const double *thresholdSettingsMax); void clearPictures(); + void plotPicturesInternal(bool synchronous); private: DivePlotDataModel *dataModel; int zoomLevel; @@ -240,7 +241,7 @@ private: std::unique_ptr<DivePictureItem> thumbnail; // For videos with known duration, we represent the duration of the video by a line std::unique_ptr<QGraphicsRectItem> durationLine; - PictureEntry (offset_t offsetIn, const QString &filenameIn, QGraphicsScene *scene); + PictureEntry (offset_t offsetIn, const QString &filenameIn, QGraphicsScene *scene, bool synchronous); bool operator< (const PictureEntry &e) const; }; void updateThumbnailXPos(PictureEntry &e); |