Commit graph

5502 commits

Author SHA1 Message Date
Dirk Hohndel
a0a0bb5247 Add latest text strings for translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:59:18 -07:00
Dirk Hohndel
789a04bd70 Translations: get hemisphere letters translated again
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:56:46 -07:00
Dirk Hohndel
598102c351 Convert ternary "?:" into if for translation tools to work
It seems the translation tools don't like the ?: in the argument - can't
blame them. So use an explicit if clause instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:35:48 -07:00
Dirk Hohndel
138da489c8 Run convert -strip against all .png files
Just in case...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:30:43 -07:00
Sergey Starosek
9d35864eab Fix libpng warning about unrecognized profile
During Subsurface startup there are several warnings reported:
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
The reason is explained at https://wiki.archlinux.org/index.php/Libpng_errors

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:26:11 -07:00
Miika Turkia
cd4dc503fc Set proper gas type on UDDF import
Use type 25 on UDDF import when the gas mix contains some helium.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:22:33 -07:00
Willem Ferguson
004b9d72c5 Replacement figures for user manual
Replacement figures for user manual

     Here are 12 replacement figures for the user manual to bring the
figures
     in line with the current UI. This relates to the updated profile
toolbar
     and manual dive profile entry. I did not change any text of the manual.
     That will happen tomorrow evening.

     Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>

From 85413b967c02738d47f0b7779613f33cc7898c17 Mon Sep 17 00:00:00 2001
From: Willem Ferguson <willemferguson@zoology.up.ac.za>
Date: Wed, 16 Jul 2014 07:26:43 +0200
Subject: [PATCH 4/4] Replacement figures for user manual

Here are 12 replacement figures for the user manual to bring the figures
in line with the current UI. This relates to the updated profile toolbar
and manual dive profile entry. I did not change any text of the manual.
That will happen tomorrow evening.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:22:02 -07:00
Miika Turkia
796df27273 Index used cylinder properly on divelogs.de export
The wrong O2 percentage was due to not referring to the correct cylinder
but grabbing any o2 value in any cylinder. While fixing this, I noticed
that also end pressure was missing the cylinder selection, so fixing
that as well.

Fixes #626

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:21:01 -07:00
Dirk Hohndel
45acec0e25 Small update to CodingStyle document
Mention variable declarations (they should be at the beginning of code
blocks).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:16:47 -07:00
Sergey Starosek
42e8e6406b Disable DC shortcuts on closing data file
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:14:39 -07:00
Sergey Starosek
b87a602265 Suppress XML preamble in CSV export
To obey <xsl:output omit-xml-declaration="yes"/> element
one should rely on libxslt to do its job instead of writing
document himself.

Discussion on this subject can be found at
http://comments.gmane.org/gmane.comp.gnome.lib.xslt/3839

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:14:27 -07:00
Sergey Starosek
32a76671ed Fix SearchBar growing vertically on window resize
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:11:14 -07:00
Sergey Starosek
b2a3e46184 Fix layout for User Survey
- apply vertical layout to top-level dialog. This solves label clipping
- call adjustSize() on dialog to fit all labels (translated text could
  be longer than original)

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 09:11:04 -07:00
Salvador Cuñat
7eb422d988 Change in logic while aplying gps fixes to dives
We were actually searching dives which match the dowloaded position
fixes. So we're also trying to take into account if the fix is automatic
or no based on a limited amount of predefined strings (bad idea, as the
user can change in companion app settings the predefined string).
This way, in actual implementation, if program concludes that a fix has
been manually got or, simply, the user is unlucky enough to have all the
position fixes out of the dive time, find_dive_n_near() function will
pair fix and dive in an ordered way (1st fix -> 1st dive; 2nd fix -> 2nd
dive ...) which is probably erroneous, except for manual position fixes.

BTW actual implementation can't pair the same gps position with more
than one dive, which would be the case, e.g. in repetitive dives while at
anchor in the same point.

The patch changes the logic:

- Search positions for defined dives (instead of dives for defined
positions) without care if position has manually or  automatically been
set.
- Only take care of those dives that don't have a position yet.
- It makes two assumptions:
   a.- If the position fix has been taken during the dive time, is
correct. If there are more than one inside the dive time, takes the
first one (closest to the DC's reported time).
   b.- If not during diving time, the correct one is the nearest fix
before the dive begins (also the usual case if manually fixed from the
smartphone just before jump into the water). But will work too if there
is only one fix *in SAME_GROUP range* after the dive (another usual
case).
- Finally, as copy_gps_location() in dive.h is used only here, let it
take care of naming the dive if user hasn't named it yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 07:38:31 -07:00
Miika Turkia
5a34261fec Try to detect first cylinder on divelogs.de export
Most dive computers start always with the first cylinder (and if not,
they give a gas switch in the first few seconds). Trying to follow this
principle on divelogs.de export.

The bug 626 sounds like a bit different case so a sample XML log would
be needed to ensure that use case gets fixed.

See #626

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 20:46:19 -07:00
Miika Turkia
c02cc33fc8 Fix the description of test dive cylinders
It is really confusing when the size of the cylinder does not match the
description. Inconsistent data in will mean inconsistent data out and
validating that export works means I try to get consistent data out...

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 20:46:02 -07:00
Dirk Hohndel
10e66823b0 Improve handling of cylinders with identical gasmix
In reality we have no concept for handling those, yet. But the UI doesn't
prevent the user from entering multiple cylinders with the same gasmix, so
we need to help the user to get rid of them as well.

If the user attempts to remove a cylinder we check if there's a second
cylinder with the same gas. If that's the case then we can proceed and
remove the cylinder the user wants to get rid of without losing that gas
for the dive. The only tricky issue is that we need to make sure that if
we remove the first cylinder that one is actually replaced with one with
the same gas.

Fixes #622

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 20:36:49 -07:00
Dirk Hohndel
0cf55d7e39 Correctly track the 'changed' status of the equipment widgets
updateDive() cannot reset the changed status - this is called while the
dive is edited. Instead this status is reset when the user either accepts
or rejects the changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 20:36:25 -07:00
Dirk Hohndel
327ea3aca4 Dive equipment edit - fix logic for applying changes
We keep getting this wrong. First you check all selected dives that are
not the current dive, make sure the equipment was the same before the edit
and then apply the changes. Then, when you are done with ALL of them, then
you change the current dive. Otherwise you cannot compare to the 'before'
state anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 20:29:14 -07:00
Dirk Hohndel
5440d0c39f Don't ignore equipment just because the dive list is empty
This was a fun little bug. Tomaz pointed me in the right direction. The UI
restructure with the displayed_dive had another unintended side effect
here. It is not valid not to set up the widgets just because the dive_list
is empty. The displayed_dive isn't on the dive_list until it is saved - so
while the user is adding or planning a dive, we still need to show the
equipment widgets.

Fixes #614
Fixes #601

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 19:52:05 -07:00
Dirk Hohndel
3860c3eaa1 Planner: limit altitude and pressure
Oh boy, this should allow for altitude in 'ft' as well.
I set an arbitrary cutoff at 3000m (and switched things to increments of
10m for the altitude).

Fixes #629

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 17:19:49 -07:00
Tomaz Canabrava
4c8e9615e4 Remove uneeded function
This method was being unused, rip it off.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 17:05:46 -07:00
Tomaz Canabrava
e38595f684 Use QObject::tr instead of OurClasses::tr for functions
This will make more easy to move code around in the future.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 17:05:46 -07:00
Tomaz Canabrava
887f9e63c3 Save and restore Dive Planner Settings
This patch adds the code that saves and restores the dive planner
settings.

Fixes #608

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 17:05:38 -07:00
Tomaz Canabrava
a502958a66 Selects the delegate text on Cylinder edition
The text selection was not being set, bummer.

See #628

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 17:05:30 -07:00
Tomaz Canabrava
d993684fec Do not create a backup for Q_FOREACH container
Q_FOREACH will expand and already creates a copy of the
contained container, so this is just a waste of cpu cycles
and also increases a tiny bit the memory consumption.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 16:55:10 -07:00
Sergey Starosek
eaacac3217 Fix segfault in world map export
Attempting to export to write-protected file/directory results in NULL
file reference and leads to segfault when writing/closing it.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 05:48:07 -07:00
Gaetan Bisson
d652268655 Planner: Report CNS and OTU
In add_plan_to_notes(), call update_cylinder_related_info() to compute
CNS and OTU data for the planned dive. Report their values in the notes.

Besides CNS and OTU, update_cylinder_related_info() also recomputes the
SAC, which is harmless. Note that both dive->cns and dive->maxcns need
to be zeroed out for the CNS value to actually be recomputed.

Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 04:05:53 -07:00
Dirk Hohndel
dff92f188a Planner: don't allow the user to remove the last point
This causes all kinds of assumptions to go wrong - and it makes no sense.
Move the point to where you want it or cancel the plan.

Fixes #623

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 03:33:48 -07:00
Dirk Hohndel
133e104393 Planner: when adding new waypoint at the end, use previous gas
In commit b0da8c2707 ("When adding a waypoint, use the gasmix of the
_next_ waypoint.") we default to air when adding a waypoint at the end of
the plan by double-clicking. That seems silly since we could instead
continue using the last gas.

I wasn't able to reproduce the "gas list disappears" problem in bug #623,
but I did get a silly air segment added which was equally wrong. Maybe I'm
lucky and this fixes the problem that Henrik sees as well...

See #623

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 03:20:23 -07:00
Dirk Hohndel
4eec911d3a Planner: even with broken plans, don't divide by 0
This fixes the crash in #623, but not the other oddities.

See #623

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 03:14:15 -07:00
Dirk Hohndel
95dbfc22ac Try to avoid inconsistent selection state after divecomputer download
I cannot reproduce the problem, but adding one more call to
unselectDives() should ensure that all dives are marked as not selected
before selecting the last dive that was downloaded.

See #620

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 21:44:57 -07:00
Lakshman Anumolu
74bfa1b170 Shrink YAxis when heart rate is on display
This patch makes sure that YAxis is not expanded to cover heart rate
when it is displayed on profile panel.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 21:38:34 -07:00
Miika Turkia
3bbac30c1b Terminate named character references properly
&nbsp; must be terminated with semicolon, just like any other named
character reference

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 21:38:22 -07:00
Miika Turkia
5723cfc1d0 Removing extra commas from array initialization
Comma should be used on array initialization only between elements, not
at the end.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 21:38:22 -07:00
Miika Turkia
a50631e026 Fix string continuation
Concatenated string should have the plus sign at the end of the cut
line.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 21:38:22 -07:00
Miika Turkia
db43fbbe8a HTML: prevent implicit type conversion on testing
== and != comparison of true, false, null, allows implicit type
conversion, thus using === and !== instead

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 21:38:22 -07:00
Gehad elrobey
6f05194b02 HTML: Add dive photos to the detailed view
Dive photos are copied to the photos directory on export. The photos
section appears only if photos exist.

C++ helper functions are added to copy images to the photos directory,
Additionally the photos directory must be passed as a parameter to the
write_one_dive function to save photos to it. Some options structure may
be needed instead of passing many arguments.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 21:38:22 -07:00
Gehad elrobey
346f71f262 HTML: display dive status in detailed view
Add dive status in the detailed dive view.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 21:38:22 -07:00
Dirk Hohndel
6a5dcb4859 Remove warning about undeclared menuFilter
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 18:43:42 -07:00
Anton Lundin
4cea594655 usersurvey: Add : for consistency
All the other statements there had : in them.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 18:42:10 -07:00
Anton Lundin
0fbfccd31a profile2: remove unused varable diveComputer
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 18:33:57 -07:00
Anton Lundin
64d7c5c042 Remove unused menu "Filter"
The filter menu wasn't connected to anything other than a debug print.
This removes that menu.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-14 18:33:54 -07:00
Miika Turkia
c43708bc8e Remove theme directory when uninstalling on Windows
I assume the theme directory should be deleted on uninstall the same way
e.g. Documentation directory is deleted.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-13 21:39:42 -07:00
Miika Turkia
9775750cf5 Change default export tab to "General export"
I prefer that we show the first tab by default. Everyone should remember
that Qt Creator changes the currently shown tab as default on save.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-13 21:39:33 -07:00
Miika Turkia
4986853113 Typo fix Ave. => Avg.
Fixes #619

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-13 21:39:25 -07:00
Miika Turkia
ebdc8744fc Add tooltip for toggle pictures
Fixes #618

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-13 21:39:18 -07:00
Dirk Hohndel
93e873f06a Pull latest translations for the beta
As always, authorship is tracked at transifex.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12 21:46:59 -07:00
Dirk Hohndel
c983dc0c75 Preparing for Beta 1
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12 21:09:32 -07:00
Dirk Hohndel
74616cdddf Rename event: correctly replace event with new one
I don't like that the event structure includes the variable length array.
That really makes it a pain to change the name of an event (on the flip
side, freeing events is easier I guess).

Anyway, to correctly rename an event we need to actually remove the event
from the correct dc and then add a new event with the new name. The
previous code was insane (it only worked if the new name was of smaller or
equal length, otherwise it had a beautiful buffer overflow).

And of course we need to do this both for the current_dive and the
displayed_dive.

Fixes #616

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-12 12:56:03 -07:00