Commit graph

4790 commits

Author SHA1 Message Date
Willem Ferguson
0325a42c08 User manual: Updates regarding the companion app
These adiitions and changes were made in accordance with the screenshots
provided by Venkatesh and Salvador and after managing to actually run the
companion app on my phone. Large parts of the text of this section have
been changed in accordance with the Companion V2 interface. Two graphics
were changed.

After Version 2 has stabilised, some more adaptation of the text will be
required.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-07 09:12:15 -07:00
Anton Lundin
868827f5ec Qt turns edited locations into null-strings
They aren't null pointers after you touched them, so we can't rely on
that to choose if we should use put_string or show_utf8.
show_utf8 would not print the tag if it only contains a \0 as body.

Fixes #440

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-06 15:35:39 -07:00
Anton Lundin
7c3b68e3ae Terminate the string before relying on strlen
Its a c-string we put, so it must be null-terminated.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-06 15:35:22 -07:00
Anton Lundin
7b0b5d9643 Revert "Save latitude and longitude on XML even if location not set"
This fixes the bug in #440 by accident, and introduces lots of empty
attributes and tags in the xml.

This reverts commit 6378bfd91e.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-06 15:35:08 -07:00
Dirk Hohndel
0c836ebc47 Simplify string comparison
This is based on Linus' idea on the mailing list.
Treat NULL strings and empty strings as identical.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-06 14:15:59 -07:00
Dirk Hohndel
024420a60d More multi-edit fixes
This time for values that aren't simply text.
For normal integers this is rather straight forward. For the 'when'
timestamp we simply assume that this is a shift in time.

What is still missing is consistent handling of the three fields that are
implemented as tags: tags, buddy and divemaster. We have special code for
tags that makes no sense in a multi-edit scenario. And we treat divemaster
and buddy as a single string - which kinda works but treats "Bill, Joe"
and "Joe, Bill" as different.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-06 13:59:06 -07:00
Dirk Hohndel
20595ac0d7 Last minute Beta 4
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-06 11:32:48 -07:00
Dirk Hohndel
bcf973190c Only change identical fields when editing multiple dives
This was broken when porting to Qt - we used to do this correctly in the
Gtk version.

When editing multiple dives we show the current dive to the user and allow
them to edit that and then apply those edits to all selected dives. The
way this is SUPPOSED to work is that we only change those selected dives
that had the same value for the edited field as the current_dive had for
that field.

Let's say you select ten dives. The current dive shows divemaster Joe. You
change that to divemaster Jim. Then only the selected dives that had
divemaster Joe should change to Jim. All other dives should stay
unchanged.

This seems to implement that logic.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-06 11:13:24 -07:00
Dirk Hohndel
217c82f6c4 Change EDIT_SELECTED_DIVES macro
The way this is implemented is broken in several ways.
This fixes the first issue.
For the invocations where we are in the 'WHAT' checking to see if the
value we are changing in the selected dive was previously the same as in
the current dive (which is the one shown to the user for editing), then we
need to make sure we change the current dive last, otherwise the
comparison will fail.

Of course, right now we only do this check for gps location, which is a
massive bug as far as I am concerned.

Fixes #515

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-06 09:58:27 -07:00
Dirk Hohndel
223d99f79f Change the profile redraw logic after preferences were changed
I we are showing a calculated ceiling, then we have to replot the profile
after a preferences change as the gradient factors could have changed
which might change a calculated ceiling.

Also use the rulergraph preference instead of checking the settings
directly.

Fixes #511

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 15:58:25 -07:00
Dirk Hohndel
08689b2f89 Correctly parse boolean preferences
QVariant does the right thing, regardless of whether the value is stored
as int or as string - so let's just use that instead of manually checking
for integers (and failing if the values are stored as "true" and "false").

Fixes #511

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 15:56:49 -07:00
Dirk Hohndel
7809077b33 Fix odd indentation
I need to fix this in the tool as well...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 15:56:11 -07:00
Dirk Hohndel
7b0f737f60 Make rulergraph a pref as well
I don't see a point in treating it differently from the other graphs.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 15:53:46 -07:00
Dirk Hohndel
6545855b65 Fix standard cylinder names
We need to pass the size as an integer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 14:52:13 -07:00
Dirk Hohndel
83f0aefa5c Uemis downloader: handle more corner cases
After receiving another report of the Uemis downloader failing I tried to
make it more robust when unexpected things happen. The data structures
returned by the SDA are rather convoluted and not all relationships are
fully understood.

This makes sure we don't try to parse invalid dive entries, we only read
dive entries if we actually got new divelog entries, we only read dive
sites if at least one was referenced and we use a much more patient (and
hopefully, much more robust) algorithm to figure out which dive entry
corresponds to the new divelog entries.

What a pain.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 14:36:55 -07:00
Dirk Hohndel
3063991e4e Fix bug in handling of fake SAMPLE_EVENT_PO2 events
In commit bcdd6192fe ("Show translated event names in tooltip") I was
too aggressive in replacing the checking for event names with checking for
event types. It turns out that we are abusing an existing event type in
the planner (and use a different event name to mark the difference). By
just checking for the type this now caused incorrect information to be
displayed in the info box (a simply "PO2 warning" on a Suunto D9 could
turn into a "Bailing out to OC" notice).

The correct fix is to get our own range of SAMPLE_EVENT_xxx numbers from
libdivecomputer. Once we have those, we can do this the right way. For now
we just fall back to also checking the event name (which is what I wanted
to get away from so translated names don't trip us up).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 09:32:13 -07:00
Salvador Cuñat
8de1a73669 User manual: document importing GPX files in companion app
Document the new "add" menu capabilities, partially as there are features still not
functional.
Documents the new feature with GPX files imports.
Corrects a typo.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 09:01:42 -07:00
Miika Turkia
de89aefdcd Marginal optimization of UDDF import
This speeds up Aquadivelog imports marginally by doing lookup to used
equipments only instead of all equipment ever used.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 09:00:26 -07:00
Robert C. Helling
7bcb85dd54 Add images to all dive computers and refresh profile
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 08:16:16 -07:00
Robert C. Helling
7e43a45293 Correct check for existence of DateTimeOriginal exif tag
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 08:16:16 -07:00
Dirk Hohndel
8f657ff775 Add conditional so globe.cpp builds with older versions of Marble
In commit 7f3b487c77 ("Restore the previous globe zoom level after
showing dive without GPS") I was a bit too aggressive in replacing a
deprecated API function - people still need to be able to compile against
Marble versions older than 4.10.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-04 11:37:23 -07:00
Miika Turkia
088017f67c Optimize UDDF export
Writing the samples/waypoints to UDDF export in a totally new way.
Previously the preparations for approximating waypoints was done for
every sample, now only for the events.

A few days ago it took 36 seconds for my test set of 8 dives to export
to UDDF.  This optimization round took it down from 0m4.745s to
0m0.253s.

Fixes #508

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-02 22:25:59 -07:00
Dirk Hohndel
3e17690525 Bump to Beta 3 / 4.0.98
Beta 2 didn't last long...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-01 21:30:29 -07:00
Dirk Hohndel
3364e5b490 Re-center on current dive if dive edit is canceled
If the user changes the coordinates for a dive but then cancels the dive
edit, the globe would stay at the location that was temporarily set and
not rotate back to the still active coordinates.

This fixes it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-01 21:26:18 -07:00
Dirk Hohndel
7a85b9fb27 Only change dive coordinates on double click
Apparently this only happens on Windows, but there we would change the
dive coordinates on a SINGLE click when editing a dive. With this change
we simply bail if the event isn't a double click.

Fixes #505

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-01 21:25:20 -07:00
Tomaz Canabrava
4243fcb915 Dont set coordinates when two or more dives are selected
If a trip is selected (or for other reasons more than one dive), this
would change the GPS coordinates of the whole selection which almost
certainly isn't what the user wanted.
Instead, only allow changes of the coordinates on the globe if exactly one
dive is selected.

[Dirk Hohndel: massively rewritten and extended - but I didn't want to
               simply "steal" the commit from Tomaz...
	       This now maintains the "zoom out mode" for dives without
	       GPS coordinates and deals with edits of multiple dives that
	       are initiated the "normal way" by starting to edit other
	       data as well.]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-01 15:23:33 -07:00
Dirk Hohndel
7f3b487c77 Restore the previous globe zoom level after showing dive without GPS
Thanks to commit 83c5ab5871 ("Zoom out when dive has no coords.") we
show more of the globe when displaying dives without GPS data - but that
caused us to forget the zoom level we used before and so the experience
when switching back to a dive with GPS data was disappointing.

This makes sure we track the last valid zoom level and restore it when
needed.

I also replaced the deprecated zoomView() calls with setZoom() calls.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-01 14:48:14 -07:00
Dirk Hohndel
c71d258024 Fix Uemis SDA download
Stupid typo in commit e1a1c218 broke the Uemis download.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-01 14:14:50 -07:00
Tomaz Canabrava
9fcd6b2658 A better guard for 'dive being editted'
Mouse activity on the globe should not select dives when one or more dives
are being edited. This improves the detection of that state.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-01 10:12:16 -07:00
Tomaz Canabrava
83c5ab5871 Zoom out when dive has no coords.
This patch makes the globe zoom out to show it complete when
the dive has no coordinates.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-01 09:59:07 -07:00
Dirk Hohndel
010a21fb1e ReleaseNotes.txt: mention that unused cylinders are no longer shown
See #504

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-30 22:59:24 -07:00
Miika Turkia
8a6681dc09 More import/export support info on ReleaseNotes
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-30 22:55:18 -07:00
Dirk Hohndel
2dda348bab Getting ready for 4.1 Beta 2
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-30 21:36:38 -07:00
Dirk Hohndel
04273a55e0 Fix type in German translation
This prevented the download link in the update response from working.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-30 15:59:56 -07:00
Dirk Hohndel
7797926329 Tell Qt4 that we really meant Utf8 when we said Utf8
How strange. Telling Qt4 to assume that all C strings are Utf8 apparently
isn't enough to convince tr() that the C strings we pass to it are Utf8.
You need to set that codec separately.

Fixes #503

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-30 10:39:28 -07:00
Dirk Hohndel
084c2c04db Make Subsurface with a British accent work
Our workaround for the lack of a US-English translation breaks en-GB. With
this the British version of Subsurface should work as well.

Reported-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-30 09:46:54 -07:00
Miika Turkia
1739b4879a Improve header wording for CSV export
Duration is better term than time for the length of the dive. Also
remove the repetitive word dive from some of the header fields.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-30 09:16:21 -07:00
Miika Turkia
97e9be1ba6 Add export CSV to user manual
Mention the option to export in CSV format in our user manual.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-30 09:16:01 -07:00
Dirk Hohndel
0e49e61ddc Fix test for "air" in tooltip display of gaschange
The "is_air()" test works when we have the gases in permille, but not in
percent. In that case we can just check for He == 0 and O2 == 21.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29 22:39:33 -07:00
Dirk Hohndel
bcdd6192fe Show translated event names in tooltip
In order for this to work we need to compare against the event type
instead of the event name - which makes much more sense to do, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29 22:38:55 -07:00
Dirk Hohndel
7eaa2c62c4 Explicitly include needed include file
The Q_DECLARE_TR_FUNCTIONS macro is defined in QCoreApplication, so let's
make sure that's included.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29 22:35:34 -07:00
Dirk Hohndel
8539ae6471 User manual: add latest html
This updates the rendered html file for people who build from source but
don't have asciidoc installed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29 22:09:17 -07:00
Rick Walsh
5775221a4c User manual: formatting changes
- Add hyperlinks to references to Appendices A and B in the text

- Be consistent with use of numbered lists and bullets:

-- Use numbered lists where order is important (e.g. a set of instructions)

-- Use bullets where isn't doesn't matter (e.g. a list of features)

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29 22:07:59 -07:00
Willem Ferguson
1e44fecf06 User manual: Minor updates
Minor update of manual for consistency in terminology and improved style
including the section describing the companion app. No images were affected.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29 22:06:37 -07:00
Miika Turkia
4aa7b01059 Properly identify siblings on UDDF export
UDDF export used all samples in the export when detecting previous
sample. This resulted in a very slow processing as we had to go through
massive amount of data for each event that's time was to be
approximated. The detection of previous sample was also erroneous
resulting in incorrect depth samples for the events in some occasions.
This patch should address these issues. And along with patch that
included pressure data on import this will fix the bug #499.

Well, the performance after the patch is still not stellar, but still
quite a difference with such a small change. The sample set of 8 dives
(with one event each) takes now less than 5 seconds instead of the
original 36 seconds (measured by doing the conversion with xsltproc).

Fixes #499

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29 22:02:50 -07:00
Dirk Hohndel
2c4b24112a Updated translations
I'm not the author, that's tracked on Transifex

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-29 22:01:50 -07:00
Miika Turkia
e5ce55ed6c Set minpressure from manually added cylinders
This includes minimum pressure from manually added cylinders to be taken
into account on scaling. Without this, manually added cylinders might
lead to pressure dropping below the Y axis 0 line (e.g. when first
"computerized" cylinder is 220->140 and second, manually added cylinder,
200->50 bar).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-28 14:15:08 -07:00
Linus Torvalds
4f20bb9fb2 When scrolling to dive, scroll to trip first
The behavior at startup is actually very annoying: we select the latest
dive, and expand the trip it is in, but since we use "scrollTo()" on
just the dive, and it's not initially visible, the startup will make the
first dive be at the top of the list view.

Which means that the actual _trip_ detail is not visible at all, since
it will have been scrolled off the list view entirely.

Fix this by first scrolling to the trip, and only then scrolling to the
actual dive (using the default "EnsureVisible" policy).  Obviously, if
it's a trip with lots of dives, scrolling to the dive may end up
scrolling away from the trip header again, but at least that never
happens at startup, and at that point you have to scroll away from the
trip just to show the dive.

Do this same dance when changing the dive selection (mainly noticeable
when picking dives on the globe view).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-28 12:47:15 -07:00
Dirk Hohndel
2d24779b62 Make heartrate grid less confusing
Having all the grid lines in the same color made things visually
confusing. To clean this up a little make the heartrate lines a light gray
color.

Fixes #484

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-28 12:45:42 -07:00
Dirk Hohndel
dad3c5d9db Only auto-fill coordinates for non-empty location strings
When editing the location string we try to be smart and automatically add
the correct coordinates (assuming we have a location of this name already
in the dive list). So if you return to the same dive spot you'll get the
correct coordinates by default. But this creates bogus result if we allow
an empty location to be matched, as it makes no sense to assume that all
dives without a location name were at the same coordinates.

Fixes #498

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-28 09:34:27 -07:00