aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-07-11mobile: update version to 3.0.10Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-07-11helper functions: remove timestamp argument from gettiemzoneoffset()Gravatar Dirk Hohndel
The last user of that argument has been removed. (a random whitespace fix snuck in with this) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-07-11mobile/location-service: stop using broken adjustment functionGravatar Dirk Hohndel
gettimezoneoffset() returns incorrect values when called with a time_t. Since we only accept the value here if it is within 5 minutes of 'now', using the current timezone offset is a fair approximation. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-07-11mobile/location-service: fix timezone issue in GPS timestampsGravatar Dirk Hohndel
For some reason we suddenly started logging the GPS fixes in UTC instead of local time. Which caused the matching algorithm to fail (unless you happened to be diving in UTC). Unclear what broke this, but this seems like an easy enough fix, since the GPS fix being reported is by definition "right around now". So using gettimezoneoffset() with the current time seems "good enough". I don't know when gettimezoneoffset() with an argument got broken, TBH. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-07-11Make MND display depend on O2 narcotic preferenceGravatar Robert C. Helling
A while ago, we introduced a preference whether O2 should be considered narcotic. We used this when computing best mix or when entering the He content via MND. But we forgot to make the displayed MND depend on this preference. This patch add this. Fixes #2895 Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-07-02profile: fix displaying of profiles with multiple pressure sensorsGravatar Berthold Stoeger
When removing the MAX_CYLINDERS restriction, the layout of the pressure readings was changed from a (cylinder,sample) to a (sample,cylinder) scheme. I.e. previously there were one cylinder block for each sample, then one sample block for one cylinder. However, after populating the samples, the array size was reduced to the actual number of used samples. With the new layout this breaks indexing. Therefore, restore the old layout. Fixes #2887 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-06-29Fix dive merging with multiple cylindersGravatar Linus Torvalds
We did something really horribly wrong when merging cylinders. It's been broken since commit 7c9f46a ("Core: remove MAX_CYLINDERS restriction"), and used some really strange logic. This rewrites the logic to be (I think) a bit more easy to understand. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-25Add support for the Oceans S1 and McLean ExtremeGravatar Linus Torvalds
This updates libdivecomputer to support the Oceans S1 and McLean Extreme divecomputers. It also adds the Oceans S1 to the list of dive computers we reconize by bluetooth name. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-06-25build-system/mxe: use the new container imageGravatar Paul Buxton
[Dirk Hohndel: switched back to our docker hub repo] Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-25build-system/MXE: build with more up to date MXE tools.Gravatar Paul Buxton
- use hidapi grantlee and mdbtools from MXE - update MXE version to use QT 5.15, and pull in libzstd and CMake 3.17.3 - fix linking of winmm on windows build with new mxe - add some instructions on building the container - add some new dependancies from QT 5.15 to the packaging - add a patch to MXE to Build qtconnectivity with native-win32-bluetooth [Dirk Hohndel: small refactor] Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-20pull latest translations from Transifexv4.9.6Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-20update README and ReleaseNotes for 4.9,6Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-18core: fix compile issue with older g++Gravatar Dirk Hohndel
Having the full list of all members in the exact order should be enough to get g++ to accept the named initializers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-18core: fix libdivecomputer dc_custom callbacks structuresGravatar Linus Torvalds
The last time those changed, we forgot to update serial_ftdi. In that change set_latency had been removed from libdivecomputer and poll and ioctl had been added. This caused the callbacks to no longer be aligned correctly and the functions were called with the wrong arguments through the wrong function pointers, leading to crashes. Instead of the fragile assumptions about order and type of function pointers, use named initializers. And while we are at it, fix that for the bluetooth implementation as well. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-16cleanup: remove indirection when passing arguments to parser functionsGravatar Berthold Stoeger
For unknown reasons, the dive site and trip to be parsed into were passed as pointers to pointers. A simple pointer seems to be enough, since the object is not allocated by the function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-06-14Update CHANGELOGGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-14mobile: show sync state in menu plateGravatar Dirk Hohndel
This seems like the easiest way to show the state without disrupting the UI elsewhere. Directly below the email address used for cloud storage. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-14mobile: add status text for cloud sync stateGravatar Dirk Hohndel
This allows the mobile UI to reflect the three states that the dive list can be in: - changes that haven't been written to local storage - there potentially are changes in local storage that were not synced with the cloud - dive list is in sync with cloud storage The last state could be misleading if the user access the cloud from a different device and makes changes to the cloud storage from there, but from the point of view of this device, the states are consistent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-14mobile: track if we have changes that aren't synced to cloudGravatar Dirk Hohndel
If we haven't connected at all to the cloud server we assume that there are local changes. And whenever we save changes only locally, we also set that flag. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-14git-storage: add global flag to indicate successful cloud syncGravatar Dirk Hohndel
This may seem like a bit heavy handed as it adds more global state, but given the number of ways in which attempts to sync with the cloud can fail it seems much more reliable to claim success in the spots where we actually know that we have successfully synced with the remote server. Transporting that information back through the various call chains turned out to be very disruptive and ugly, so I went with global state instead. Whenever we access cloud storage (or any git repo), we always first check if it actually is a git repo by calling is_git_repository() - so this is the perfect spot to initialize the variable to false. And there are only two spots where we either clone the remote repo (create_local_repo()) or update the remote with the (potentially merged) local changes (check_remote_status()). So those are the two places where we set the variable to true. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-14git storage: significantly expand logging to stderrGravatar Dirk Hohndel
In many cases we did not log the issues the code ran into to stderr which made remote debugging user problems much harder. This hopefully will help with that. Since I was looking at the code, I also made the existing messages more consistent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-13download: don't warn on unknown gasmixesGravatar Berthold Stoeger
Apparently libdivecomputer can return DC_GASMIX_UNKNOWN when fetching tank info with dc_parser_get_field(parser, DC_FIELD_TANK, i, &tank); This caused emission of a warning, which was annoying users. Disable the warning in that case. Fixes #2866 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-06-13Fix includes for building against Qt-5.15Gravatar Gaetan Bisson
Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
2020-06-12pull latest translations from Transifexv4.9.5Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-12Update ReleaseNotes and README for 4.9.5Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-08mobile: update version to 3.0.9Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-08mobile/dive-details: restrict width of tags fieldGravatar Dirk Hohndel
Having a lot of tags (or more precisely, a tags string that is very long) could cause the width of the dive details view to extend past the width of the the page. The txtTags label was missing a maximum width, and to make the result more useful, I also added correct wrapping and elide to the mix (stupidly, we had the wrap and width for the fixed name of the field ('Tags'), but not for the user determined content of that field). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-07mobile: add option to merge local cloud cache dataGravatar Dirk Hohndel
The UI is ugly, and of course this is hidden in the developer options that have to first be enabled in the advanced settings. As I mentioned in the previous commit, I believe the actual risk that something gets damaged here is very low, but still, explaining this so it makes sense to the casual user may be a bit... difficult. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-07mobile: add helper to import data from local cloud cacheGravatar Dirk Hohndel
If you pass in the repo name, it isn't treated as cloud storage, but simply as local git storage and imported (i.e., added) to the current dive list. This allows the user to work around failed no-cloud->cloud transitions, merge different accounts, and most importantly deal with situations were conflicts on the server caused us to move a cache out of the way and potentially make dives that were on the mobile device inaccessible to the user. Once a UI is added, this allows the user to recover those dives (realistically this is not really all that potentially 'dangerous' to do, but it's definitely something that would best be done after talking to someone who understands the cloud storage and can guide the user...). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-07mobile: make list of local cloud cache directories availableGravatar Dirk Hohndel
This way QML can show those to the user. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-07mobile: tiny whitespace updateGravatar Dirk Hohndel
Every time I edit main.qml, QtCreator fixes this for me. And then I filter it from the commit to not mix white space and actual changes. So let's just get this fixed and move on. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-31Fix indentationGravatar Miika Turkia
The diff goes crazy if indentation is not fixed by itself. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-31Print empty cylinder, if neededGravatar Miika Turkia
When the dive that is used to generate the header, we need to print empty cylinders for the dives that had less cylinders than the one used for header printing. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-31Print at most as many cylinders as the header hasGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-31Limit cylinders to one dive onlyGravatar Miika Turkia
With XSLT we have to be specific if we want to apply cylinder iteration operation to one dive only. Thus using the last dive as reference when printing cylinder header. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-30mobile: update version to 3.0.8Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-30mobile/dive-edit: fix broken editable combo boxesGravatar Dirk Hohndel
This is a partial revert of commit 99438121c4 ("mobile/dive-edit: use template components and theme colors") Clearly the information given in the Qt documentation on how to theme ComboBox is flat out broken. The trade-off between 'better dark theme' and 'broken user experience' is fairly easy to make. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-29cleanup: make local functions of static linkageGravatar Berthold Stoeger
A few functions in save-html.c were local but not marked as static. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-27cleanup: remove QCalendarWidget forward declaration and includeGravatar Berthold Stoeger
This is an artifact of code that never came to be. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-27cleanup: unglobalize grayImage()Gravatar Berthold Stoeger
This function was globalized in be462ae1a6 to be used for the calender widget, but that never came to be. Therefore, for now unglobalize it until it is needed. That said, there probably is a helper function to turn pictures into gray-scale. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-27Android: install translations into the right placeGravatar Dirk Hohndel
When updating the NDK I forgot to adjust the install destination for the translations. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-27cleanup: un-singletonize ShiftTimesDialogGravatar Berthold Stoeger
There is no reason that this dialog is a singleton. Since it is modal, it can be created on demand. Apart from removing superfluous global state, this simplifies code, because preparing the widget can now be done in the constructor instead of overriding the showEvent() function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-27cleanup: un-singletonize RenumberDialogGravatar Berthold Stoeger
There is no reason that this dialog is a singleton. Since it is modal, it can be created on demand. This simplifies code, because the mode (selected-only or all-dives) can be set in the constructor. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-26Update changelogGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-26Fix precision bug on SubsurfaceCSV importGravatar Miika Turkia
We need decimal point as size is stored with one decimal on imperial export. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Remove debug outputGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Add dive mode support for SubsurfaceCSV importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Fix field indexes after dive mode and sac changeGravatar Miika Turkia
We need to update field numbers when parsing CSV, as recently sac and dive mode were added. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26CSV import: add SAC if we end up supporting itGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Test case for multicylinder support on CSV importGravatar Miika Turkia
Test for importing Subsurface generated CSV dive details, with multiple cylinders support. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>