Add current time and adjusted time to gui when adjusting dive's timestamp

This patch adds the current dive time and the adjusted time to the time
shift window. I added a function to dive.c to get the timestamp of the
first selected dive.

This will view the time of the first selected dive only even when multi
dives are selected but it does change the times for multiple dives
properly.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make pp graphs visible at startup according to settings

Changeset a90818671 introduces a small inconvenience. The pp graphs at
startup are not shown according to the visibility settings. Requiring to
toggle the icons to show the desired pp graph.

Trivial fix.

Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix system default font handling

We didn't care about system default fonts and sizes, we just used the Qt
default font.

Due to how QFont is constructed, there was need to split font and font
size.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
save-git.c: fix another libgit2 API issue

GIT_CHECKOUT_OPTS_INIT, git_checkout_opts
has changed to:
GIT_CHECKOUT_OPTIONS_INIT, git_checkout_options

Solution-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Divemaster and Buddy fields auto-completion are not saved

The added characters by auto-completion "for the last item"
isn't saved when using Return to save it "works well with
tab"

Fixes #469

Signed-off-by: Yousef Hamza <jo.adama.93@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Enable parts of planner based on define

In bf205726 DEPTH/Switch at was disabled by commenting out that code.
This puts it back behind ifdefs

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't crash if we try to save a empty plan

Just treat it as a cancel instead.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Redraw profile when manipulating cylinders

Manipulating cylinders, especially changing the exact gas content (o2,
he), changes the pp02, ppHe graphs. This patch simply replots the profile
in case of cylinder change at time of saving.

Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add the WIN32_CONSOLE_APP flag

If the user passes 'CONFIG += console' to qmake, we define
WIN32_CONSOLE_APP that will be used in the source code
to determine if this is a console or a GUI application on Win32.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add optional Win32 console allocation

This patch adds the optional --win32console command line option.
It does nothing on OSx and Linux, while is only useable on Win32.

On Win32 if the application was built as GUI (not console),
there is no way to view stdout and stderr. With windows.c's
subsurface_console_init() we are able to either redirect
stdout and stderr to the terminal from which subsurface.exe
was started (always happens; --win32console does nothing in
this case) or if --win32console is explicitly added to
a shortcut, create a dedicated console window and monitor
the output there.

if set, WIN32_CONSOLE_APP is a condition that will make the
subsurface_console_init() and subsurface_console_exit()
functions NOP on Windows. The definition will be created if
the user passes 'CONFIG += console' to qmake.

Fixes #436

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Updates to Section 3 of the user manual

Section 3 is quite a long section. Ten of the screen shots are replaced.
Large numbers of typos and inconsistencies are corrected.
A few sentences are included e.g when dealing with the Subsurface Companion.
Section dealing with creating libdivecomputer dump files has been reorganised
slightly.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Minor edits to updated section-3 documentation

Patch provided by Willem Ferguson, "0002-Updates-to-Section-3-of-
the-user-manual" addresses large number of typos and inconsistencies
in the previous documentation of section 3. This patch makes some
additional corrections on top of the provided patch, and also removes
the trailing whitespaces brought in with the provided patch.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
User manual: Update included .html.git file

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
simplewidgets: Include stdint for cross compatability

Not including stdint leaves 'int64_t when' without a type and undefined when
compiling for Windows with mingw

Signed-off-by: Alberto Corona <albcoron@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Introduce NO_MARBLE define, make GlobeGPS a dummy

Some users have requested a way to build subsurface without marble.

This hides all traces in the ui and creates a GlobeGPS-dummy thats
just a QLabel saying that marble is disabled, in case its shown
somehow. The dummy is there so we can just ignore the fact that marble
is disabled in the rest of the code.

Fixes #394

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Introduce android specific file

This contains a first stab at Subsurface platform interfacing code for
Android, and surrounding parts.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Disable marble on Android

marble uses webkit, and thats not compatible with Android.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove usermanual when building for Android

Our usermanual is based on webkit, and thats not supported in Qt for
Android. We should probably replace it with a Android native webview
somehow.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove printing when building for Android

Qt for Android doesn't support printing.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Repaint ruler when enable/disabling it

Repaint ruler when enable/disabling it.
Straightforward replot() added.

Fixes #479

Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>