This adds support for importing individual O2 sensors from a CSV file,
e.g. an APD log viewer file.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Designer is such an utter piece of crap I am at a lack for words.
After a few hours with a real UI tool (i.e., vim) I have the preferences
dialog reasonably close to where I want it. It's still not perfect, but at
least it no longer contains tons of unused space, it fits fine on a
1024x768 screen and it is visually consistent across the different pages.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In subsurface we store no value as a NULL pointer everywhere, but
sometimes some structures returns a empty field as a empty string.
This teaches our helper copy_string to return NULL if you try to copy a
empty string.
This fixes a bug where we store buddy and divemaster in git as empty
strings if they passed via MainTab::saveTaggedStrings().
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We start out with our default. If we zoom out because of no GPS data, we
remember the now current zoom value, but only if we aren't in the middle
of a "flight". If we are in the middle of a flight we simply keep the last
value we remembered - that means we might forget a user made change, but
at least we won't suddenly remember a random number as our zoom value.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
No point in remembering the "current" zoom while we are flying to a new
position. Also make sure you remember things before we start a new flight.
Finally, set the radius to 1000 which is what Marble recommends for a zoom
that shows the whole globe.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't erase the trip information after the user started editing it.
Don't act as if a dive was edited - it's trip information we are
modifying.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I had to create an event filter to deal with the missing callbacks from
QPlainTextEdit (it doesn't support editingFinished()).
Also we need to manually create a dive site on a newly added dive if the
user entered one.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>