Commit graph

12 commits

Author SHA1 Message Date
Berthold Stoeger
b9673df60b profile: pass DivePlannerPointsModel at construction time
This model is only needed when in plan mode. To enable multiple
profilewidgets at the same time (e.g. for the mobile app or
for printing), make the pointer to DivePlannerPointsModel a
member variable that is initialized at construction time.

Moreover, allow passing null as the DivePlannerPointsModel,
in which case planning will be disabled. This will be useful
for simple printing.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-04-02 13:53:23 -07:00
Dirk Hohndel
a3e0d1ceb4 mobile/profile: listen to dive changes and redraw profile
If a dive changes, we should simply redraw the profile. This could be
improved by checking for the fields that might impact the profile at
all, but this is definitely a step in the right direction.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-21 13:12:37 -08:00
Berthold Stoeger
45a3fff62c cleanup: fix initialization order in QMLProfile constructor
The compiler complains that members were initialized out-of-order.
Even though this is not an issue here it is correct to emit a
warning, since only then it is guaranteed that the objects are
destructed in reverse-order with respect to construction.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30 13:58:10 -07:00
Dirk Hohndel
6629d046b7 mobile/profile: adjust offsets when scaling
If the user is scaling out again we need to make sure that our offsets
are adjusted so that we always show a subset of the profile and not
'empty space' outside of it. Instead of reimplementing the offset logic,
let's just trigger another paint() call.
This requires a trampoline function because of different signal and slot
signatures.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-25 09:28:05 -07:00
Dirk Hohndel
577f713f1a mobile/profile: don't pan outside the actual profile
When zooming and panning the profile, make sure we always show a subset
of the profile and don't end up showing the empty space outside of the
profile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-25 09:28:05 -07:00
Dirk Hohndel
1eb8f7cbaa mobile/profile: make the fonts 25% smaller
This will seem too small to many - it's pushing it, but it leads to a
significantly less cluttered profile, and we now have the zoom capability for
readability.

I think this is a nice improvement.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-25 10:17:57 -08:00
Dirk Hohndel
51100cb20e mobile/profile: add x/y offsets to widget
This will allow us to pan the profile around in the QML UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18 07:34:46 -08:00
Dirk Hohndel
31afa976f3 mobile/profile: add elapsed time reporting for profile rendering
In verbose mode we log how long it took us to render the profile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18 07:34:46 -08:00
Dirk Hohndel
f277b525c3 mobile/profile: create updateProfile method
This allows us to trigger an update even if the dive displayed stays the same.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18 07:34:46 -08:00
Berthold Stoeger
19b8c9a33a Cleanup: Turn QMLProfile::diveId from QString to int
This property is used to render the profile of a given dive.
Weirdly, even though the diveId is an integer, it was stored
as a string. It is not clear why that is the case. Therefore,
turn into the more natural int and avoid unnecessary conversion.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-24 06:16:39 +09:00
Berthold Stoeger
5da09a21bb Cleanup: move error reporting function declarations to errorhelper.h
Move the declarations of the "report_error()" and "set_error_cb()"
functions and the "verbose" variable to errorhelper.h.
Thus, error-reporting translation units don't have to import the
big dive.h header file.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-08-08 16:26:30 -07:00
jan Iversen
aab8f0dcf6 profile: make profile self contained
move qmlprofile.* to profile dir, to keep all parts of the
widget in one place.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-09 17:16:53 +02:00
Renamed from mobile-widgets/qmlprofile.cpp (Browse further)