From 500c4c2772ef2c569e9f559d8b22ec39febc4b41 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 9 Mar 2015 15:55:49 -0300 Subject: [PATCH] Clear after accepting / rejecting the LocationEdit Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/simplewidgets.cpp | 13 +++++++++++++ qt-ui/simplewidgets.h | 1 + 2 files changed, 14 insertions(+) diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index e1ad6b861..08e6f1d41 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -740,6 +740,8 @@ void LocationInformationWidget::acceptChanges() setLocationId(currentDs->uuid); } mark_divelist_changed(true); + resetPallete(); + ui.diveSiteNotes->hide(); emit informationManagementEnded(); } @@ -753,6 +755,8 @@ void LocationInformationWidget::rejectChanges() } else { setLocationId(currentDs->uuid); } + resetPallete(); + ui.diveSiteNotes->hide(); emit informationManagementEnded(); } @@ -800,3 +804,12 @@ void LocationInformationWidget::on_diveSiteNotes_textChanged() if (!same_string(qPrintable(ui.diveSiteNotes->toPlainText()), currentDs->notes)) markChangedWidget(ui.diveSiteNotes); } + +void LocationInformationWidget::resetPallete() +{ + QPalette p; + ui.diveSiteCoordinates->setPalette(p); + ui.diveSiteDescription->setPalette(p); + ui.diveSiteName->setPalette(p); + ui.diveSiteNotes->setPalette(p); +} diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h index f90e5bc69..d86fefd70 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 resetPallete(); void on_diveSiteCoordinates_textChanged(const QString& text); void on_diveSiteDescription_textChanged(const QString& text);