Dive site: give visual clue for invalid coordinates

On the dive site edit screen, when the user enters invalid
coordinates and saves, we treat this as "no location". This
is rather unfriendly, therefore warn the user with a visual
clue. This is performed by setting the background color of
the widget to red.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-02-04 10:03:41 +01:00 committed by Dirk Hohndel
parent e5487f86a6
commit cabaaa69db
2 changed files with 31 additions and 1 deletions

View file

@ -27,6 +27,7 @@ public slots:
void acceptChanges();
void on_diveSiteCountry_editingFinished();
void on_diveSiteCoordinates_editingFinished();
void on_diveSiteCoordinates_textEdited(const QString &s);
void on_diveSiteDescription_editingFinished();
void on_diveSiteName_editingFinished();
void on_diveSiteNotes_editingFinished();
@ -42,6 +43,7 @@ private slots:
private:
void keyPressEvent(QKeyEvent *e) override;
void clearLabels();
void coordinatesSetWarning(bool warn);
GPSLocationInformationModel filter_model;
dive_site *diveSite;
int64_t closeDistance; // Distance of "close" dive sites in mm