Commit graph

13946 commits

Author SHA1 Message Date
Dirk Hohndel
543cefa61e Android: build fix
On other OSs this compiles fine without adding this header, but Android
is special...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-14 10:13:39 -07:00
Dirk Hohndel
ea83b5ed37 Core: remove dive.h from files that don't need it
Of course, quite a few of them indirectly get it through other header
files.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-14 10:13:39 -07:00
Dirk Hohndel
be64f6f3c0 Small whitespace cleanup
Stumbled across this when Qt Creator re-saved the file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-14 10:13:39 -07:00
Dirk Hohndel
d577467f97 Core: introduce new subsurface-string header
First small step to shrinking dive.h.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-14 10:13:39 -07:00
Berthold Stoeger
c71a5d7413 Dive pictures: Don't update all pictures on drag & drop to profile
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-13 13:52:35 -07:00
Berthold Stoeger
d33e3b22fc Dive pictures: refactor image downloader
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-13 13:52:35 -07:00
Berthold Stoeger
19fa2966ef Dive pictures: Import camera icon
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-13 13:52:35 -07:00
Berthold Stoeger
b450c155fd Dive pictures: Move thumbnail-size to Thumbnailer class
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-13 13:52:35 -07:00
Berthold Stoeger
afe20ce029 Dive pictures: Update pictures when thumbnails are ready
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-13 13:52:35 -07:00
Berthold Stoeger
3967b1fd4d Dive pictures: Introduce thumbnailer class
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-13 13:52:35 -07:00
Berthold Stoeger
f60343eebb Dive pictures: replace picture struct by QString
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-13 13:52:35 -07:00
Berthold Stoeger
5d372cfda3 Dive pictures: turn SHashedImage class into getHashedImage() function
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-13 13:52:35 -07:00
Berthold Stoeger
630862971f Dive pictures: remove close-button optimization
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-13 13:52:35 -07:00
Berthold Stoeger
e811c7306d Dive pictures: Convert thumbnailHash to individual files
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-13 13:52:35 -07:00
Berthold Stoeger
6618c9ebfc Dive pictures: save thumbnails to individual files
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-13 13:52:35 -07:00
Berthold Stoeger
c0bca3ad04 Dive pictures: Scale thumbnails on demand
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-13 13:52:35 -07:00
Murillo Bernardes
6b4e830670 mobile: fix next icon prefix
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-13 13:18:01 -07:00
Murillo Bernardes
944de155d7 iOS: fix "previous" button icon
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-13 13:18:01 -07:00
Berthold Stoeger
d4a6822fab Update CHANGELOG.md
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-13 13:13:18 -07:00
Berthold Stoeger
57bf174c4f Desktop: On dive edit from the dive list or map, switch to new state
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-13 07:08:34 -07:00
Berthold Stoeger
9d342d0e1a Desktop: Make "Edit dive" menu entry work for downloaded dives
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-13 07:08:34 -07:00
Murillo Bernardes
d2d2e3af3d mobile: prevent Action buttons hijack after delete
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-13 07:03:15 -07:00
Dirk Hohndel
d387ec5791 Update libdivecomputer submodule
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-12 21:14:30 -07:00
Dirk Hohndel
2d253c71ff Add Qt header so Q_OS_xxx macros work
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-12 21:09:14 -07:00
Dirk Hohndel
adf3d945e1 DC transport debugging messages
Show the transport types we support for each of the supported dive computers.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-12 21:09:14 -07:00
Cristian Ionescu-Idbohrn
aa96aa3ac3 Simplier way to get QT_VERSION
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-05-12 19:45:28 +03:00
Dirk Hohndel
cef6dff762 BLE: add EON Core and Mares Bluelink to detection
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-11 22:18:19 -07:00
Dirk Hohndel
e6cb98ea4b iOS: only DC_TRANSPORT_BLE is supported
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-11 21:32:04 -07:00
Dirk Hohndel
387aee4cdf Mac: update build.sh to hack around autotools problem
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-11 21:08:41 -07:00
jan Iversen
2408134014 Add script to download/clone 3rd party libs
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-11 10:44:55 -07:00
jan Iversen
b39e7ac281 iOS: update weigth... weight to avoid warning
Seems the pro file was forgotten with the rename of weightsysteminfomodel.h

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-11 07:37:18 -07:00
jan Iversen
8341165999 iOS: corrected ^space to tab
Corrected to use correct code style.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-11 07:23:08 -07:00
Dirk Hohndel
2c29cc96a3 Whitespace
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-10 20:46:02 -07:00
jan Iversen
1d5d7d0c47 iOS: cleaned/bumped versions
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-10 20:43:22 -07:00
jan Iversen
6019688b98 iOS: removed local build of libxml2
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-10 20:43:22 -07:00
jan Iversen
5aa5398624 iOS: removed local build of sqllite3
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-10 20:43:22 -07:00
jan Iversen
a0030a488a iOS: build.sh does not run configure for libdivecomputer
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-10 20:43:22 -07:00
Dirk Hohndel
c67fe97ba1 Travis: remove flag for iOS that is no longer necessary
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-10 20:41:58 -07:00
jan Iversen
ff15d48f69 iOS: Allow change of bundle identifier
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-10 20:40:45 -07:00
Oliver Schwaneberg
a1e9cce50a Fixed erroneous comparison of cylinders and weight systems.
Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-05-11 02:41:57 +03:00
Oliver Schwaneberg
55ac07f6f6 Corrected file name "weigthsysteminfomodel" to "weightsysteminfomodel"
Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-05-11 02:23:51 +03:00
Oliver Schwaneberg
67f96ec06c Removed a duplicate include in maintab.cpp
Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-05-10 08:31:12 -07:00
jan Iversen
175b3b23b0 Added Info.plist and Qt to .gitignore
This prevents the generated Info.plist and user defined Qt
from being accidently committed.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-10 08:24:13 -07:00
jan Iversen
5e05c804c8 Updated .gitignore to silence ios dirs
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-10 08:24:13 -07:00
Murillo Bernardes
7d6a48b59f iOS: use recommended variable for bundle ID
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-10 08:19:33 -07:00
jan Iversen
161e5e94fc iOS: update build script
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-09 14:40:31 +02:00
jan Iversen
a351393739 iOS: update build instractions
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-09 14:40:31 +02:00
Murillo Bernardes
f4a9571da5 mobile: show selected dive on details view
Call positionViewAtIndex in order to make the selected dive
visible.

Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-05-09 06:32:20 +02:00
jan Iversen
c9cb95ba99 iOS, set lowest deployment target to 8.0
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-09 06:28:25 +02:00
Robert C. Helling
3198b2e3ca Add a comment on building option -mobile
...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-08 12:02:17 +02:00