summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2015-02-11Create a new state for the MainWindow: EditDiveSiteGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Create simple class to hold the location management.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11More meaningfull names for the ui elements.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Add the ui file for the location informationGravatar Tomaz Canabrava
Just the xml file for the Ui location information. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11mainwindow.cpp: don't use ui.globePaneGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11UDDF Export: Moved equipmentused to informationbeforedive section as per ↵Gravatar Martin Long
updated spec Signed-off-by: Martin Long <martin@longhome.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11UDDF Export: Moved tankdata before samples, as expected in xsd definition.Gravatar Martin Long
Signed-off-by: Martin Long <martin@longhome.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Add option to undo deleted divesGravatar Grace Karanja
Add ability to undo deleted dives by storing a list of the deleted dives in a QUndoCommand. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Add a structure to hold undo commandsGravatar Grace Karanja
Add the undocommands.cpp / undocommands.h files, which will hold a collection of classes that will hold undo commands. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Add undo stackGravatar Grace Karanja
Add an instance of QUndoStack in the mainwindow, and add undo/redo actions in the edit menu. The QUndoStack will have a collection of QUndoCommands to process the undo and redo events. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>