aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-03-14Update translation source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-13Remove now obsolete scriptGravatar Dirk Hohndel
With the removal of the transport tags from our libdivecomputer branch, we can no longer automate the table creation that way. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-13Update libdivecomputer submoduleGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-13Subsurface update for upstream libdivecomputer changesGravatar Linus Torvalds
So because I merged with upstream libdivecomputer, and it no longer does the "halfduplex emulation" thing in the IO layer, and instead does it in the only Suunto backend that needed it, that also affected our custom IO layer in subsurface. Sure, I could have left a dummy interface and left subsurface with some ugly dead code, but it's really better to just get rid of the code. So when Dirk pulls in the libdivecomputer updates from https://github.com/torvalds/libdc-for-dirk.git Subsurface-branch this patch to remove the halfduplex code in subsurface is also needed. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-13Treat a PSCR dive with sensors more like a CCR diveGravatar Anton Lundin
PSCR dives with o2 sensors are more like CCR dives. The math is exactly the same, its just a different diluent and a different po2. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-03-13Fix up CCR/PSCR dives with sensors values without no_o2sensorsGravatar Anton Lundin
This introduces a fixup function that walks all the samples and populates the no_o2sensors if its zero and supposed to be something else. There is a bug somewhere which Willem hit, causing this to never be set. Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-03-13Use the current dive mode instead of constantGravatar Anton Lundin
In the if case above, we already conclude its a OC dive, but its cleaner to actually pass the current mode instead of a hard coded value. This also makes the code less prune to future bugs. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-03-12Mobile: pass QString as value to registerError()Gravatar Berthold Stoeger
registerError() may be called from a different thread context. Passing the message as a const-reference may lead to a dangling reference. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-11android/build.sh: build the googlemaps pluginGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11CHANGELOG.md: add note about the map widget changesGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11cmake: update CMake to build the map components on mobileGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11subsurface-mobile-helper: register map related typesGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11main.qml: handle mapPage in pageStack.onCurrentItemChanged()Gravatar Lubomir I. Ivanov
When the slot pageStack.onCurrentItemChanged() is reached make sure that the stackView becomes non-interactive. This prevents swiping left on the map to "go back". Also, always reload the map markers when the map becomes visible. This is not optimal and instead something in the lines of: DiveList.model.onChanged() is a much better solution. Ideally the map reload should happen on dive removal, dive addition, dive edits and sync from cloud. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11main.qml: add a drawer action for the mapGravatar Lubomir I. Ivanov
This action uses the Breeze icon "map-globe.svg" and calls showMap(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11main.qml: modify showMap() to not accept locationGravatar Lubomir I. Ivanov
showMap() uses a location to open Google Maps in a browser. Make showMap() a generic function to push the mapPage on the view stack. Update the calls to this function from child widgets and pages. Also either call mapPage.centerOnLocation() or mapPage.centerOnDiveSiteUUID() depending if the caller wants the map to center on a dive site or on map coordinates. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11main.qml: create an instance of MapPageGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11mobile-resources.qrc: add the map related resources for mobileGravatar Lubomir I. Ivanov
1) QML files 2) Map widget specific icons 3) The Breeze map-globe.svg icon Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11mappage.qml: add a Kirigami page for the map widgetGravatar Lubomir I. Ivanov
The Page object has the following functionality: - reloadMap(): reload all map markers. - centerOnDiveSiteUUID(): center the map on a dive site uuid. - centerOnLocation(): the map on a latitude, longitude in decimal. - Select a dive list entry based on a marker selected on the map via diveList.setCurrentDiveListIndex() Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11mapwidget.qml: emit a signal when the marker changedGravatar Lubomir I. Ivanov
The signal to emit is selectedDivesChanged() and it accepts a list if diveIds. The 'nSelectedDives' counter is redundant. Also expose the 'map' and 'mapHelper' objects as aliases. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11divelist.qml: add the setCurrentDiveListIndex() helperGravatar Lubomir I. Ivanov
Add the setCurrentDiveListIndex() wrapper for: diveListView.currentIndex = idx wich also makes it possible to disable the scroll animation when selecting dive list indexes which are too far apart. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11qmapwidgethelper: make adjustmets for the mobile versionGravatar Lubomir I. Ivanov
The mobile version is limited as it does not support dive list selection of multiple dives and editing multiple dives. Also the dive list on mobile does not follow the same indexing as the desktop version dive list. Use the SUBSURFACE_MOBILE macro and for: - centerOnDiveSite() either deselect map markers or center on a single one (never on a rectangle like the desktop version) - selectedLocationChanged() and selectVisibleLocations() return a list of single dive ID Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11qmapwidgethelper: add centerOnDiveSiteUUID()Gravatar Lubomir I. Ivanov
centerOnDiveSiteUUID() is a helper to center the map on a dive_site UUID instead of a dive_site pointer. Make it call centerOnDiveSite(). Make both this function and reloadMapLocations() Q_INVOKABLE as these are going to be called from QML. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11qmapwidgethelper: move includes to the headerGravatar Lubomir I. Ivanov
Add the following includes in the header - <QVariant> and <QGeoCoordinate> otherwise the mobile build fails. It is unclear how the desktop build does not complain about this. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11DiveObjectHelper: add dive_site_uuid()Gravatar Lubomir I. Ivanov
The map widget on the mobile version requires that a dive object from a model has a dive_site uuid. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-11scrips/mobilecomponents.sh: fetch icon for the mapGravatar Lubomir I. Ivanov
Use one of the breeze icons for the map in the drawer on the mobile version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-03-07Release notes for numeric format, delete cylinders and change commentGravatar Stefan Fuchs
Add two release note items and change comment in CHANGELOG.md file. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-06Cosmetic modifications in profile delta sample stringGravatar Stefan Fuchs
Consistently do not use a space between value and unit. Consistently do not use a space between "name:" and value. Add "/min" for SAC rate. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-05Cleanup: Remove hash field from picture-structureGravatar Berthold Stoeger
The hash field in the picture-structure was in principle non-operational. It was set on loading, but never actually changed. The authoritative hash comes from the filename->hash map. Therefore, make this explicit by removing the hash field from the picture structure. Instead of filling the picture structure on loading, add the hash directly to the filename->hash map. This is done in the register_hash() function, which does not overwrite old entries. I.e. the local hash has priority over the save-file. This policy might be refined in the future. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Cleanup: pass QString and QByteArray const-refs to qthelper functionsGravatar Berthold Stoeger
Passing of QStrings and QByteArrays was inconsistent in qthelper.cpp. Unify to passing const-references. Passing by value is no big deal, since QString and QByteArray do copy-on-write "optimization". Nevertheless, let's keep it as consistent and effective as possible. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Cleanup: Fold add_hash() call into learnHash() functionGravatar Berthold Stoeger
learnHash() was always called in conjunction with add_hash(). The pattern was that a local filename and a hash were connected in the hash-to-filename and the filename-to-hash maps. Then, the original picture-filename or url were registered in the filename-to-hash map. This commit changes learnHash() to take three parameters (original-filename, local-filename and hash) and do all of the above. The new code is simpler because no dummy picture struct has to be generated in DiveListView::loadImageFromURL(). The tests were extended to check for all hash<->filename associations. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Cleanup: Don't store hash in picture struct in learnHash()Gravatar Berthold Stoeger
learnHash() is called either on a local picture structure [DiveListView::loadImageFromURL()] or on a cloned picture structure [ImageDownloader::saveImage()]. In neither case the picture structure is passed to the frontend. Therefore, storing the new hash in the picture struct is not necessary. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Cleanup: Don't call learnHash() in hashPicture()Gravatar Berthold Stoeger
hashPicture() calls hashFile(), which calls add_hash(). add_hash() updates the filename-to-hash and hash-to-filename maps. Therefore, there is no point in calling learnHash() in hashPicture(), which updates the filename-to-hash map. Note that learnHash() updates the picture-struct with the new hash, but since hashPicture() works on a cloned picture-struct, which is free()d in hashPicture(), these changes are lost anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Cleanup: remove updateHash() functionGravatar Berthold Stoeger
updateHash() and hashPicture() did the same thing, with the exception that hashPicture() marked the dive list as changed if a hash changed. This seems like a good idea in any case, therefore always use hashPicture(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Cleanup: Make helper function haveHash() of static linkageGravatar Berthold Stoeger
The function is only used in the qthelper.cpp translation unit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05core/imagedownloader.cpp: Use signal to exit eventloopGravatar Berthold Stoeger
Don't do busy-waiting. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05core/imagedownloader.cpp: Use implicit default constructor of QImageGravatar Berthold Stoeger
No point in move-constructing from a different default constructed QImage. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05core/imagedownloader.cpp: remove recursionGravatar Berthold Stoeger
If loading from hash failed in the saveImage() slot(!) it would recurse into loadFromUrl(), which would generate a new network reply. Very scary and a (small) wonder that it worked. Let's try to make this all more explicit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05core/imagedownloader.cpp: Make the manager object local to load()Gravatar Berthold Stoeger
The QNetworkAccessManager is only used in the load() function. No point in it being a subobject. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05core/imagedownloader.cpp: Simplify deletion of objectsGravatar Berthold Stoeger
1) Destroying the QNetworkManager seems like a bug: this was a subobject of ImageDonwloader. It's mysterious how this didn't crash. 2) Instead of calling deleteLater() on the reply object, simply delete it after completion. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05core/imagedownloader.cpp: Fix memory leakGravatar Berthold Stoeger
A cloned picture struct would not be freed if the filename was already in the queued-for-download set. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Cleanup: Remove superfluous QString constructions in divetripmodel.cppGravatar Stefan Fuchs
Remove superfluous QString constructions in a couple of simple functions in divetripmodel.cpp Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-05Use correct numeric format based on selected locale (Qt domain part)Gravatar Stefan Fuchs
This changes the numeric format of many values printed to the UI to reflect the correct numeric format of the selected locale: - dot or comma as decimal separator - comma or dot as thousands separator In the Qt domain the `L` flag is used case specific mostly in qthelper.cpp. Then the helper functions get_xxx_string() are used more consistently. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-05Localization: implement *_loc() functions in plannernotes.cGravatar Berthold Stoeger
Replace snprintf() and put_format() by snprintf_loc() and put_format_loc(), respectively to localize formatting of integers and floats. Acked-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Localization: implement *_loc() functions in profile.cGravatar Berthold Stoeger
Replace snprintf() and put_format() by snprintf_loc() and put_format_loc(), respectively to localize formatting of integers and floats. Acked-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Localization: Make Qt's locale-aware formatting accessible from CGravatar Berthold Stoeger
This commit introduces functions: - QString asprintf_loc(const char *cformat, ...); - int snprintf_loc(char *dst, size_t size, const char *cformat, ...); - put_format_loc(struct membuffer *, const char *fmt, ...); and their va_arg equivalents, which use Qt's QString::arg() formatting options to render the strings. The snprintf_loc() function takes care not to truncate multi-byte UTF-8 encodings. Thus, on overflow, the resulting string might be shorter than size-1. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Configure DC dialog: Always correctly set update firmware buttonGravatar Stefan Fuchs
Always set the update firmware button correctly based on DC model. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-05Configure DC dialog: Add a few missing translationsGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-05Configure DC dialog: Change order of DCs and correct namesGravatar Stefan Fuchs
In the configure dive computer dialog change the order of the DCs (all HW first, then Suunto) and correct the names of some HW DCs (make them the same as in the "download from DC selection list"). Plus added the OSTC Plus to the list of supported DC. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-04Indentation fix in desktop-widgets/downloadfromdivecomputer.cppGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-04Correctly spell OSTC cRGravatar Stefan Fuchs
Correctly spell OSTC cR (wrong: "Cr") in two files. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>