diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/simplewidgets.cpp | 24 | ||||
-rw-r--r-- | qt-ui/simplewidgets.h | 1 |
2 files changed, 19 insertions, 6 deletions
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index 4276e6151..cbc570e97 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -698,12 +698,20 @@ void LocationInformationWidget::setLocationId(uint32_t uuid) displayed_dive_site = *currentDs; if (displayed_dive_site.name) ui.diveSiteName->setText(displayed_dive_site.name); + else + ui.diveSiteName->clear(); if (displayed_dive_site.description) ui.diveSiteDescription->setText(displayed_dive_site.description); + else + ui.diveSiteDescription->clear(); if (displayed_dive_site.notes) ui.diveSiteNotes->setPlainText(displayed_dive_site.notes); + else + ui.diveSiteNotes->clear(); if (displayed_dive_site.latitude.udeg || displayed_dive_site.longitude.udeg) ui.diveSiteCoordinates->setText(printGPSCoords(displayed_dive_site.latitude.udeg, displayed_dive_site.longitude.udeg)); + else + ui.diveSiteCoordinates->clear(); } void LocationInformationWidget::updateGpsCoordinates() @@ -740,9 +748,7 @@ void LocationInformationWidget::acceptChanges() setLocationId(currentDs->uuid); } mark_divelist_changed(true); - resetPallete(); - ui.diveSiteNotes->hide(); - MainWindow::instance()->setEnabledToolbar(true); + resetState(); emit informationManagementEnded(); } @@ -756,9 +762,7 @@ void LocationInformationWidget::rejectChanges() } else { setLocationId(currentDs->uuid); } - resetPallete(); - ui.diveSiteNotes->hide(); - MainWindow::instance()->setEnabledToolbar(true); + resetState(); emit informationManagementEnded(); } @@ -778,6 +782,14 @@ void LocationInformationWidget::markChangedWidget(QWidget *w) modified = true; } +void LocationInformationWidget::resetState() +{ + modified = false; + resetPallete(); + ui.diveSiteMessage->hide(); + MainWindow::instance()->setEnabledToolbar(true); +} + void LocationInformationWidget::enableEdition() { MainWindow::instance()->dive_list()->setEnabled(false); diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h index d86fefd70..613fb6480 100644 --- a/qt-ui/simplewidgets.h +++ b/qt-ui/simplewidgets.h @@ -232,6 +232,7 @@ public slots: void updateGpsCoordinates(void); void markChangedWidget(QWidget *w); void enableEdition(); + void resetState(); void resetPallete(); void on_diveSiteCoordinates_textChanged(const QString& text); |