prepare_dives_for_divelogs() is based on GTK / C code
where we used GLib methods to generate a temp zip file.
Qt has QTemporaryFile, but it seems there is some sort
of a problem when using with with zip_open
(ZIP_CREATE considered) or at least in this particular case.
To workaround that, we generate a random name ourself with qrand()
and simply pass it to zip_open (with ZIP_CREATE) and then return
the filename.
Also (!), there is memory corruption when trying to return
'tempfile'. This wasn't the case with the C compiler,
to my knowledge. Regardless of this fact the generated
zip does not look corrupt.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
prepare_dives_for_divelogs() comes from the GTK version, originally.
The upload seems to fail at this point with an error.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This patch adds commands to the dialog buttons, to apply
(and possibly show an error if 'parse_file' fails',
reject, or show help - which is a link to the 'divelogs.de'
website.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Updates summary of main menu entries to those in the new GUI
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is so we can default to the GF's from the preferences. We need the
bail handler in createTemporaryPlan, because its triggered when we
change GF's, and if we don't have a stagingDive there, we will access a
NULL-pointer.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When got auto-rescaling of the depth scale, always reset the depth scale
to what the profile would suggest. This introduces a concept of user
requested minimum witch we will update and not scale down to lower than.
Reported-by: Henrik Brautaset Aronsen <henrik@synth.no>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When switching between metric and imperial, we should also show that the
different units are switching too. This signals the greyed out
radio buttons to switch to the right system.
Fixes#347
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The groupBox-es got renamed, and thus the unit-systems radio-buttons
was enabling/disabling the wrong buttons.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As pointed out in commit 23ce727 by Dirk and remembered Jan, there are different
meanings for EAD and END depending on organisations. Let's explain a bit the one
Subsurface has choosen, as this is confusing, even while translating the acronyms.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we start to define a gas, we should use that one by default instead
of air.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The code would have leaved gasidx undefined if it doesn't find a correct
gas, so this asserts instead of using uninitialized variables as array
index.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Makefile changes were authored by Dirk, the CSS is based on a public
domain CSS file and authored by Willem
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Silly mistake in commit 93b5c0cd14 ("Finish download from divelogs.de"):
parse_file() doesn't call process_dives() - the caller needs to do that.
Fixes#344
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When removing the selected dives from their trips, it makes no sense to
check if the pointer was actually pointing at a valid dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On Windows platform translation/ folder contains Qt translation
files as well. This results in extra languages in preferences.
From now we filter these translations and choose only those matching
^subsurface_*.qm$
Fixes#339
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show language instead of country, sort the list.
Show country in brackets to avoid ambiguity for locales like
de_DE and de_CH.
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Left to do is to remove all the auto-added deco-points, aka the ones
that had entered==FALSE before we created a dive from the plan.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It previously always started with o2 in air, now we start with 0 as its
the same default as in the cylinders too, which fixes a uninitialized
index there too.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The previous code checked against the current depth to find the next
deco stop, not the ceiling we actually should head for.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the scale is too big or too small, adapt the scale automatically.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
this is probably more a workaround than a proper fix to a problem which
I think only happens if started with no dive loaded and then create one.
in that case, deselect_dive is called after saving the dive but probalby
before it was added to the dive list properly resulting in an underflow
of amount_selected.
Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
otherwise the previous selected dive is still visible in the profile
view. clicking on edit crashs subsurface: null pointer dereference in
editCurrentDive as it uses 'current_dive' which is null.
Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use proper case and subscripts for gas names on profile legend.
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Small updates to README, ReleaseNotes.txt and a bump in the version number
in the Makefile (forgot the in 3.9.1 - thankfully this is automatic for
git based builds).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Telling Qt that the "Preferences" menu entry is
QAction::PreferencesRole will make it be moved to the System menu on
Mac, for example.
Fixes#327
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Install the Documentation and include it in the installer.
Try and get all the directories and files removed in the uninstaller.
Where the heck does 'oldshare' come from?
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Minor oversight in commit 917b47b79c ("Parse localized GPS string") - we
accepted the translated hemisphere indicators in the regular expression,
but then didn't use them later when comparing with the result of applying
the regular expression.
Fixes#331
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I thought I had this fixed, but a silly thinko broke my fix.
Only abort the saving if both air AND water temperature are already
covered by the divecomputer(s) in a dive. If at least one of them is
different, then create a divetemperature tag and fill in that value at the
dive level.
Fixes#313
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is far from perfect.
Avoid a weird warning when total = -1 is passed into the progress bar.
Enable the Accept button once the download completes.
Merge the downloaded dives into the existing dive list on Apply.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>