Commit graph

4809 commits

Author SHA1 Message Date
Gehad
a6fcd4f99f 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>
2014-04-04 08:23:26 -07:00
Dirk Hohndel
9a0e40b456 Random small whitespace cleanups
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-03 12:52:05 -07:00
Yosef Hamza
0f5664e584 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>
2014-04-03 12:49:22 -07:00
Gehad
c268b757df 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>
2014-04-03 12:12:56 -07:00
Dirk Hohndel
3485c6c260 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>
2014-04-03 10:26:48 -07:00
Jan Mulder
141433c3df 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>
2014-04-03 10:26:38 -07:00
Gehad
71afa05b84 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>
2014-04-02 19:05:57 -07:00
Lubomir I. Ivanov
e372e819e7 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>
2014-04-02 19:05:00 -07:00
Dirk Hohndel
59912568d0 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>
2014-04-02 12:56:14 -07:00
Dirk Hohndel
4ee94167f1 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>
2014-04-02 12:55:33 -07:00
Joshua Joseph
ede6a38bcf 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>
2014-04-02 12:47:41 -07:00
Anton Lundin
5cec965cb7 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>
2014-04-02 12:44:49 -07:00
Lakshman
4722104e1c 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>
2014-04-02 10:21:02 -07:00
Lakshman
b629905ec5 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>
2014-04-02 10:16:06 -07:00
Tim Wootton
c6ceab4fec 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>
2014-04-01 11:13:15 -07:00
Dirk Hohndel
0de21c24fa Merge branch 'planner-mods'
Nothing exciting here, just a few independent changes close to each other.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-31 22:18:00 -07:00
Lakshman Anumolu
18ec989ef5 Diveplan with entered and computed waypoints to UI
Recently Robert Helling provided a patch "Distinguish between entered and
calculated waypoints" in an attempt to distinguish between entered and
calculated stops.

This patch is an independent (content wise) extension of the above
patch and is built relative to it which adds new table to display
computed waypoints in plan mode.

Currently table includes only two columns "Comp. Depth" and "Comp.
Duration", which can extended to show further information.

This is only a start to the UI interaction in PLAN mode.
In addition to this there are many TODO things that diveplan feature
demands

TODO:
1. Show more details through "Computed Waypoints" table.
2. Remove tooltip from "Computed Waypoints" table widget.
3. Make contents in "Computed Waypoints" table widget non-editable.
4. Fix error when trying to save dive plan without using cylinder data.
5. Make dive plan editable after saving it.
6. Improvise dive planner graphics window.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-31 22:01:16 -07:00
Robert C. Helling
30bdfc8160 Distinguish between entered and calculated waypoints
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-31 22:01:05 -07:00
Linus Torvalds
45767961e8 Fix crash with libgit when it's compiled with GIT_THREADS
Call git_threads_init() before using libgit functions.

The documentation says:

"If libgit2 has been built with GIT_THREADS on, this function must
 be called once before any other library functions.

 If libgit2 has been built without GIT_THREADS support, this function
 is a no-op"

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-31 13:56:14 -07:00
Robert C. Helling
02d5d436d2 EAD/END explanation in user manual.
E is for "equivalent".

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-31 11:51:54 -07:00
Robert C. Helling
61d60f6b1a Exchange EAD and END to align our language with the rest of the world
This needs to be tracked in the documentation as well.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-31 09:48:16 -07:00
Robert C. Helling
907459291d Show EAD/END only for trimix/nitrox dives respectively
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-31 08:58:35 -07:00
Robert C. Helling
374f99af18 Get rid of division by 0 by reshuffling EAD and EAN logic
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-30 16:02:21 -07:00
Gehad
0cd9d09410 Exporting a World-Map
This patch adds the world map exporter.

- add worldmap-save.c that writes the html to the file
- use Google maps v3 API to put the place marks on the map
- add worldmap-options.h to contain some settings for the JS which will
  make it easier for those to be changed
- add save HTML action in the mainwindow user interface

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-30 15:52:32 -07:00
Lakshman
7696fbf9cd Toggle showing average depth
Add additional check box in "preferences->graph" section that allows
users to hide average depth on dive profile.
By default this option is checked to show average depth.

Fixes #475

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-28 09:38:08 -07:00
Lakshman
df7d7d4981 Fix redundant spaces in info panel
Remove redundant spaces from dive master and buddy list fields.
Ticket also mentions about similar space behaviour in tag field, which I
couldn't reproduce.

Fixes #476

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:58:23 -07:00
Lubomir I. Ivanov
d2f1a02523 Profile2: hide the tooltip and ruler if we are printing
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:58:22 -07:00
Lubomir I. Ivanov
47c0ddbf30 Print: enable printing with the new profile
Some weird things happen if we use a local instance of the
ProfileWidget2 class in printProfileDives(). Once we
exit the printing dialog the profile crashes, which could
hint of singleton issues.

Instead we are going to use the already active instance of
the class which we can retrieve from MainWindow. This should
also be faster because the class is pretty heavy.

In such a case the cleanup at the end of printProfileDives()
is still relevant (removed in ac9a23ef3b). First we
resize the widget for printing purposes and then resize it
back to the original values and re-plot the current selected
dive in the dive list.

Fixes #477, #478

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:58:22 -07:00
Lubomir I. Ivanov
b3f6a4f994 Profile2: add use of the isGrayscale flag when getting a color
getColor() has a default argument for grayscale set to false.
With this patch we pass it the local isGrayscale flag, which
can only be set during printing.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:58:22 -07:00
Lubomir I. Ivanov
06a1cb0975 Profile2: add some print related flags
Some flags like printMode and isGrayscale are missing yet needed.
The flag printMode is required so that we know *when* to hide
certain elements such as the ruler and tool tip (e.g. not needed
while printing).

isGrayscale should be passed to all getColor() calls, so that
the greyscale color table is respected.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:58:22 -07:00
Lubomir I. Ivanov
ac23d7397f Ruler: fix bad scaling for the text background
The ruler text's white background scales badly. This patch
adds the ItemIgnoresTransformations for the textItemBack
object and matches the dimensions and position of the
textItem object in front of it.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:58:22 -07:00
Willem Ferguson
69b000dcff User manual: Updates to sections 6 and 10-13
These are updates that are not version 4.1 dependent, but many linguistic
and logical edits are made, as are edits for consistency.
No substantive material has been removed or added.
This text is ready for V4.1

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27 10:58:22 -07:00
Jan Mulder
486db77ac8 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>
2014-03-27 10:58:22 -07:00
Anton Lundin
198199adae 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>
2014-03-27 10:42:07 -07:00
Anton Lundin
605cff32a5 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>
2014-03-27 10:41:52 -07:00
Anton Lundin
42df3528a0 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>
2014-03-27 10:40:52 -07:00
Anton Lundin
df12944c93 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>
2014-03-27 10:40:43 -07:00
Anton Lundin
770bf9afba 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>
2014-03-27 10:40:06 -07:00
Alberto Corona
027ffc41bb 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>
2014-03-25 11:19:56 -07:00
Dirk Hohndel
dd0c995f2f User manual: Update included .html.git file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-25 08:16:06 -07:00
Lakshman
17e493735b 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>
2014-03-25 08:13:26 -07:00
Willem Ferguson
b95304f424 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>
2014-03-25 08:12:54 -07:00
Lubomir I. Ivanov
74ed786d75 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>
2014-03-25 07:57:27 -07:00
Lubomir I. Ivanov
b3f78185a5 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>
2014-03-25 07:57:25 -07:00
Jan Mulder
fe2ad15603 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>
2014-03-25 07:53:37 -07:00
Anton Lundin
fc13361079 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>
2014-03-23 17:24:42 -07:00
Anton Lundin
8bc2ad1473 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>
2014-03-23 17:24:40 -07:00
Yosef Hamza
d4a1932276 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>
2014-03-23 17:20:03 -07:00
Lubomir I. Ivanov
3b92803667 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>
2014-03-23 17:16:57 -07:00
Anton Lundin
9cfc585563 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>
2014-03-21 21:30:39 -07:00