Reset state: have a correct dive site being displayed

I'm not sure if this is the right approach, but it seems to work: when we
reset the state of the widget, we try to get the current dive site from
the current dive, and set it.

This way it will work for the globe later.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-06-04 00:21:16 -03:00 committed by Dirk Hohndel
parent 3561d34745
commit db333226d9

View file

@ -144,6 +144,12 @@ void LocationInformationWidget::markChangedWidget(QWidget *w)
void LocationInformationWidget::resetState()
{
if (displayed_dive.id) {
struct dive_site *ds = get_dive_site_by_uuid(displayed_dive.dive_site_uuid);
if(ds) {
displayed_dive_site = *ds;
}
}
modified = false;
resetPallete();
MainWindow::instance()->dive_list()->setEnabled(true);