Use term cylinder not tank to be consistant.

The terms tank and cylinder are used interchangably both in
diving and in the code, but in the UI we should be consistant in
what we display to the user.

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make compute waypoints content uneditable

Currently user can edit content in compute waypoints table
(in PLAN mode), ofcourse this does not trigger any calculations in
the code, but user cannot see the content he needs to see after edit.
This patch makes the content uneditable.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add missing REMOVE slot

Model derived from tableview is expected to have remove slot,
which is missing in DivePlannerDisplay currently. This patch fixes
the annoying warning message while starting Subsurface because of
not including remove slot.

Currently there is lot of work to do, that either requires modifying
the model to skip 'remove' slot or find a way to make them inactive.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make divelist header corrections Mac specific

The +10 pixels fix was introduced to fix some layout issue on Mac ways
back, but it breaks things on Android. This makes sure this only gets
applied when build for mac.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add "Check for updates" Feature

This patch adds a check for updates feature.

It connects to http://subsurface.hohndel.org/updatecheck.html to check for
any new versions. It then prompts the user with a download link if an
update is available.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update manager: report Linux separately

I know the plan is to do much better OS detection - but at least Linux in
general should be called out and not be treated as "unknown".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only create UpdateManager once it is needed

Instead of unconditionally creating the object at program start let's
create it the first time we need it. That should avoid adding more and
more delays at program start (not to mention the usually unnecessary
memory use).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
windows.c: prevent an unused warning

When building with WIN32_CONSOLE_APP (or CONFIG += console)
we need to fake-use console_desc or a warning will pop out.

__attribute__((unused)) is available, but is GCC only.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Adding shortcut key sequence to the worldmap exporter

Adding Shortcut (Ctrl+H) to the worldmap exporter for consistency with
the other commands in the file menu

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Reefnet Sensus dataloggers report in mbar (CSV import)

Sensus dataloggers report depth in (absolute) millibar. This simple
fix corrects the CSV import. The depth is now computed correctly.

Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly handle dive selection after editing dives

It's a tricky problem as we need to remember this across a divelist sort
(as the user might have edited the date / time). The old code made not one
but two incorrect assumptions.
a) it assumed that the added or edited (but previously manually added)
dive was the last one in the dive list (clearly wrong when adding a dive
that has an earlier date)
b) it ignored the fact that refreshDisplay() would select the top dive in
the list if no dive was selected

This patch addresses both of them and makes the code easier to understand.

Fixes #480

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fixing dive notes escape characters in worldmap exporter

Replacing the newlines in the string with <br> and changing the
single quote to its HTML number.

Also minor coding style updates to previous commit.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Edit name option for bookmarks

Add the option to edit the name of a bookmark to be more meaningful for
the user they prefer.
It works just as simple bookmarks and can be removed and hidden.
It won't accept names longer than 22 characters because longer names will
display as garbage text.
Also changed the code from displaying flag depending on event name to
depending on event type.

Signed-off-by: Yousef Hamza <jo.adama.93@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Random small whitespace cleanups

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Javascript exported code throws errors when dives are missing

The world map exported Javascript sometimes fail because dives with
no coarinates are neglected during exporting which leaves some array
indexes missing and corrupt the javascript.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Set the world-map HTML charset to UTF-8

The exported HTML was missing the UTF-8 encoding, so non ascii
characters weren't displayed correctly, This patch makes the exporter
support all the unicode characters.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove check option to show units in text label

Currently the feature to show temperature units while adding dive is
provided through checkbox in preferences->units section. This patch
disables this checkbox and always enables this feature.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix divelogs.de upload error

The order of arguments to fread was incorrect.
In case of arguments "streamsize, 1" the returning value is 1, and
hence due to membuf[streamsize] = 0; line, membuf ends up being one
character long.
Fixed it by exchanging arguments to "1, streamsize". This way,
streamsize has the correct value.

Fixes #483

Signed-off-by: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in>
Acked-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use helper function to write decimal numbers

Never ever use '%f' to write floating point data to a file. The stupid
locale handling creates useless comma-infested output in some locales.
Instead use one of our clever helper functions to do the right thing.

Original patch by Gehad, modified by Linus to be a little more generic.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add test dive that has an unused cylinder

This way one can test that the corresponding preferences option works
correctly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>