summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-06-26Dive site rewrite: better member nameGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: fix double freeGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: try to fix a crashGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: copy the current dive to the displayed diveGravatar Tomaz Canabrava
This way we can actually edit something. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: fill and change the current dive siteGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: correctly position the edit site widgetGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: create a dive site edit dialog without bordersGravatar Tomaz Canabrava
Plan is to make it pretty later. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: remove a ton of code from the LocationManagementGravatar Tomaz Canabrava
The way I was doing the old location management was very dull: everything was tangled on the mainwindow. Now I think I've found the correct way to create this, and thus, this code can die. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: change add icon to editGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: add the taxonomy labels for the dive sitesGravatar Tomaz Canabrava
This doesn't work yet because we don't get the taxonomy from the geo referencing services yet - but it's ready to be populated. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: use a QCompleter to show the list of dive sitesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: location edit on notes tab is again a LineEditGravatar Tomaz Canabrava
Hopefully we now have the UI semantics figured out. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Implement planner option to switch only at required stopsGravatar Rick Walsh
When option is enabled, if a stop is not otherwise required, a gas switch will be delayed until a stop is reached. This option is ignored if the current gas is hypoxic. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Add only switch at required stop optionGravatar Rick Walsh
Add the option to only switch at required stop to the planner UI. This is not actually used yet. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Define gaschange_before and gaschange_after a few lines earlierGravatar Rick Walsh
This is required so they work in the test for /* do we want to skip this leg as it is devoid of anything useful? */ We were already trying to use gaschange_after (and previously gaschange), but it was duplicating an existing condition (now removed). Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-25Don't show datafile version warning if no file was openedGravatar Dirk Hohndel
Also remove most of the hard new lines in the text so it flows better depending on the font size used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-25Use strtoul to parse unsigned valuesGravatar Dirk Hohndel
Otherwise reading in the dive site uuids will break on 32bit machines (as all values >= 0x80000000 will be truncated to LONG_MAX). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-25Use our membuffer infrastructure to assemble stringGravatar Dirk Hohndel
We should use this consistently throughout the code instead of manually assembling strings and messing with memory all over the place. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-24Rewrite GPS fix matching code for imports from our webserviceGravatar Dirk Hohndel
The longer I stared at the existing code the less it made sense. So instead I rewrote it in a way that seems logical to me. And added a boatload of debugging output (which needs to be removed, of course). I tested this against more than a hundred dives and it seemed to always pick the right fix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-24Uemis downloader: create the req.txt file if it went missingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-23Fix gaschange_after definitionGravatar Rick Walsh
Previously gaschange_after was never being set back to false. Now it will be. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Fix helper functionGravatar Dirk Hohndel
Avoid counting the selected dives - we have that number. But also don't return 0 because we devide by the total work for the progress bar. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Avoid possible use of uninitialized variableGravatar Dirk Hohndel
Errorcode doesn't get set if duppedfd is negative. So let's just issue an error and bail. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Refactor to use gaschage_before and gaschange_afterGravatar Robert C. Helling
... for better readability. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22When displaying transitions show the gaschange at the stop if there is oneGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Planner notes - revise logic for gasmix outputGravatar Rick Walsh
The logic for when to output a gasmix in the notes table is more complicated than it seems at first. - On a descent leg, the gas is the gas used for descent - At a stop (calculated or user defined), the gas is the gas used for that stop - But on an ascent leg (if displayed), the gas is the gas that is ABOUT TO BE USED - The gas should not be repeated if it's the same gas as used on the last row of the table - Ascent legs should only be displayed if the display transitions option is selected, OR if there is a gas change without a stop (the user can now set a minimum duration for a gaschange, but zero is still allowed). The existing code tries to track what gas is being used/switched to at each waypoint, and whether the gas should be printed or postponed to the next leg. It works sometimes but not always. This patch replaces the postponed gas logic with: - Is this an ascent leg? (determines whether the applicable gas is the preceding or following leg, and whether the leg should be displayed at all if the transitions option isn't selected) - Is it an ascent with a gaschange without a stop? - Has the gas actually changed from the last output? - Will the next leg be at the same level and same gas (in which case merge them)? Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Preferences infrastructure for GeoManagementGravatar Tomaz Canabrava
Simple preferences infrastructure with default prefs, prefs and hooks for the Qt Settings system and our preferences ui. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Defaults for the Preferences dialog for GeoCodingGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Add model to populate the Preferences for GeoRefGravatar Tomaz Canabrava
Simple model that list the options for GeoRef. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Add configuration options for geo codingGravatar Tomaz Canabrava
Just the interface changes for configuration options for geo coding. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Show warning if user loads an old datafileGravatar Tomaz Canabrava
Show the user a warning if he opens an old version of the divelog file, the warning tries to explain some things that are different on the new version. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Do not mess with dive location automaticallyGravatar Tomaz Canabrava
This might be what the user wanted, but also might not be it. So wait for the user to request it manually. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Create layout on parent, not on items around itGravatar Tomaz Canabrava
Correctly handles resizing of interface items by creating the layout on the parent instead of selecting the items and applying the layout around them. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22do not set default sizes for expandersGravatar Tomaz Canabrava
This was creating a lot of empty spaces on the preferences dialog and making Dirk unhappy. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Cloud storage: update File menu options once PIN is verifiedGravatar Dirk Hohndel
The code didn't trigger the update routine after PIN verification, only if just email/password were shown. A simple oversight. This is fixed now and so the visibility of cloud open and cloud save options should refelect whether verified credentials are in the preferences or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Prevent potential division by zeroGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Prevent null pointer dereferenceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Better error handlingGravatar Dirk Hohndel
Most of these will likely have no big impact, but it's better not to just ignore them as they could lead to crashes. Uemis downloader: if lseek fails, return 0 Uemis downloader: consistently check for failure to open req.txt Zip file handling: dup could fail Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Address of array is always non-NULLGravatar Dirk Hohndel
We want to test the string instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Address uninitialized member warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Cloud storage: correctly store pictures even if they weren't shown beforeGravatar Dirk Hohndel
We could end up in a situation where the hash for a picture hadn't been recorded yet and then the lookup to make sure that we find the correct file actually got us nothing. Now we make sure that the picture is in the hash table before looking up the file location and before creating the name of the blob that we store in git. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Preferences: don't show error when resetting cloud email / passwordGravatar Dirk Hohndel
Empty values won't work, of course, but they aren't an error, either. Fixes #887 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Initialize membersGravatar Dirk Hohndel
Globe: initialize doubleClick member ShiftTimesDialog: initialize when (not sure this could be a problem) SetpointDialog: dc could be uninitialized or could be 0 and dereferenced Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Uemis downloader: open returns -1 on errorGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Prevent unintended integer divisionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Comparing the address of a member to 0 is pointlessGravatar Dirk Hohndel
Or... this code doesn't do what you think it does. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Fix missing curly braces that change control flowGravatar Dirk Hohndel
Indentation thankfully is not the same as scope. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21OSTC tools: prevent unknown dc familyGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Prevent null dereferenceGravatar Dirk Hohndel
In each case there are scenarios where we would have dereferenced NULL. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Prevent possible null pointer dereferenceGravatar Dirk Hohndel
Neither of these functions should ever be called with dc == NULL. But it's easy to prevent the potential crash. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>