aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-12-10Divelogs.de: prevent undefined behaviourGravatar Lubomir I. Ivanov
prepare_dives_for_divelogs() did a silly thing, which I was responsible for. When populating 'tempfile' we benefit from QString, but then return a pointer to a local variable (char *) without alocating it on the heap. This resulted in undefined behavior, as we don't know the lifespan of that local memory on the stack. Patch fixes that by using strdup() and freeing the memory when/if needed. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Latest translation updatesGravatar Dirk Hohndel
Amazing progress. Bulgarian, Chinese (Taiwan), Slovak got completed - many other translations added the hand full of new strings that showed up over the last few days. Thanks to all the translators. I only pull these, authorship is tracked at Transifex. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Manual updateGravatar Willem Ferguson
Replaced graphics for Import from Divelogs.de to reflect latest UI schanges. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Fix asciidoc CSS pathGravatar Sergey Starosek
Both JS and CSS resources need to be embedded into HTML Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Usermanual updateGravatar Willem Ferguson
- Print divelog added - Typos corrected. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Reset libdivecomuter import canceled stateGravatar Dirk Hohndel
Once the process got cancelled once we never reset the flag. Fixes #82 Initial-fix-by: Jef Driesen Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Remove some safety stop code in plan()Gravatar Anton Lundin
Some code in plan() left from the gtk days introduced a safety stop in the plan. It created a un-editable diveplanpoint. Fixes #349 Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Don't rely on current path when searching for support filesGravatar Dirk Hohndel
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-10Pulled latest translationsGravatar Dirk Hohndel
As always, I didn't author these, just did the pull from Transifex. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10Fix selection tracking bugGravatar Dirk Hohndel
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-10Add the new string introduced in the previous commitGravatar Dirk Hohndel
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-10Webservices: make the dialog title more genericGravatar Lubomir I. Ivanov
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-10Planner: fix potential assert in clear()Gravatar Lubomir I. Ivanov
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-09Remove some unused variablesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Use implicit zero initialize for the whole array.Gravatar Anton Lundin
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-09Remove possible dual meaning in Divemaster and Buddy.Gravatar Tim Wootton
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-09Removes imperative to not save-as-you-go.Gravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Fix another potential crashGravatar Anton Lundin
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-09Small addition to the INSTALL instructions for FedoraGravatar Pierre-Yves Chibon
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Updated user manualGravatar Willem Ferguson
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-09Re-enable login and password fields after uploadGravatar Sergey Starosek
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-09Fix potential crashGravatar Anton Lundin
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-09Fix tab order for webservices dialogGravatar Sergey Starosek
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-09Updated source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Divelogs.de: change the 'Apply' button to 'Done' for uploadGravatar Lubomir I. Ivanov
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-09Divelogs.de: use qDebug() instead of fprintf()Gravatar Lubomir I. Ivanov
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-09Merge branch 'web' of github.com:neolit123/subsurfaceGravatar Dirk Hohndel
2013-12-09Divelogs.de: attempt to impletent 'Cancel' properlyGravatar Lubomir I. Ivanov
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-09Fix possible compatibility issue with asciidocGravatar Dirk Hohndel
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-09Missing images for the manualGravatar Willem Ferguson
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Divelogs.de: store the user/pass on uploadGravatar Lubomir I. Ivanov
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-09Divelogs.de: Improve the error handling post DLD creationGravatar Lubomir I. Ivanov
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-09Divelogs.de: Add a 'filename' field when uploadingGravatar Lubomir I. Ivanov
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-09Divelogs.de: further improve reading the server reponseGravatar Lubomir I. Ivanov
We now check for the following entries: <Login>succeeded</Login> <FileCopy>failed</FileCopy> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09Divelogs.de: improve prepare_dives_for_divelogs()Gravatar Lubomir I. Ivanov
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-09Divelogs.de: parse response once the upload is finishedGravatar Lubomir I. Ivanov
This is based on the GTK version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09Divelogs.de: add code for zipping up all divesGravatar Lubomir I. Ivanov
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-09Divelogs.de: add a divelist context menu item for uploadGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09Divelogs.de: allow import of downloaded divesGravatar Lubomir I. Ivanov
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-09Update to manualGravatar Willem Ferguson
- 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-09Removes unnecessary references to number of elements inGravatar Tim Wootton
the date field Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Updates main menu entriesGravatar Tim Wootton
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-09Replaced writing email to, with sending an email toGravatar Tim Wootton
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-09Implement a settingsChanged in DivePlannerWidgetGravatar Anton Lundin
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-09Don't crash when trying to open a empty fileGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08Keep track of user requested minimum depthGravatar Anton Lundin
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-08Update the diffrent units when switching systemGravatar Anton Lundin
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-08Rename the radio button to match label kgs->kgGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08Fix units boxes in preference panelGravatar Anton Lundin
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-08Clarification on EAD and END meaning in SubsurfaceGravatar Salvador Cuñat
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>