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>
Divelogs.de: add a divelist context menu item for upload

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
Merge branch 'web' of github.com:neolit123/subsurface