summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--profile-widget/profilewidget2.cpp9
-rw-r--r--profile-widget/profilewidget2.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index a162f8782..1b74f9d88 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -29,6 +29,7 @@
#include "core/qthelper.h"
#include "core/gettextfromc.h"
#include "core/imagedownloader.h"
+#include "core/subsurface-qt/divelistnotifier.h"
#endif
#include <libdivecomputer/parser.h>
@@ -169,6 +170,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
connect(DivePictureModel::instance(), &DivePictureModel::rowsInserted, this, &ProfileWidget2::plotPictures);
connect(DivePictureModel::instance(), &DivePictureModel::picturesRemoved, this, &ProfileWidget2::removePictures);
connect(DivePictureModel::instance(), &DivePictureModel::modelReset, this, &ProfileWidget2::plotPictures);
+ connect(&diveListNotifier, &DiveListNotifier::cylinderEdited, this, &ProfileWidget2::cylinderChanged);
#endif // SUBSURFACE_MOBILE
#if !defined(QT_NO_DEBUG) && defined(SHOW_PLOT_INFO_TABLE)
@@ -2244,6 +2246,13 @@ void ProfileWidget2::removePictures(const QVector<QString> &fileUrls)
calculatePictureYPositions();
}
+void ProfileWidget2::cylinderChanged(dive *d)
+{
+ if (!d || d->id != displayed_dive.id)
+ return; // Cylinders of a differnt dive than the shown one changed.
+ replot();
+}
+
#endif
void ProfileWidget2::dropEvent(QDropEvent *event)
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index 223a03c33..ebaa52696 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -129,6 +129,7 @@ slots: // Necessary to call from QAction's signals.
void pointInserted(const QModelIndex &parent, int start, int end);
void pointsRemoved(const QModelIndex &, int start, int end);
void updateThumbnail(QString filename, QImage thumbnail, duration_t duration);
+ void cylinderChanged(dive *d);
/* this is called for every move on the handlers. maybe we can speed up this a bit? */
void recreatePlannedDive();