aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-06-21android/desktop: remove mapWidget from subsurface.qrcGravatar jan Iversen
remove mapWidget entries from subsurface.qrc, and add reference to map-widget.qrc in CMakelist.txt Android uses the same CMakelist.txt Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-21mobile: remove MapWidget from mobile-resources.qrcGravatar jan Iversen
remove MapWidget entries from mobile-resources.qrc, and reference map-widget.qrc in Subsurface-mobile.pro for iOS Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-21map-widget: add qrc file for widgetGravatar jan Iversen
Make map-widget self contained, with its own qrc file. Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-22Dive pictures: fix loading of remote images without local versionGravatar Berthold Stoeger
Owing to the recent churn in imagedownloader.cpp, some of the code was bogus. Notably, in f60343eebbf6a31a4643dde9f4454f6ce84f61d3 the code was changed such that always the local filename was used to access the images. Yet, the old code remained, which after failure tried again to access the local picture. This second access can obviously be removed completely. More seriously, after failing to load the local version, no attempt was made to fetch the image via canonical filename. This could produce the following sequence of events: - Import remote image - Delete thumbnail and local cache of image - Image loading would fail Therefore, first try to load using local file-location. If that fails, load using the canonical file-location. To do so, split the file-access code in two functions. The code should now be distinctly easier to follow. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-21mobile: iOS/Android: always delete libdivecomputer.log at startGravatar Dirk Hohndel
This way the user doesn't inadvertantly end up with information from a previous run of Subsurface-mobile when they copy the logs to the clipboard. Not sure we should do the same when building for desktop, so right now it's only when building for a device. Reported-by: Thomas Fänge <thomas.fange@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-21FTDI support: try ftdi_open first if the device name is 'ftdi'Gravatar Dirk Hohndel
It makes no sense to have the OS try (and fail) to open that device name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-21core: print the correct message code for download failuresGravatar Dirk Hohndel
We filled in the missing information and then printed the wrong string. This fixes that and also makes the strings slightly easier to understand. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-21mobile: better message regarding logfilesGravatar Dirk Hohndel
On mobile those area always created and available for simple cut and paste. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-21Update libdivecomputer submoduleGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-21Revert "cleanup: remove empty function"Gravatar Anton Lundin
This broke our hook to plumb in our usb open function into libusb, so this broke ftdi based downloads. This reverts commit e4530cd5ef38e6120f451daf1a758b38b70a6f1c. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-06-21mobile/ios: correct whitespaces to coding standardGravatar jan Iversen
correct whitespaces to coding standard in translations.qrc, qml.qrc and deployment.pri Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-20qt-ble: purge pending read data when writingGravatar Linus Torvalds
This should never happen, since our interface is bassically synchronous, but it could happen with delayed replies that came in just after we decided to re-transmit a command. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-06-20qt-ble: improve responsiveness of waiting for bluetooth dataGravatar Linus Torvalds
Our model of waiting for 100ms before re-checking if we got a packet over BLE resulted in potentially horrendously bad latency for received packets. That isn't just a possible performance issue, it actually seems to cause IO errors with my Suunto EON Core. I'm not entirely sure why, but it might simply be some timing interaction, particularly since the IO errors seemed to primarily happen when the dive computer itself was also busy updating the screen (ie if you pressed buttons on the dive computer to switch to compass mode, for example). So replace the silly hardcoded 100ms "waitFor()" function with a WAITFOR() macro that checks the provided expression every time through the loop, which gets us a much lower latency (we basically check every ten milliseconds). The macro is not beautiful, but it WorksForMe(tm). This makes a huge difference to the reliability of the download for me, and might matter for some other dive computers too. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-06-20QML UI: remove unused propertyGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20QML UI: ensure we track vendor/product for downloadGravatar Dirk Hohndel
This is based on something that Anton Ludin sent to the mailing list. Reading through the code it seemed that there were scenarios in which DC_vendor and DC_product were not updated correctly. That's one of the problems of the declarative approach in QML - it can be very hard to figure out which code is run when in certain situations. This may help address the issue with FTDI downloads no longer working on Android. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20QML UI: improve banner in global drawerGravatar Dirk Hohndel
The asynchronous load seemed to be (at least one of) the culprit(s) of the banner occasionally not showing up. Making the font for the cloud ID smaller looks better (and works much better for long email addresses). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20Update CHANGELOG.mdGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20QML UI: store nocloud data when adding cloud credentialsGravatar Dirk Hohndel
We want to allow people to keep dives they collected without a cloud account. The code was mostly there, we just got confused about the existing status because we ran through this twice (no cloud -> unknown -> verified). This way we explicitly remember this kind of transition. Fixes #1404 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20QML UIL: fix more problems with members moving from manager to prefsGravatar Dirk Hohndel
That change clearly would have benefited from better code review. This is a superset of a change proposed by Jan Iversen. Closes #1406 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20CHANGELOG.md: add note about fixing a MAX_TANK_INFO bugGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-06-20equipment: use MAX_TANK_INFO in equipment.cGravatar Lubomir I. Ivanov
MAX_TANK_INFO is defined in dive.h but is not used in add_cylinder_description() or when allocating 'tank_info'. Use MAX_TANK_INFO instead of the literal 100. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-06-20equipment: sanitize 'ws_info' loop limitsGravatar Lubomir I. Ivanov
Instead of a constant or a macro for the maximum number of 'ws_info' elements the 100 literal was used. Define MAX_WS_INFO in dive.h and use it everywhere. Also clamp loops that iterate `ws_info' to MAX_WS_INFO. Prevents potential out-of-bounds reading, similarly to the previous commit about 'tank_info'. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-06-20equipment: sanitize 'tank_info' loop limitsGravatar Lubomir I. Ivanov
In a number of places the global 'tank_info' array is being iterated based on a 'tank_info[idx].name != NULL' condition. This is dangerous because if the user has added a lot of tanks, such loops can reach 'tank_info[MAX_TANK_INFO]'. This is an out of bounds read and if the 'name' pointer there happens to be non-NULL, passing that address to a peace of code that tries to read it (like strlen()) would either SIGSEGV or have undefined behavior. Clamp all loops that iterate 'tank_info' to MAX_TANK_INFO. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-06-20core: add free_samples helperGravatar Dirk Hohndel
And use it in the UI and planner code. See #1411 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20mobile: set alloc_samples to 0 when resetting.Gravatar jan Iversen
set alloc_samples = 0 when settings dc->sample = 0 and dc->samples = 0 Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-20core: use num in alloc_samplesGravatar jan Iversen
When num > dc->alloc_samples we whould allocate space for num Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-18Update to CHANGELOG.mdGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18In dive picture shift time dialog suppress double triggering of timeEditGravatar Stefan Fuchs
In dive picture shift time dialog when pressing the up or down arrow of the timeEdit widged there is some risk of double triggering because the function called after this UI action ("updateInvalid()") can have quite some runtime. Suppress any potential double triggering by disabling the timeEdit widget after each change until the code is processed. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-06-18Switch mobile version to 2.1.0 in preparation for next releaseGravatar Dirk Hohndel
Apple typically forces a much more detailed review if the version number changes. Let's get this taken care of now as we prepare for release. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18Change from gettextFromC::instance()->tr() to gettextFromC::tr();Gravatar Stefan Fuchs
Code cleanup. Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-06-18Use correct "tr" call for translating dive mode namesGravatar Stefan Fuchs
Correctly use gettextFromC::instance()->tr(); instead of a simple tr(); to translate the dive mode names. This goes on top of 0bc9edf855caf95e2d58ccaf704ceeda079e06f1 and finally makes the whole thing work. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-06-18mobile: use full icon path.Gravatar Murillo Bernardes
For some reason Kirigami.Icon mess up icon display when filename extension is omitted. Because of this a perfectly good, scalable svg show up as a low resolution scaled up icon. Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-06-18mobile: move call to savePreferences back to manager.Gravatar jan Iversen
calls to savePreferences was moved to prefs. in b8eb348f546291c49e2d606649b3c85d23e43782, but the corresponding C++ code was not merged. Revert call to savePreferences to manager. Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-18mobile: revert e993d4f005e62c12765e2e45342ecf840476e3bfGravatar jan Iversen
The commit secured that plotDive was not called before actually being used. However our (rather fragile) C++ qml interface did not work correctly (ony sometimes). Revert the previous commit. Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-18Add CHANGELOG entryGravatar Dirk Hohndel
And edited some older ones for consistency. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18Travis: build mobile on Linux with newer gccGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18QML UI: show the cloud credentials in the global drawer bannerGravatar Dirk Hohndel
This is an additional side-benefit of rolling our own banner. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18QML UI: build our own icon and header for global drawerGravatar Dirk Hohndel
Kirigami appears to have a bug that makes it fail to show our icon. With this we can be much more flexible in what we show in the top area of the global drawer. Fixes #1331 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18build-system: add another Kirigami hackGravatar Dirk Hohndel
We want to be able to roll our own banner image, logo, title, and other information in the GlobalDrawer - but Kirigami adds an ugly margin around that. This attempts to remove that margin (but for some reason there is still a margin on the left side). This requires the patch command to be installed, but because of the context sensitivity of the changes, I couldn't figure out how to do this with sed or perl (which we already require). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18QML UI: update to newer KirigamiGravatar Dirk Hohndel
This seems equally stable to what we have and doesn't appear to introduce any new breakage. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18Whitespace cleanupGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18libdc interface: remove debug messagesGravatar Berthold Stoeger
Don't spill supported transports as error message to the user. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-17build-system: use common code to download tarballsGravatar Murillo Bernardes
Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-06-17mobile: add Dark_gps.svgGravatar jan Iversen
The blue gps was reused for the dark theme. Copy Blue_gps.svg and change color to dark. Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-17CHANGELOG: update with end-user relevant PR`sGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-17Pull latest translations from TransifexGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-17build-system: avoid checkout when unneededGravatar Murillo Bernardes
Checkout only if current checked out version differs from expected. Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-06-17build-system: add function to checkout from gitGravatar Murillo Bernardes
git clone/checkout code was mostly the same copied over and over. Move code to a single common function Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-06-17Update translation source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-17Dive computers: turn QMultiMap into sorted vectorGravatar Berthold Stoeger
The list of known dive computers was stored in a multi-map indexed by the device name. Turn this into a sorted QVector. Thus, no map-to-list conversion is needed in the device editing dialog, which distinctly simplifies the code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>