LocationInformationWidget: make sure to clean out fields

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-10-06 12:06:13 -07:00
parent 0799d046ba
commit 53b1b17f4f
2 changed files with 13 additions and 0 deletions

View file

@ -118,6 +118,16 @@ void LocationInformationWidget::updateLabels()
}
void LocationInformationWidget::clearLabels()
{
ui.diveSiteName->clear();
ui.diveSiteCountry->clear();
ui.diveSiteDescription->clear();
ui.diveSiteNotes->clear();
ui.diveSiteCoordinates->clear();
ui.locationTags->clear();
}
void LocationInformationWidget::updateGpsCoordinates()
{
QString oldText = ui.diveSiteCoordinates->text();
@ -201,6 +211,8 @@ void LocationInformationWidget::showEvent(QShowEvent *ev)
emit startFilterDiveSite(displayed_dive_site.uuid);
if (m)
m->invalidate();
} else {
clearLabels();
}
emit requestCoordinates();

View file

@ -43,6 +43,7 @@ signals:
void endRequestCoordinates();
private:
void clearLabels();
Ui::LocationInformation ui;
bool modified;
QAction *acceptAction, *rejectAction;