mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix edit & show of divesites for new and existing dives.
The UI detects when it should refresh the loction after the user finished editting a divesite. Creating and editting divesites is now working even when the current dive is not saved yet. Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
954c30c4cf
commit
d22a135343
6 changed files with 43 additions and 13 deletions
13
divesite.c
13
divesite.c
|
|
@ -182,6 +182,19 @@ uint32_t create_dive_site(const char *name, timestamp_t divetime)
|
|||
return uuid;
|
||||
}
|
||||
|
||||
/* same as before, but with current time if no current_dive is present */
|
||||
uint32_t create_dive_site_from_current_dive(const char *name)
|
||||
{
|
||||
if (current_dive != NULL) {
|
||||
return create_dive_site(name, current_dive->when);
|
||||
} else {
|
||||
timestamp_t when;
|
||||
time_t now = time(0);
|
||||
when = utc_mktime(localtime(&now));
|
||||
return create_dive_site(name, when);
|
||||
}
|
||||
}
|
||||
|
||||
/* same as before, but with GPS data */
|
||||
uint32_t create_dive_site_with_gps(const char *name, degrees_t latitude, degrees_t longitude, timestamp_t divetime)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue