diff options
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 9 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 1a9d5ccf7..649bda0d6 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -289,10 +289,14 @@ void ProfileWidget2::setupItemOnScene() heartBeatAxis->setLinesVisible(true); percentageAxis->setTextVisible(true); percentageAxis->setLinesVisible(true); + + replotEnabled = true; } void ProfileWidget2::replot() { + if (!replotEnabled) + return; dataModel->clear(); plotDive(0, true); // simply plot the displayed_dive again } @@ -1089,6 +1093,11 @@ struct plot_data *ProfileWidget2::getEntryFromPos(QPointF pos) return entry; } +void ProfileWidget2::setReplot(bool state) +{ + replotEnabled = state; +} + void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event) { if (currentState == ADD || currentState == PLAN) { diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index a1f216e48..9808a964b 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -103,6 +103,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 plotPictures(); + void setReplot(bool state); void replot(); /* this is called for every move on the handlers. maybe we can speed up this a bit? */ @@ -145,6 +146,7 @@ private: QString backgroundFile; ToolTipItem *toolTipItem; bool isPlotZoomed; + bool replotEnabled; // All those here should probably be merged into one structure, // So it's esyer to replicate for more dives later. // In the meantime, keep it here. |