mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Save the gps edit into the current dive_site
The accept method didn't save the gps edit even if we put correct text on it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f8b64da136
commit
c13e5d069c
2 changed files with 9 additions and 3 deletions
|
@ -86,11 +86,17 @@ void LocationInformationWidget::acceptChanges()
|
||||||
free(currentDs->notes);
|
free(currentDs->notes);
|
||||||
currentDs->notes = copy_string(uiString);
|
currentDs->notes = copy_string(uiString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ui.diveSiteCoordinates->text().isEmpty()) {
|
||||||
|
double lat, lon;
|
||||||
|
parseGpsText(ui.diveSiteCoordinates->text(), &lat, &lon);
|
||||||
|
currentDs->latitude.udeg = lat * 1000000.0;
|
||||||
|
currentDs->longitude.udeg = lon * 1000000.0;
|
||||||
|
}
|
||||||
if (dive_site_is_empty(currentDs)) {
|
if (dive_site_is_empty(currentDs)) {
|
||||||
LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs));
|
LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs));
|
||||||
displayed_dive.dive_site_uuid = 0;
|
displayed_dive.dive_site_uuid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mark_divelist_changed(true);
|
mark_divelist_changed(true);
|
||||||
resetState();
|
resetState();
|
||||||
emit endRequestCoordinates();
|
emit endRequestCoordinates();
|
||||||
|
@ -148,8 +154,6 @@ void LocationInformationWidget::enableEdition()
|
||||||
ui.diveSiteMessage->setText(tr("You are editing a dive site"));
|
ui.diveSiteMessage->setText(tr("You are editing a dive site"));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool parseGpsText(const QString &gps_text, double *latitude, double *longitude);
|
|
||||||
|
|
||||||
void LocationInformationWidget::on_diveSiteCoordinates_textChanged(const QString& text)
|
void LocationInformationWidget::on_diveSiteCoordinates_textChanged(const QString& text)
|
||||||
{
|
{
|
||||||
uint lat = displayed_dive_site.latitude.udeg;
|
uint lat = displayed_dive_site.latitude.udeg;
|
||||||
|
|
|
@ -35,4 +35,6 @@ volume_t string_to_volume(const char *str, pressure_t workp);
|
||||||
fraction_t string_to_fraction(const char *str);
|
fraction_t string_to_fraction(const char *str);
|
||||||
int getCloudURL(QString &filename);
|
int getCloudURL(QString &filename);
|
||||||
void loadPreferences();
|
void loadPreferences();
|
||||||
|
bool parseGpsText(const QString &gps_text, double *latitude, double *longitude);
|
||||||
|
|
||||||
#endif // QTHELPER_H
|
#endif // QTHELPER_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue