aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-05-14Small whitespace cleanupGravatar Dirk Hohndel
Stumbled across this when Qt Creator re-saved the file. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-14Core: introduce new subsurface-string headerGravatar Dirk Hohndel
First small step to shrinking dive.h. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-13Dive pictures: Don't update all pictures on drag & drop to profileGravatar Berthold Stoeger
In the old code, we used to reload the whole picture list on drag & drop to the profile. Instead, only update the drag&dropped picture and repaint the profile-pictures. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: refactor image downloaderGravatar Berthold Stoeger
Instead of generating one ImageDownloader object per image to be downloaded and running every image download in a separate worker thread, use one global ImageDownloader object owned by the UI thread. The images are downloaded using event based IO (as probably was the intention of the QNetworkManager class). User-visible change: after download from the internet, the thumbnail is shown without having to change dives. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: Import camera iconGravatar Berthold Stoeger
Import a camera icon from the KDE breeze theme, which is licensed under the LGPL. Use this icon to display not-yet-loaded images in the photos tab and the profile. Source: https://github.com/KDE/breeze-icons Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: Move thumbnail-size to Thumbnailer classGravatar Berthold Stoeger
The size of the to-be-created thumbnails was passed from DivePictureModel to Thumbnailer. This became more and more bothersome, because the size had to be stored with the request. Calling from Thumbnailer into DivePictureModel was not an option, since this is not linked to all tests. Therefore, move these functions to the Thumbnailer class. Since the maximum thumbnail size is now known to the thumbnailer, the dummy and failure images can be precalculated, which makes switching between dives faster. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: Update pictures when thumbnails are readyGravatar Berthold Stoeger
Connect the thumbnailer signal to the dive picture model slot. This needs some code-reshuffling in the dive picture model. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: Introduce thumbnailer classGravatar Berthold Stoeger
Create a new class, which performs all thumbnailing code. This is mostly code reshuffling. Thumbnails are extracted either from a cache or thumbnail calculation is started in a worker thread. Since getHashedImage() is called from a worker thread it makes no sense to call subfunctions in yet another worker thread. Remove these calls. In contrast to the previous code, on error the background thread produces a failure image, but it is not yet shown. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: replace picture struct by QStringGravatar Berthold Stoeger
In imagedownloader.cpp the only thing we need from the picture struct is the filename. Therefore, use QStrings instead of the picture struct. This simplifies memory management. Remove the clone_picture() function, which is not needed anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: turn SHashedImage class into getHashedImage() functionGravatar Berthold Stoeger
SHashedImage was a subclass of QImage, which fetched the image according to the filename hashes. Turn this into a function, as this is much more idiomatic and flexible. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: remove close-button optimizationGravatar Berthold Stoeger
One close-button object was used for all dive pictures. This seems like a brittle premature optimization and the pixmap is shared anyway. Make the button a subobject of the dive picture object. Change the object-hierarchy to be based on QGraphicsItem instead of QObject. The QObject here is only used as a kludge to support signals and properties (the latter are necessary for animations). Remove a comment, which does not seem to be relevant after this change. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: Convert thumbnailHash to individual filesGravatar Berthold Stoeger
On startup, convert an old-style thumbnailHash to individual thumbnail files. Show a modal progress bar while doing so. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: save thumbnails to individual filesGravatar Berthold Stoeger
The old code loaded all thumbnails into memory at once. This does not scale to logs with thousands of pictures. Therefore, save the pictures to individual files and only load the currently needed pictures. Currently, this will make changing switching between dives slower, because the thumbnails are loaded from disk. In the future, it is planned to do this in a background thread without blocking the user interface. A notable difference to the old code: Thumbnails are now indexed by the image-hash (i.e. the content of the raw image) and not by the filename of the image. Thus, different paths to the same image should only be saved once. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Dive pictures: Scale thumbnails on demandGravatar Berthold Stoeger
To potentially conserve memory, don't keep copies of scaled thumbnails. Scale the thumbnails on demand. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13mobile: fix next icon prefixGravatar Murillo Bernardes
Icons used directly by Kirigami use /org/kde/kirigami as prefix. Ex: previous and next icons on header. Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-05-13iOS: fix "previous" button iconGravatar Murillo Bernardes
Icons used directly by Kirigami use /org/kde/kirigami as prefix. Ex: previous button on the GlobalDrawer. Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-05-13Update CHANGELOG.mdGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Desktop: On dive edit from the dive list or map, switch to new stateGravatar Berthold Stoeger
If "Edit dive" is selected from the dive list or the map view, switch to a new mode, which shows the dive infos and the profile. After the edit, switch back to the previous state. Fixes #1213 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13Desktop: Make "Edit dive" menu entry work for downloaded divesGravatar Berthold Stoeger
Confusingly, "Edit dive" did only work for planned / manually entered dives. Change this, but only start profile-editing for planned / manually entered dives. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13mobile: prevent Action buttons hijack after deleteGravatar Murillo Bernardes
This gets delete dive working properly. Kirigami passive notification ends up hijacking area where the "Add dive" or "Delete" or "Discard" buttons are shown. So after deleting a dive the "Undo" button from the notification keeps handling the touch events even when not visible. Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-05-12Update libdivecomputer submoduleGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-12Add Qt header so Q_OS_xxx macros workGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-12DC transport debugging messagesGravatar Dirk Hohndel
Show the transport types we support for each of the supported dive computers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-12Simplier way to get QT_VERSIONGravatar Cristian Ionescu-Idbohrn
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-05-11BLE: add EON Core and Mares Bluelink to detectionGravatar Dirk Hohndel
Detection isn't required, but it makes things easier. For the Mares dive computers we only see the Bluelink, so we can't tell which dive computer is connected to it. We guess "Quad", but the user can pick a different one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-11iOS: only DC_TRANSPORT_BLE is supportedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-11Mac: update build.sh to hack around autotools problemGravatar Dirk Hohndel
For reasons I cannot explain, running configure for libdivecomputer claims that certain feature tests pass, even though those features demonstrably aren't there. This is happening for two compiler warning flags (-Wrestrict & -Wno-unused-but-set-variable) as well as the test for clock_gettime. To work around this, we manually edit the config.h file and the created Makefile before building libdivecomputer. This happened on macOS 10.11.6 with clang-800.0.42.1 (part of Xcode 8.2.1). Tangentially related to: See #1263 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-11Add script to download/clone 3rd party libsGravatar jan Iversen
Using one script instead of having the downloads in all build.sh ensures consistency and lowers maintenance. Note: this script is not intented to be run directly, it is intented to be integrated in the various build.sh Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-11iOS: update weigth... weight to avoid warningGravatar jan Iversen
Seems the pro file was forgotten with the rename of weightsysteminfomodel.h Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-11iOS: corrected ^space to tabGravatar jan Iversen
Corrected to use correct code style. Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-10WhitespaceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-10iOS: cleaned/bumped versionsGravatar jan Iversen
Made versioning identical to scripts/build.sh Having the same version of 3rd party libraries across platforms secures a more stable product. Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-10iOS: removed local build of libxml2Gravatar jan Iversen
script/build.sh uses the builtin libxml2 and do not build locally, updated build.sh and Subsurface-mobile.pro to to the same. sadly enough xslt is not distributed for iOS so it must be built. Apart from simplifying the script it saves build time Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-10iOS: removed local build of sqllite3Gravatar jan Iversen
script/build.sh uses the builtin sqllite3 and do not build locally, updated build.sh and Subsurface-mobile.pro to to the same. Apart from simplifying the script it saves build time Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-10iOS: build.sh does not run configure for libdivecomputerGravatar jan Iversen
In a "virgin" repo incl. libdivecomputer, starting by running ios/build.sh caused an error in libdivecomputer, because autoreconf was never run. Changed build.sh to check if libdivecomputer/configure exist, if not run autoreconf Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-10Travis: remove flag for iOS that is no longer necessaryGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-10iOS: Allow change of bundle identifierGravatar jan Iversen
This patch allows users to set a bundle identifier, without opening Xcode (set as env. variable). If the env. variable is not set (like e.g. on Travis) it defaults to org.... Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-11Fixed erroneous comparison of cylinders and weight systems.Gravatar Oliver Schwaneberg
Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-05-11Corrected file name "weigthsysteminfomodel" to "weightsysteminfomodel"Gravatar Oliver Schwaneberg
Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-05-10Removed a duplicate include in maintab.cppGravatar Oliver Schwaneberg
Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-05-10Added Info.plist and Qt to .gitignoreGravatar jan Iversen
This prevents the generated Info.plist and user defined Qt from being accidently committed. Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-10Updated .gitignore to silence ios dirsGravatar jan Iversen
e.g. <repo>/build is already silenced, so it is natural to do the same for the iOS builds. Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-10iOS: use recommended variable for bundle IDGravatar Murillo Bernardes
We used to hard-code the bundle ID which meant that developers always had to manually override the bundle ID in order to be able to sign the iOS app for local testing. With this change, the official builds will continue to work without manually opening the project in Xcode, yet other developers will use the Apple-recommended format in order to set their own bundle ID. This is based on a suggestion by Murillo Bernardes. See #1246 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-09iOS: update build scriptGravatar jan Iversen
Use git repos and checkout corresponding tags where possible. Use more reliable servers to download source from. [Dirk Hohndel: refactored Jan's original commit in #1241] Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-09iOS: update build instractionsGravatar jan Iversen
Updated INSTALL to point at packaging/ios/README Updated README to 'facts' Deleted ios_build_instructions as they are covered in README [Dirk Hohndel: refactored Jan's original commit in #1241] Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-09mobile: show selected dive on details viewGravatar Murillo Bernardes
Call positionViewAtIndex in order to make the selected dive visible. Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-05-09iOS, set lowest deployment target to 8.0Gravatar jan Iversen
Define deployment target, instead of using user default. iOS 8.0 is the oldest supported platform Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-08Add a comment on building option -mobileGravatar Robert C. Helling
...to explain the difference between building the mobile version to run on desktop and crossbuild for a mobile OS. This should address #1247 Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-05-07Planner: Unify final ascent rates in plan() and fake_dc()Gravatar Berthold Stoeger
When generating fake profiles for manually entered dives, fake_dc() and plan() used different final ascent rates of 5 m/min and 4.5 m/min, respectively. This led to dives that were 6 seconds longer than entered by the user and to confusion. See #554. Therefore, use the same ascent rate taken from the preferences field flag.ascratelast6m in both cases. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-07Fix CCR setpoint display bugGravatar Willem Ferguson
1) The connection for the display of CCR-setpoint o2SetpointGasItem was erroneous, being connected to partialpressuregasSettings. It is now correctly connected to technicalDetailsSettings. 2) The colour of the setpoint graph is changed from PO2_ALERT (red) to an orange colour in order to show setpoint in red only when it exceeds 1.6. This emphasises the visibility of red parts of the gas pressure graphs whenever gas limits are exceeed. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>