summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/mainwindow.cpp8
-rw-r--r--desktop-widgets/printer.cpp4
-rw-r--r--profile-widget/profilewidget2.cpp8
-rw-r--r--profile-widget/profilewidget2.h2
4 files changed, 11 insertions, 11 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 9898fc72b..030b33b70 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -531,7 +531,7 @@ void MainWindow::current_dive_changed(int divenr)
if (divenr >= 0) {
select_dive(divenr);
}
- graphics()->plotDive();
+ graphics()->plotDive(nullptr, false, true);
information()->updateDiveInfo();
configureToolbar();
MapWidget::instance()->reload();
@@ -1095,7 +1095,7 @@ void MainWindow::on_actionAddDive_triggered()
graphics()->setAddState();
DivePlannerPointsModel::instance()->createSimpleDive();
configureToolbar();
- graphics()->plotDive();
+ graphics()->plotDive(nullptr, false, true);
fixup_dc_duration(&displayed_dive.dc);
displayed_dive.duration = displayed_dive.dc.duration;
@@ -1314,7 +1314,7 @@ void MainWindow::on_actionPreviousDC_triggered()
unsigned nrdc = number_of_computers(current_dive);
dc_number = (dc_number + nrdc - 1) % nrdc;
configureToolbar();
- graphics()->plotDive();
+ graphics()->plotDive(nullptr, false, true);
information()->updateDiveInfo();
}
@@ -1323,7 +1323,7 @@ void MainWindow::on_actionNextDC_triggered()
unsigned nrdc = number_of_computers(current_dive);
dc_number = (dc_number + 1) % nrdc;
configureToolbar();
- graphics()->plotDive();
+ graphics()->plotDive(nullptr, false, true);
information()->updateDiveInfo();
}
diff --git a/desktop-widgets/printer.cpp b/desktop-widgets/printer.cpp
index 7381b5f7f..2d1a1d258 100644
--- a/desktop-widgets/printer.cpp
+++ b/desktop-widgets/printer.cpp
@@ -41,7 +41,7 @@ void Printer::putProfileImage(QRect profilePlaceholder, QRect viewPort, QPainter
int y = profilePlaceholder.y() - viewPort.y();
// use the placeHolder and the viewPort position to calculate the relative position of the dive profile.
QRect pos(x, y, profilePlaceholder.width(), profilePlaceholder.height());
- profile->plotDive(dive, true);
+ profile->plotDive(dive, true, true);
if (!printOptions->color_selected) {
QImage image(pos.width(), pos.height(), QImage::Format_ARGB32);
@@ -204,7 +204,7 @@ void Printer::render(int Pages = 0)
prefs.animation_speed = animationOriginal;
//replot the dive after returning the settings
- profile->plotDive(0, true);
+ profile->plotDive(0, true, true);
}
//value: ranges from 0 : 100 and shows the progress of the templating engine
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index b376c6a60..5039830fc 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -357,7 +357,7 @@ void ProfileWidget2::replot(struct dive *d)
if (!replotEnabled)
return;
dataModel->clear();
- plotDive(d, true);
+ plotDive(d, true, false);
}
void ProfileWidget2::createPPGas(PartialPressureGasItem *item, int verticalColumn, color_index_t color, color_index_t colorAlert,
@@ -526,7 +526,7 @@ void ProfileWidget2::resetZoom()
}
// Currently just one dive, but the plan is to enable All of the selected dives.
-void ProfileWidget2::plotDive(struct dive *d, bool force)
+void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures)
{
static bool firstCall = true;
#ifndef SUBSURFACE_MOBILE
@@ -785,7 +785,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
DivePlannerPointsModel *model = DivePlannerPointsModel::instance();
model->deleteTemporaryPlan();
}
- if (printMode)
+ if (doClearPictures)
clearPictures();
else
plotPictures();
@@ -1525,7 +1525,7 @@ void ProfileWidget2::deleteCurrentDC()
delete_current_divecomputer();
mark_divelist_changed(true);
// we need to force it since it's likely the same dive and same dc_number - but that's a different dive computer now
- plotDive(0, true);
+ plotDive(0, true, false);
emit refreshDisplay(true);
}
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index d13ff194b..545c6475d 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -73,7 +73,7 @@ public:
ProfileWidget2(QWidget *parent = 0);
void resetZoom();
- void plotDive(struct dive *d = 0, bool force = false);
+ void plotDive(struct dive *d = 0, bool force = false, bool clearPictures = false);
void setupItem(AbstractProfilePolygonItem *item, DiveCartesianAxis *vAxis, int vData, int hData, int zValue);
void setPrintMode(bool mode, bool grayscale = false);
bool getPrintMode();