summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-02-13Add helper function to detect empty dive sitesGravatar Dirk Hohndel
No point in keeping those. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Make sure there is a dive site if you try to edit itGravatar Dirk Hohndel
If the user clicks on manage (or double clicks on the globe) and the displayed_dive doesn't actually have a dive site associated with it (e.g. because we are adding a dive or because it was imported or downloaded without dive site information, then we need to make sure that there is an empty dive site that we can make changes to. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13When adding / planning a dive, reset the dive site manage screenGravatar Dirk Hohndel
Otherwise old data is still shown if the user clicks manage. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Fix crash when adding a diveGravatar Dirk Hohndel
If a dive has no dive_site_uuid we would dereference a NULL pointer and crash. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Always print dive site uuids as 8 digits / leading 0s in git formatGravatar Dirk Hohndel
Otherwise there are ugly spaces in the file names. This didn't break anything, per se, it's mostly cosmetic. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Don't force the first divecomputer to CCR just because there's po2 valueGravatar Dirk Hohndel
The existing code was bogus as it used cur_dive->dc instead of cur_dc (i.e., it always changed the first dive computer, even if the po2 was found in a different one). But fundamentally I consider this bogus. We are not doing the right thing here - some dive computer send us pO2 values that are just the calculated pO2 at a depth and NOT a setpoint, yet we pretend those are setpoints and then turn these dives into CCR dives. This needs to done differently. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13More useful debug printsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Fix compile time warningGravatar Dirk Hohndel
No idea why designer sometimes adds these zorder items. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Allow editing of dive sitesGravatar Dirk Hohndel
And hook things up when double clicking the globe. The user experience isn't consistent with what we do on the main tab (i.e., no coloring of fields that are changed), but it seems to work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Finally remove location, latitude and longitude from struct diveGravatar Dirk Hohndel
With this all references to these members should be gone and all the code should be switched over to the dive site infrastructure. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Adapt GPS coordinate download from our companion app to dive sitesGravatar Dirk Hohndel
This is a bit awkward now. We are downloading what looks like fake dives in the v2 format. So we create a dive site for every single fix. After we merge those new dive sites into the existing dives we need to throw away all the dive sites that weren't used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13maintab change for get_dive_site_uuid_by_nameGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Add another helper funtionGravatar Dirk Hohndel
We need to be able to get rid of dive sites as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Improve dive site creation from v2 git storageGravatar Dirk Hohndel
Fix broken helper function, move helper functions into the .c file (there really wasn't a good reason for these to be inline), fix the logic that decides if we want to create a new dive site or use an existing one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Improve parsing of older XML files in order to auto create dive sitesGravatar Dirk Hohndel
While the existing code worked with a couple of hand crafted examples it turns out it did a poor job with most of my files. Oops. Depending on whether we find name or coordinates first, we need to identify existing sites in either case and do the right thing. The challeng here are multiple dives at the same site with slightly different GPS coordinates. If the name is read first, these all get merged into one (and we warn about the different GPS data). But if GPS gets read first, we create separate dive sites with the same name. We need a sane UI to consolidate these - but we can't completely automate this... it's possible that these ARE the same site and the GPS data is just imprecise (for example, multiple dives at the same time with GPS locations from the Subsurface companion app). The user should be able to either pick one of the GPS locations, or keep multiple (for example, different buoyes for the same site and you want to keep the different markers). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Make special backup when switching XML versionsGravatar Dirk Hohndel
Since the last few dozen commits change the format in irreversible ways and could therefore be destructive and lose data for testers of the development version, let's try to be extra careful and create "special" backup files that aren't overwritten by subsequent backups. At least this way people can go back to the previous state. Of course people using the git backend don't have to worry about this as they always can go back to any earlier save. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Get location from dive site for git commit messageGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Get location for Facebook from dive siteGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Get location from dive site for printingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Remove coordinates from main tabGravatar Dirk Hohndel
It seems to make sense to only have them on the dive site screen. For the main UI they were redundant (we have the map) and not all that useful. The only time people would want them is if they wanted to manually add GPS coordinates for a dive, but that should now be done via the dive site UI. There are a couple of FIXMEs in the code and a few code blocks that have been commented out as they will be needed in one form or another once this GPS handling is done on the dive site UI, which right now it is NOT. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Make filters work with dive sitesGravatar Dirk Hohndel
This simply tracks the names - if we have multiple dives sites with the same name but different other data (e.g. different GPS), we could easily get this right (well, somewhat easily, it's a UI question), but for that we'd have to filter for dive site uuid instead of for dive location name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Change UEMIS infrastructure to use dive sitesGravatar Dirk Hohndel
Which is actually much more natural to the way the UEMIS stores things... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Fix remaining gps references when parsing XML filesGravatar Dirk Hohndel
Clearly I didn't run into these before in my testing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Change one more spot in divelist.c from locations to dive sitesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Change from locations to dive sites in save-html and worldmapGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Switch from locations to dive sites in liquivision codeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Switch components for cut/paste dive to dive site logicGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Switch from locations to dive sites in dive.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Show dive site name in dive listGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Get trip location from dive's dive siteGravatar Dirk Hohndel
This adds another useful helper function as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Fix dive site creation from v2 git storageGravatar Dirk Hohndel
Clearly didn't test that part well enough. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Don't ever create a dive site without valid uuidGravatar Dirk Hohndel
If you want a specific one, you can always overwrite it, but a dive site with a uuid of 0 breaks some of our assumptions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Correctly connect the maintab to dive site managementGravatar Dirk Hohndel
We now have a working uuid - use it. And populate the fields accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Make editing a location work with dive sitesGravatar Dirk Hohndel
Not sure if this is the final implementation, but at least for simple cases it works now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Improve helper functionsGravatar Dirk Hohndel
Sometimes we want to create a dive site just based on a name, sometimes we have both a name and GPS coordinates. Let's make a helper for either case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Clear the location if we have no dive siteGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Update completion model for dive site namesGravatar Dirk Hohndel
This way the drop down works again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Another helper: for_each_dive_site()Gravatar Dirk Hohndel
This doesn't make the code necessarily more compact, but easier to read and is consistent with our other patterns. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Show dive coordinates on map based on dive siteGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Show GPS coordinates based on dive site on MainTabGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Show location based on dive site on MainTabGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Save and load dive sites in git formatGravatar Dirk Hohndel
Update the version to 3. Continue to read version 2 files and create dive sites on the fly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Save and parse dive site structures to XMLGravatar Dirk Hohndel
Read and write divesite sections in the XML file. Read divelogs of version 2 and create dive site structures on the fly. Read version 3 files that have divesiteid instead of location / gps. Saves version 3 files where dives no longer have location and gps but instead refer to a divesiteid The commit contains quite a few fprintf(stderr,...) in order to allow better monitoring of the parsing / transforming of locations and gps to dive sites. This will need to be removed later. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Some dive site helper functionsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12Add dive site data structureGravatar Dirk Hohndel
This leaves location and gps coordinates in the struct dive to allow a step by step migration. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Remove redundant functionGravatar Dirk Hohndel
We had two functions doing exactly the same thing. Let's drop the one with the highly confusing name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Pass a fake dive site UUID to the callback.Gravatar Tomaz Canabrava
This is the start of the preparations to edit the dive site, passing a uuid so we can retrieve it later. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Copy the name and the coords when entering the EditDiveSite stateGravatar Tomaz Canabrava
Name and coords of the current dive are copied to the edit dive site screen. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Accept / Cancel location editGravatar Tomaz Canabrava
Make it possible to cancel or accept the location edit and get back to the mainwindow default state. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Enable the location edit widget on mainwindowGravatar Tomaz Canabrava
Clicking on the 'Manage' button now brings you to the widget to manage it. Nothing has been added on it yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>