Commit graph

3734 commits

Author SHA1 Message Date
Dirk Hohndel
13c9d2ad38 Don't rely on current path when searching for support files
The notion of current path changes as we open files in the file system.
What we really want is the directory from where Subsurface was started.
That covers both the case of Windows and running Subsurface from the
install directory.

This worked before because all support files were opened before the first
user interaction. But opening the manual showed the flaw in the previous
logic.

Fixes #348

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 07:29:06 +01:00
Dirk Hohndel
5e1cfd96fd Pulled latest translations
As always, I didn't author these, just did the pull from Transifex.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 06:28:41 +01:00
Dirk Hohndel
e5561d7668 Fix selection tracking bug
When trying to remember a newly manually created dive across the
sort_table() call I abused the dive->selected flag and didn't clear it out
afterwards (most likely thinking "hey, I'm calling selectDive() on this
anyway").

This caused the UI code to correctly mark the dive as selected, but when
it called down to the C code to keep the internal data structures in sync,
that code didn't update amount_selected as it thought this dive had
already been selected. And that caused other parts of the code to get
confused, which manifested for example in the failed upload to
divelogs.de.

So this clears out the flag after abusing it to remember a dive. Maybe we
should add a 'remembered' flag instead, but for now this fixes the issue.

Fixes #351

Initial-fix-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 06:25:30 +01:00
Dirk Hohndel
eaa3160082 Add the new string introduced in the previous commit
It gets lost in the noise with all the line number changes, but this
introduces only a single new string.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 06:16:14 +01:00
Lubomir I. Ivanov
c8eae30c6f Webservices: make the dialog title more generic
We use the same dialog for both the Subsurface WS and for the
divelogs.de one. Instead of the old title (which suggests download)
we can use a more generic one - "Webservice Connection"

This makes it easy for us to maintain a dialog that can both
upload and download data, while the dialog title is descriptive
enough.

Fixes #352

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 05:52:26 +01:00
Lubomir I. Ivanov
cf9748278f Planner: fix potential assert in clear()
If rowCount() is 0 we get an assert:
ASSERT: "last >= first" in file kernel/qabstractitemmodel.cpp...

To solve that we wrap the beginRemoveRows() call in a bnrach:
if (rowCount() > 0) {
...

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 05:22:01 +01:00
Anton Lundin
26a1904cf8 Remove some unused variables
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 22:47:28 +01:00
Anton Lundin
a3f3e85246 Use implicit zero initialize for the whole array.
Clang yelled about it, and it looks prettier. It also felt kinda strange
to explicit initialize the first element to zero and the rest to zero
implicit.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 22:47:12 +01:00
Tim Wootton
85fd75ad51 Remove possible dual meaning in Divemaster and Buddy.
Pedantic Tim says "Barring waterproof device, most of us won't
be entering these fields during the dive." ;-)

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 22:44:58 +01:00
Tim Wootton
afe065744f Removes imperative to not save-as-you-go.
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 22:44:25 +01:00
Anton Lundin
6ff345731b Fix another potential crash
Initialize diveplan.dp to NULL, so we know that we will bail in
drawProfile, when the initial settingsChanged is fired.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 21:40:12 +01:00
Pierre-Yves Chibon
2b4c7be9d7 Small addition to the INSTALL instructions for Fedora
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 21:39:18 +01:00
Willem Ferguson
8b74ffc35b Updated user manual
1) Added Main Menu items description
2) Added Divelogs.de description
3) Removed paragraph defining EAD & END
4) Several typos corrected
5) Positions of several figures standardised to align="central"

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 21:38:16 +01:00
Sergey Starosek
a0eb9013b1 Re-enable login and password fields after upload
Give user the possibility to re-enter username and password
after unsuccessful upload due to wrong credentials.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 20:29:38 +01:00
Anton Lundin
35b0924335 Fix potential crash
Initialize stagingDive to NULL, so we know that we will bail in
createTemporaryPlan, when the initial settingsChanged is fired.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 20:11:12 +01:00
Sergey Starosek
5cb47c3de8 Fix tab order for webservices dialog
At least username and password have to follow each other.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 18:50:33 +01:00
Dirk Hohndel
d177fd3050 Updated source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 18:45:39 +01:00
Lubomir I. Ivanov
7c4b083c2b Divelogs.de: change the 'Apply' button to 'Done' for upload
Post downloading we have an 'Apply' button that can be clicked
to apply/merge the downloaded dives. When uploading we
rename the button to 'Done' and enable the button if the
upload was successful. The 'Cancel' button on the other hand
becomes disabled.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 18:40:52 +01:00
Lubomir I. Ivanov
8f29df6e5a Divelogs.de: use qDebug() instead of fprintf()
Use qDebug() instead of fprintf(stderr, ...) in
prepare_dives_for_divelogs().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 18:40:02 +01:00
Dirk Hohndel
8ac58181f7 Merge branch 'web' of github.com:neolit123/subsurface 2013-12-09 17:22:33 +01:00
Lubomir I. Ivanov
04b62a46e9 Divelogs.de: attempt to impletent 'Cancel' properly
The correct way to stop the upload/download is to use
reply->abort(). If the dialog closes, post exec()
we check if the reply 'isOpen' and abort and delete it.

Without this modification the program seems to crash
as the connection is still in action and it attempts
to read an already deleted file.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 17:42:06 +02:00
Dirk Hohndel
4675ab0617 Fix possible compatibility issue with asciidoc
Apparently some version os asciidoc don't support the --theme option.
Work around this by using -a theme='theme' instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 16:12:36 +01:00
Willem Ferguson
9156bd0efb Missing images for the manual
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 16:05:51 +01:00
Lubomir I. Ivanov
e0acad42aa Divelogs.de: store the user/pass on upload
We store the user/pass for 'Apply' when downloading, but
we also want to store these values for 'Upload'.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 16:45:54 +02:00
Lubomir I. Ivanov
de8d532adb Divelogs.de: Improve the error handling post DLD creation
Only show a filename in the error report if such was previsly
set. We also add a string for translation, that is shown
in the main window.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 16:23:58 +02:00
Lubomir I. Ivanov
ca731cef89 Divelogs.de: Add a 'filename' field when uploading
The 'Content-Disposition' header, requires that we pass
'name' but also a 'filename' field.

Suggested-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 16:23:58 +02:00
Lubomir I. Ivanov
70fce6ce6b Divelogs.de: further improve reading the server reponse
We now check for the following entries:
<Login>succeeded</Login>
<FileCopy>failed</FileCopy>

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 16:23:57 +02:00
Lubomir I. Ivanov
5514499867 Divelogs.de: improve prepare_dives_for_divelogs()
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>
2013-12-09 16:23:57 +02:00
Lubomir I. Ivanov
231e02f97d Divelogs.de: parse response once the upload is finished
This is based on the GTK version.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 15:51:18 +02:00
Lubomir I. Ivanov
0905e4f0ab Divelogs.de: add code for zipping up all dives
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>
2013-12-09 15:51:17 +02:00
Lubomir I. Ivanov
5869712569 Divelogs.de: add a divelist context menu item for upload
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 15:51:17 +02:00
Lubomir I. Ivanov
be16ade038 Divelogs.de: allow import of downloaded dives
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>
2013-12-09 15:51:17 +02:00
Willem Ferguson
3a49ad6ba5 Update to manual
- Companion app added
- Figures updated & reorganised
- Small amount of reorganisation of text
- Typos corrected

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 13:54:11 +01:00
Tim Wootton
e7a657c72b Removes unnecessary references to number of elements in
the date field

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 10:14:50 +01:00
Tim Wootton
2f3d18d001 Updates main menu entries
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>
2013-12-09 10:14:43 +01:00
Tim Wootton
21e14933ac Replaced writing email to, with sending an email to
Seems to read better as "sending an email to"

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 10:14:27 +01:00
Anton Lundin
e6c51cc314 Implement a settingsChanged in DivePlannerWidget
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>
2013-12-09 07:51:40 +01:00
Anton Lundin
3b115b9400 Don't crash when trying to open a empty file
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 07:50:52 +01:00
Anton Lundin
44848d5457 Keep track of user requested minimum depth
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>
2013-12-08 16:20:40 +01:00
Anton Lundin
a145c2e61a Update the diffrent units when switching system
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>
2013-12-08 16:18:00 +01:00
Anton Lundin
8c65173746 Rename the radio button to match label kgs->kg
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 16:17:52 +01:00
Anton Lundin
e39ec4e564 Fix units boxes in preference panel
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>
2013-12-08 16:17:43 +01:00
Salvador Cuñat
f84e4ef4ee Clarification on EAD and END meaning in Subsurface
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>
2013-12-08 16:14:17 +01:00
Anton Lundin
f96ea9cc9a If we have defined a gas, default to that one.
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>
2013-12-08 09:42:15 +01:00
Anton Lundin
01e3210725 Calculate gas consumption for planned dives
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 09:42:03 +01:00
Anton Lundin
eae1624f24 Make local helpers static
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 09:41:54 +01:00
Anton Lundin
caf4d85d0a Silence signed vs. unsigned compare warning
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 09:41:42 +01:00
Anton Lundin
1ec61e1288 Remove the air point at 0,0
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 09:41:31 +01:00
Anton Lundin
28943d2def Add some assert guard around gas finding code
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>
2013-12-08 09:41:28 +01:00
Willem Ferguson
d84f397790 Add compact style to the Documentation
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>
2013-12-08 07:50:34 +01:00