aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-09-17Update to current libdivecomputerGravatar Dirk Hohndel
This adds BLE transport as an option for the McLean Extreme. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-17Extend BLE uuid matching to the characteristics, add ignore-listGravatar Linus Torvalds
This extends the uuid matching to the low-level characteristics too, so that we can ignore the McLean Extreme characteristics that aren't interesting. It also renames the uuid matching to be about a "uuid_list" rather than being about the service we're matching, since we're now using it for other uuid's than just services. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-09-17Fix 'uud' typo in BLE uuid matching codeGravatar Linus Torvalds
Silly typo with a missing 'i' in 'uuid' that happened when I wrote this code originally, and that compiled fine thanks to the error being duplicated with cut-and-paste to all relevant places. Fix it now, since I'll extend the uuid matching to the actual characteristics for the McLean Extreme. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-09-15Update to current libdivecomputerGravatar Dirk Hohndel
This merges the McLean Extreme sample interval fix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-15translations: use the right Qt translations (part 2)Gravatar Dirk Hohndel
It turns out that contrary to what the documentation states, a few languages are still only using the 'qt' translation. But those exist for all languages, so we need to first search for the 'qtbase' translations, and only if that fails do we try to load the 'qt' translations. And even that will fail for languages in which Qt simply isn't localized (like Dutch). To make the code more readable, the check for 'US English' was moved earlier as there is no point to look for a Qt translation for that (simply doesn't exist). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-15translations: use the right Qt translations and try harder to find themGravatar Dirk Hohndel
We were still using the 'qt' translations instead of 'qtbase' as we should have been using since forever - it's a little unclear from reading the documentation when in the Qt5 life cycle this happened, but definitely several years ago. These are the strings used in situations where Qt already provides us with text (e.g., the entries in the 'Subsurface' menu on Mac, or the button labels in many dialogs). Additionally we didn't try hard enough to find those translations in cases where they are bundled with the app; so basically all scenarios except for Linux distro specific packages or 'build from source' on macOS or Linux were not going to work, even after addressing the qt->qtbase conversion. But of course the developers pretty much all fall into those last two categories. Still, I cannot believe we never fixed this in all those years... To make it more obvious if we still aren't finding the Qt translations this commit also makes that warning be shown in all cases, not just when running in verbose mode. Fixes #2954 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-15Update ReleaseNotesGravatar Miika Turkia
Mention Shearwater Cloud fixes and adjust capitalization / tags slightly. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-15Grab the first gas on Shearwater importGravatar Miika Turkia
The logic to retrieve gas changes from Shearwater cloud database is detecting only when the O2/He chnages. This change will grab the initial gas. (Problem was only shown when there was a gas changee in the log, so cingle cylinder dives were working fine.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-09-15Fix a bug on Shearwater cloud gas changesGravatar Miika Turkia
Gas change is done to the cylinder we just found and not the last cylinder. Also switching the variable name to index as we are actually using that value outside the loop. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-09-15Import cylinder pressure correctlyGravatar Miika Turkia
Shearwater apparently stores correct pressures nowadays, so getting rid of a hack to import double pressures. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-09-15Ignore gas changes if we one line contains bogus O2Gravatar Miika Turkia
This will ignore the gas changes that would be caused by Shearwater cloud saving rows with 0 values in them. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-09-15New field for timestamp in shearwater cloud DBGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-09-15Shearwater cloud import: ignore bogus rowsGravatar Miika Turkia
A sample log I received contains a lot of rows with 0 values in it. This will ignore the obviously bogus ones. (However, we might miss the first sample if that is recorded at time 0.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-09-15Shearwater cloud import: adjust to millisecondsGravatar Miika Turkia
Seems that Shearwater cloud gives the sample time in milliseconds nowadays. Taking a wild guess, that this logic should suffice for us to be able to import old and newer XML logs. (Assuming that if the timestamp for the first sample is more than 100, timestamps are in milliseconds, otherwise in seconds.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-09-13build-system/macOS: change signing to re-enable notarizationGravatar Dirk Hohndel
This continues to be useless for other people as it requires my signing key, but when signed like this I can then successfully submit the dmg for notarization, so I'll update the signing script in order not to lose that magic... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13pull latest translations from TransifexGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13build-system/macOS: use consistent code to pick SDKGravatar Dirk Hohndel
Hardcoding versions was kinda silly. This now matches what's in build.sh. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13build-system/macOS: add one more library that macdeployqt missesGravatar Dirk Hohndel
This appears to be new with Qt 5.14. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13build-system/macOS: build libz and libftdi as part of Mac dependenciesGravatar Dirk Hohndel
Usually people will install these via Homebrew, but when we need to build everything ourselves (required for release binaries), then these two were missing before. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13build-system: add zlib as library we know how to fetchGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13desktop: fix TableView for Qt 5.15Gravatar Dirk Hohndel
If we set the size on the QPushButton, the button no longer receives any input (tested on macOS). With this change we get an odd visual artifact when clicking on the 'add' button, but it least it works, so this is good enough for the next release. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13cleanup: fold core/divecomputer.cpp into core/device.cGravatar Berthold Stoeger
core/device.h was declaring a number of functions that were related to divecomputers (dcs): creating a fake dc for manually entered dives and registering / accessing dc nicknames. On could argue whether these should be lumped together, but it is what it is. However, part of that was implemented in C++/Qt code in a separate core/divecomputer.cpp file. Some function therein where only accessible to C++ and declared in core/divecomputer.h. All in all, a big mess. Let's simply combine the files and conditionally compile the C++-only functions depending on the __cplusplus define. Yes, that means turning device.c into device.cpp. A brave soul might turn the C++/Qt code into C code if they whish later on. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-13cleanup: remove unused declarations in class DiveComputerListGravatar Berthold Stoeger
The functions matchDC() and matchModel() were never implemented. Remove their declarations. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-13cleanup: remove unused function DiveComputerNode::changesValues()Gravatar Berthold Stoeger
This was not used anywhere - let's remove it! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-13cleanup: move set_dc_nickname() declaration from dive.h to device.hGravatar Berthold Stoeger
The function *looks* like it is a dive function. However, in reality it implicitly works on the global device list. Therefore, it is thematically more aptly located in device.h with the other device functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-13cleanup: remove DiveComputerModel::numRowsGravatar Berthold Stoeger
This member variable was unused. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-13Disable SAC factor setting for CCR divesGravatar Robert C. Helling
The SAC factor is only used for minimal gas calculations which don't make sense in the CCR context. Additionally, make bailout stop for at least minimum switch time or problem solving time. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-09-12Update to current libdivecomputerGravatar Dirk Hohndel
This gets us back in sync with upstream, minor changes to Shearwater Peregrine support, but also fixes an issue in my implementation of Shearwater info events on dive computers using the new format which inadvertantly disabled freedive support. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-12mobile: update version to 3.0.14Gravatar Dirk Hohndel
Once again I have managed to get out of sync in numbering between iOS and Android. I'll make new releases with the correct version number on both platforms today. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-12documentation: update list of supported dive computersGravatar Dirk Hohndel
Also update the ReleaseNotes accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-12Update translation source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-12documentation: updates for ReleaseNotes and READMEGravatar Dirk Hohndel
Prep for 4.9.7, but also some minor tweaks to the README. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-12desktop: refine auto-fill of weightsGravatar Berthold Stoeger
In a previous commit, auto-filling of weight based on type was changed to be only performed if the user hadn't already set a weight, by testing for weight=0. However, when the user edited the type and tabbed back and forth, that counted as an edit and therefore the weight would not change anymore. To refine this, introduce an "auto_filled" flag to the weightsystem, which is set if the weight is automatically filled and cleared if the weight is edited. Update the weight if it was zero *or* auto-filled. The flag is not saved to disk, but that should be acceptable. If the user saves and reloads, we can assume that they meant the weight to be set to the default value. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-12desktop: on weight type change, don't overwrite weight if already setGravatar Berthold Stoeger
When importing from other software, it happens that weights are imported without their type. When the user changes the type, the imported weight is overwritten, which is not exactly a friendly behavior. On the other hand, when changing the type after creation of a weight entry, it is preferrable to set a default weight. This is convenient for people who commonly use the same weight. As a compromise, set the default weight only if it was unset. We recognize this by a weight value of 0 g. Fixes #2938 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-12cleanup: remove empty files in desktop-widgets/statisticsGravatar Berthold Stoeger
This functionality never came to be and there are fundamentally different plans floating around. Therefore, remove these empty files. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-11project-infrastructure: update workflow badges in READMEGravatar Marshmallow
Remove old Travis CI badge, use GitHub workflow status badge instead as now we use GitHub Action. Signed-off-by: Nemo Xiong <xiongnemo@126.com>
2020-09-10restore libdivecomputer to latest versionGravatar Dirk Hohndel
In commit 62d87e9d25763e81757de417640f464e2bf5a2c0 ("Planner: handle zero length segments when replanning") a change to libdivecomputer snuck in that undid the addition of Shearwater Peregrine detection. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-10desktop: make completion of equipment types substring searchGravatar Berthold Stoeger
User request: when entering a cylinder type, do a substring search. For example, when entering "100" also find "AL100". Currently, a starts-with search was used. This is simply done by setting the "filterMode" of the ComboBoxDelegate to "Qt::MatchContains". Suggested-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-08cleanup: remove invalidate_dive_cache() call in clone_delete_divecomputer()Gravatar Berthold Stoeger
The function was called on a freshly copied dive, which has its git cache invalidated automatically in copy_dive(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-08cleanup: remove dead code from delete_divecomputer()Gravatar Berthold Stoeger
delete_divecomputer had legacy code, which 1) invalidated the git dive cache 2) made sure that the dive computer was not displayed anymore However, both callers called on a freshly copied dive, which has its dive cache invalidated in copy_dive() and can't be the currently displayed dive. Therefore, this code is dead code and can be removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-08cleanup: remove count_divecomputers() functionGravatar Berthold Stoeger
There is a number_of_computers() function which does the same thing with two exceptions: 1) checks for null-dive 2) returns an unsigned int Replace calls to count_divecomputers() by calls to number_of_computers(). In one case, the return type makes a different - add a cast to int there. Ultimately, we should probably change the dc_number to signed int throughout the code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-08cleanup: when planning a dive, set dive computer to first dcGravatar Berthold Stoeger
When planning a dive, dc_number was set to 1, which actually is the second dc! The code seems to handle this gracefully, however it appears weird. Let's set dc_number to 0 instead. Originally, the assignment was introduced in a422957cd6525b9753 and moved later in 4f5621c4c6acc3a. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-06cleanup: make taxonomy_index_for_category() local to taxonomy.cGravatar Berthold Stoeger
This helper function is not used outside taxonomy.c anymore. Let's hide this implementation detail. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-06cleanup: use taxonomy_get_value() instead of taxonomy_get_index()Gravatar Berthold Stoeger
Instead of getting the index and using that to access values, use the taxonomy_get_value() helper function. Two places are affected: 1) reverse geo-lookup 2) location filter delegate The behavior of reverse geo-lookup is changed slightly: now an empty string is likewise recognized as missing "TC_ADMIN_L3". Before, only a missing category was interpreted as such. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-06cleanup: create taxonomy_get_value() functionGravatar Berthold Stoeger
This is the counter-part to taxonomy_set_value(). Let taxonomy_get_country() be the first user of the function. If a category doesn't exist, return NULL. Small addition: make taxonomy_get_countr() take a const argument. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-06cleanup: use taxonomy_get_country() in get_dive_country()Gravatar Berthold Stoeger
get_dive_country() was essentially a reimplementation of taxonomy_get_country(). Let's just use the already existing function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-06cleanup: use taxonomy_index_for_category() in taxonomy_set_category()Gravatar Berthold Stoeger
Instead of recoding the "search for category" loop, reuse the already existing functionality. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-06cleanup: make alloc_taxonomy local to taxonomy.cGravatar Berthold Stoeger
The alloc_taxonomy()/free_taxonomy() interface was exceedingly strange. The former gave a "struct taxonomy", the latter took a "struct taxonomy_data". To make things worse, is appears as if the names "taxonomy" and "taxonoma_data" are reversed: the latter contains the former. In any case, the alloc_taxonomy() call is not needed anymore from outside taxonomy.c, as these memory-management details are now hidden in accessor functions. Therefore, make the function local to taxonomy.c. Moreover, rename it to "alloc_taxonomy_table()" and let it take a "taxonomy_data" structure for symmetry with "free_taxonomy()". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-06cleanup: use taxonomy_set_category() functionGravatar Berthold Stoeger
Instead of manipulating the taxonomy structures directly, use the taxonomy_set_category() function. This improves encapsulation and gives us the possibility to improve the taxonomy data structures. This concerns three places: 1) git parser 2) XML parser 3) reverse geo-lookup This improves the XML parser code slightly: The parser assumes that the value-attribute comes last (after origin and category). While it still does that, it now at least generates a warning if it encounters a value-attribute without origin- or category-attribute. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-06cleanup: copy string in taxonomy_set_[country|category]Gravatar Berthold Stoeger
These functions were taking a const char *, yet taking ownership of the value. Moreover, taking ownership of strings is rather unusual in C-style APIs. Let's copy the string instead. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>