Add refreshProfile member function to MainWindow class

While the whole idea of calling these functions through the MainWindow
instance is atrocious, until we change the architecture of all this
refreshProfile() is a useful function to have.

In order to make this cleaner to implement I allowed an argument to
ProfileWidget's replot() which allows picking a specific dive. By
defaulting this to 0 we get the previous behavior when calling replot()
without an argument.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-09-22 19:55:48 -07:00
parent a761a33069
commit aeac5fcb6d
4 changed files with 12 additions and 7 deletions

View file

@ -342,12 +342,12 @@ void ProfileWidget2::setupItemOnScene()
replotEnabled = true;
}
void ProfileWidget2::replot()
void ProfileWidget2::replot(struct dive *d)
{
if (!replotEnabled)
return;
dataModel->clear();
plotDive(0, true); // simply plot the displayed_dive again
plotDive(d, true);
}
void ProfileWidget2::setupItemSizes()