summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-05-26XML start tag does not have new line before headerGravatar Miika Turkia
When Subsurface adds start tag to CSV file, there is no new line after it. Thus changing XSLT to parse this way. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Print correct template name on CSV exportGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Trip support for CSV export of dive detailsGravatar Miika Turkia
Debugging the tests with new test dive, I noticed that CSV export does not work, if the exported XML includes trips. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Use single cylinder dive for testsGravatar Miika Turkia
Now that CSV export supports multiple cylinders and import doesn't, we need a test dive with single cylinder in it. (Multi-cylinder import from CSV will be supported for Subsurface style CSV export only, and not generic exports that are used here.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Initialize variable to silence compiler warningGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Add multicylinder support for Subsurface CSV importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Take SAC into account on SubsurfaceCSV importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26Multi cylinder support for CSV exportGravatar Miika Turkia
Fixes #2830 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-26CSV export: Split printing of headerGravatar Miika Turkia
This will split the printing of header for CSV export. Cylinder information is printed by itself allowing me to later print it in a loop as many times as there are cylinders. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-25mobile/credentials: email address must be lower caseGravatar Dirk Hohndel
I could have sworn that I have fixed this several times in various places, but apparently (as shown by todays support emails) it's still possible to setup a mixed case email address. So let's try to solve this problem at the very top. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-25cleanup: whitespace fixes in TabDiveInformationGravatar Berthold Stoeger
Use C-style function definitions (squirly brackets on new lines) and remove empty lines at end of file. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-25desktop: localize salinity valueGravatar Berthold Stoeger
The salinity value was not displayed with localized thousands separators. E.g. to a user of a German locale the density read as slightly over 1 g/l, when it should be approximately 1000 g/l. For consistency, also localize that value. Also localize the CNS and OTU numbers, even though these should (hopefully!) never come with thousands separators. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-22cleanup: constify time_during_dive_with_offset() functionGravatar Berthold Stoeger
There is no reason to pass a non-const dive pointer as first argument. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-22cleanup: remove unused function get_dive_n_near()Gravatar Berthold Stoeger
The last caller was removed in 7eb422d98837b3cfb289a66fa0f3a8f78f222001. Since this is the only caller of dive_within_time_range(), remove that function as well. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-22cleanup: create common QDateTime -> timestamp conversion functionGravatar Berthold Stoeger
In analogy to the timestamp -> QDateTime conversion, create a common function. 1) For symmetry with the opposite conversion. 2) To remove numerous inconsistencies. 3) To remove use of the deprecated QDateTime::toTime_t() function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-22cleanup: remove unused libc-structures from get_trip_date_string()Gravatar Berthold Stoeger
This must be an artifact from before using Qt's datetime functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-22cleanup: move timestampToDateTime() to qthelper.cppGravatar Berthold Stoeger
Move this function from maintab.cpp to qthelper.cpp. Since the functionality was used in numerous places, use the helper function there as well. This removes a number of inconsistencies. For example, sometime setTimeSpec(Qt::UTC) was called, even though the QDateTime object was already created with that time spec. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-22Fix incorrect Farenheit to Kelvin formula.Gravatar Paul Buxton
Use defined function instead. Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
2020-05-22desktop: update date and time fields if user changes formatGravatar Berthold Stoeger
This was more painful than expected, because we get the "preferences" changed signal too early when the user switches to system format. The correct format is set by the preferences-widget, not the preferences subsystem. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-22desktop: refresh date/time format when switching to system defaultsGravatar Berthold Stoeger
When switching to system defaults, refresh the fields in the preferences UI so that the user can tell how the fields will be formatted. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-22cleanup: set long and short date formats in independent branchesGravatar Berthold Stoeger
The short and long date formats where initialized in a common if-branch. However, inside the if-branch the code rechecked which of the two should be initialized. This could make sense if there was some common code between the two, but there wasn't. Therefore, make this two independent branches to avoid one nesting-level. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-18update CHANGELOGGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-18mobile/dive-edit: use template components and theme colorsGravatar Dirk Hohndel
Another small step to make the dark theme at least marginally useful. We now use our template components and add the necessary elements to have consistent text color. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-18mobile/UI: correctly theme template spin boxGravatar Dirk Hohndel
This was all hard coded and wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-18mobile/dc-download: fix dark theme appearanceGravatar Dirk Hohndel
I noticed that the download from dive computer page looked especially bad in the dark theme (a user sent us some screenshots for a different reason) and a quick look at the sources showed that we weren't using our template label. Switching to that gives us the correct size by default so we can drop all those explicit font size parameters. And we get the correct color as used in the theme. One random whitespace cleanup snuck into this commit. Oh well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-18Use stored SAC for validationGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-18TestParse to support SACGravatar Miika Turkia
Take into account the added SAC field in dive detail CSV export. Note that we do a test of: - export to CSV file - import the written CSV file - export the newly read data to second file - compare these two exported files As SAC information is not currently read from any import, this adds the SAC value to the imported data before exporting again. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-18CSV export: include SAC when exporting dive detailsGravatar Miika Turkia
Simply adds SAC field to CSV export of dive details. Fixes #2829 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-18format for readabilityGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-05-17add missing CHANGELOG entryGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-17mobile: update version to 3.0.7Gravatar Dirk Hohndel
Required by the app stores after a release. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-17BLE: trivial updates to the GATT services listsGravatar Linus Torvalds
Add a couple of known services (Scubapro G2 and Shearwater), and update the names of others that turn out to be used for multiple dive computers. Also add another Broadcom upgrade service UUID. While at it, sort the services numerically to make it easier to see that a UUID already exists, since these service numbers do get used across multiple different devices. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-05-17BLE: add list of known good/bad BLE GATT servicesGravatar Linus Torvalds
We've tried to do this "automagic" service discovery, and it mostly works, but then occasionally it doesn't. Making things worse, I think different platforms end up enumerating services differently, so our "pick the first service that looks like it might be a serial service" ends up working on some platforms, but not necessarily on others. Because "first" might be different. So start a list of known good/bad services - and fall back to the old logic when you can't decide reliably. This fills in juat a few cases that I can easily check myself, and the "details" field for them may be incomplete. For example, I know Nordic Semiconductor has their vendor-specific UUIDs, and they can be found in different devices, so calling them "Nordic UART" and "Nordic Flash" services makes sense. But the "Scubapro i770R" service? It might indeed be specific to the Scubapro i770R. Or it might be a general service UUID that Pelagic uses. Or it might be the service UUID of a particular chip, and found in dive computers from other designs too (and not necessarily in all i770R's either). So this is a preliminary first stab at this, and I'm sure we'll extend the list and possibly improve on the explanations. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-05-16filter: properly search for tagsGravatar Berthold Stoeger
The old code used get_taglist_string() and split the resulting string at commas to get the list of tags. This was wrong for two reasons: 1) It was buggy. Every tag but the first would start with a leading space and thus not be found. 2) It was inefficient. The tag list was concatenated, just to be split again. Turn the tag list directly into a QStringList and remove whitespace for good measure. Fixes #2842. Reported-by: Hartley Horwitz <hhrwtz@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-16filter: include tags in fulltext searchGravatar Berthold Stoeger
The tags have been forgotten when implementing the fulltext search. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-16desktop: don't call plotDive with doClearPictures = trueGravatar Berthold Stoeger
This was an old "optimization" to avoid double plotting of the pictures, first by the profile itself, then by the picture tab. Since the profile now updates the pictures itself, this must be removed: The picture tab doesn't do it anymore. Fixes #2833 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-16cleanup: use pointer-to-member style connect for ComboBoxDelegateGravatar Berthold Stoeger
This was still using the archaic macro version, because Qt decided to parameter-overload the signals (which turned out to be a horrible idea). However, since we switched to fairly recent Qt this can be solved using the qOverload template. In this case things are a bit more complicated because we overload the corresponding slots. Since we have control over that, let's just disambiguate their names instead of using the cryptic qOverload. While doing this, tighten the access specifiers of the slots. Turn public into private and protected as appropriate. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-16cleanup: make overridden functions in model delegates privateGravatar Berthold Stoeger
There is no point in calling these functions directly, so we can just make them private. Morover, add override specifiers were they were missing and remove a pointless default parameter to the testActivation() function. It was not used anywhere. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-16cleanup: whitespace fixes in modeldelegates.[cpp|h]Gravatar Berthold Stoeger
We put the pointer and reference modifier to the variable, not the type. Some people don't like this, but 1) This is consistent with the rest of the code base. 2) This is how C and C++ parse, love it or hate it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-15cleanup: remove redundant model source files in CMakeLists.txtGravatar Berthold Stoeger
The divetripmodel.cpp, models.cpp and tankinfomodel.cpp source files as well as the corresponding headers were listed as "general" and as "desktop" models, i.e. twice. Remove the redundant entries in the desktop list. This should have no consequence whatsoever. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-15cleanup: replace to "dive.h" includes by more specific includesGravatar Berthold Stoeger
The weightsystem- and cylinder-model headers were including "dive.h". Inclusion of "equipment.h" is sufficient though. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-15core/bt: ensure that BT/BLE addresses with name sort firstGravatar Dirk Hohndel
We don't order the list of addresses alphabetically, but we want to ensure that devices that offer us a name are listed before those that don't. This should only be relevant if the user selects the option to show all BT/BLE devices, not just recognized dive computer, because if we recognize a computer we always have the product name prepended to the address. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-15core/bt: always add bt name for devicesGravatar Dirk Hohndel
If the user asks to have all BT/BLE devices shown, we should behave consistently to the case of a recognized dive computer and always show the device name. In almost all cases the BT/BLE address (and even worse on iOS/macOS the weird uuids) are completely meaningless. If there isn't a name, don't add a leading space in order to make it easy to detect if we have an address without a name (which almost certainly isn't a dive computer, so it should be towards the end of the list of addresses - which will be handled in a later commit). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-15core/bt: match DC descriptor in lower caseGravatar Dirk Hohndel
This fixes a rather subtle bug. In btdiscovery.cpp we are detecting dive computers based on their BT name and are setting up product+vendor as the key for that lookup. QMap always uses case sensitive comparisons and a tiny inconsistency snuck into our code. libdivecomputer names for the Aqualung dive computers i200C / i300C / i550C end in an upper case C (as matches the official branding), but in btdiscovery.cpp we have those names with lower case c. And therefore didn't recognize these dive computers. Obviously this is easy to fix by fixing those three strings, but I decided that it was silly to set ourselves up for similar oversights in the future. So instead I switched the matching of the descriptor to simply be allways all lower case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-14Save SAC, OTU and CNS in the XML exportGravatar Linus Torvalds
We do _not_ read them back, since they are calculated values, although I guess we could aim to do that too at some point in case we have an import from somewhere else that has these values but not the profile (or gas use) to actually calculate them. Fix test-cases that are checked by TestParse (but nothing else) to match. Requested-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-05-14Update CHANGELOGGravatar Dirk Hohndel
This includes cleaning up the old CHANGELOG I forgot to delete for the release as well as mentioning the libdivecompute updates. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-14mobile/dive-details: show tagsGravatar Dirk Hohndel
So far the user can't edit them, but at least they are now shown as part of the dive details. Usage of tags varries widely, I've seen people who use a LOT of tags to classify their dives, so I'm giving this a complete row by itself. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-14mobile/models: add access to tags stringGravatar Dirk Hohndel
We already allow filtering by tags, but don't even show them on mobile. That seems rather inconsistent. First step is to make the tags available to the QML layer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-14mobile/dive-details: less whitespace at the topGravatar Dirk Hohndel
This always seemed odd - the location looked like it sat 'low' on the screen. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-14mobile/dive-details: use our labels to create denser displayGravatar Dirk Hohndel
This makes better use of the screen real estate, without (IMHO) seeming too crowded. This is a tough balance to strike. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>