Commit graph

10124 commits

Author SHA1 Message Date
Joakim Bygdell
8c9883cfcf QML UI: enable edit of cylinder pressures
First cylinder only, show warning if there are more than one cylinder defined.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 12:11:09 -08:00
Joakim Bygdell
f3b35d175a QML UI: add function to get cylinder pressures
Since we only show the first cylinder we can also only edit the first cylinder.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 12:10:50 -08:00
Joakim Bygdell
9c5b97e6cf Add helper to parse pressure strings.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 12:10:36 -08:00
Willem Ferguson
bc84d280b8 Mobile user-manual: Add text that explains action button
4 small images added.

     Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>

From 43f260e7aa2be9af43c9250f75cad05a141f9d1e Mon Sep 17 00:00:00 2001
From: Willem Ferguson <willemferguson@zoology.up.ac.za>
Date: Tue, 9 Feb 2016 12:25:24 +0200
Subject: [PATCH 2/2] [PATCH] Mobile user-manual: add section explaining action
 button

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 10:55:23 -08:00
Dirk Hohndel
87f62dfaa8 QML UI: load from cache first when changing cloud credentials
We need to execute the same sequence of steps both when starting the app
and when switching cloud credentials. This way things will work correctly
when the device is offline and the user wants to switch accounts.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 07:53:22 -08:00
Dirk Hohndel
0cc9ad0619 QML UI: draw edit/back button next to context menu button if it's shown
Without this they were all anchored to parent.right and would be rendered
on top of each other.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09 06:34:14 -08:00
Dirk Hohndel
0f6b8a8f6f QML UI: DiveDetailsView - calculate better width and set everywhere
Even setting things up in the first row isn't enough. Every field in the
grid needs an explicit width. How dumb is that.

To make this more manageable calculate the correct widths at the beginning
and then just reference those properties.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 13:25:29 -08:00
Dirk Hohndel
3e46361518 QML UI: DiveDetailsView - set fixed column widths
In order for wrapping to work, the Text and TextEdit elements need to have
a defined width. Normally the GridLayout is supposed to be able to figure
out optimal widths for the different colums if you tell it which ones
should stretch, but that has repeatedly caused infinite loops and crashes
in the layout engine.

For now, in order to get both wrapping (and therefore no clipping of the
content) and avoid crashes, we hard code the width of the four columns by
setting Layout.maxWidth for each element in the first row of the grid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 12:44:01 -08:00
Dirk Hohndel
c6a844fbad QML UI: DiveDetailsView - reorder the grid
Let's put the three likely rather narrow items above each other in the
right column and the others (especially the three that could run long:
suit, buddy, dive master) in the left one.

Also, make the individual entries more consistent in which attributes are
set in which order - easier to read.

Finally, make sure that all grid elements enable wrapping.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 12:43:28 -08:00
Dirk Hohndel
10ca667403 Sync load from cloud status when changing cloud storage accounts
Since this variable is specific to the cloud credentials in use, we need
to reset it when we change credentials.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 11:14:11 -08:00
Dirk Hohndel
801ce01585 Always sync with cloud server when updating backend data
It makes no sense to only do this the very first time we connect to a
cloud storage account. The existing code only happened to work because we
incorrectly tried to maintain the loadFromCloud status across restarts of
the application. So one bug hid another bug.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 11:12:43 -08:00
Dirk Hohndel
c1b3de6190 Remember status of specific cloud account in settings
What matters is that the cloud storage for a specific email address has
successfully been synced - and we need to remember this across restarts of
the app. This way Subsurface-mobile can work with different accounts, even
if offline.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 11:10:21 -08:00
Dirk Hohndel
d43a2c032b QML UI: correctly handle back key on edits
This requires mobile components that include commit 03c868fc57e5 from
earlier today. With this a single press on the back key cancels the edit
and a second press on the back key brings you up one level in the page
stack (usually back to the dive list).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 08:41:42 -08:00
Willem Ferguson
ec9aad4487 Short first attempt at a user manual for Subsurface-mobile
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 08:22:39 -08:00
Miika Turkia
d97ae62c75 Move preferences under GPS menu
Since we currently only have preferences that affect the GPS
functionality, it might be more logical to have the preferences under
GPS menu.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-08 08:00:27 -08:00
Henrik Brautaset Aronsen
8eb019456d Avoid QtCreator warning about ==
Warning M126: == and != may perform type coercion, use === or !== to avoid it

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 13:57:02 -08:00
Henrik Brautaset Aronsen
47403588e5 Move endEditMode() to DiveDetails.qml
Having endEditMode() in main.qml seemed wrong somehow.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 13:56:46 -08:00
Henrik Brautaset Aronsen
d976310094 Add top-right edit and back buttons for mobile
Adds a back button in edit mode, and an edit button for view mode.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 13:56:07 -08:00
Dirk Hohndel
e174389618 QML UI: another attempt to fix the random crashes
I finally was able to reproduce the crashes with the infinite recursion when
computing a GridLayout.

This seems to be triggered by competing Layout.fillWidth settings that the
layout engine couldn't figure out how to accomodate.

I did three things to make this work better:

- explicitly grab the columnWidth for the width of the DiveDetailsView.
- split the GridLayout in two so the area above and below the profile are no
  longer forced to fit in the same column widths.
- remove most of the Layout.fillWidth settings and only leave a couple that
  seem sufficient to get reasonable on screen layout in my experiments.

Here's hoping that this one is finally resolved.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 12:45:36 -08:00
Dirk Hohndel
d8d9301e8e QML UI: disable download from divecomputer button on start page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 10:09:06 -08:00
Dirk Hohndel
ad72d437a3 Revert "QML UI: end edit mode when leaving the edit page"
This reverts commit d2928a137c.

The presence of this Action causes crashes for one of the testers. Which
is utterly ridiculous.
2016-02-07 07:32:08 -08:00
Dirk Hohndel
2df1e0b342 Don't run time consuming gas interpolation without any data
If the user hasn't set any pressures at all there is no point in trying to
interpolate all these data.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07 07:22:41 -08:00
Dirk Hohndel
17134be96d Profile: don't compile code that isn't needed on mobile
We were creating a couple dozen objects that we never needed and because
of that triggered several dozen callbacks whenever the model data changed.
All for UI elements of the profile that are either not used in the mobile
app (like the calculated ceiling or the partial pressure / tissue
saturation graphs), or are only useful when using the profile
interactively (which we also don't do on mobile).

I don't know if this will make a significant impact on performance, but it
seems like the right thing to do either way.

A positive side effect is that the odd blue line on top of the rendered
profile is gone as well.

Fixes #1007

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06 13:29:31 -08:00
Dirk Hohndel
d2928a137c QML UI: end edit mode when leaving the edit page
This should fix the problem when using the back key to exit the edit page.
Requires a patch to the mobile components that isn't upstream, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06 12:08:16 -08:00
Dirk Hohndel
6d8d956853 QML UI: make time parsing more lenient
White space between numbers and units should be ignored.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06 12:07:42 -08:00
Jan Mulder
dd53411550 Mobile: always show divecomputer reported ceiling in red
We do not not want to do decompress model calculations in the mobile app
(see 130f4cd7ac), but we do want to see the divecomputer reported
ceiling (in red). The latter is fixed here.

Ticket #1006

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-06 06:14:15 -08:00
Dirk Hohndel
a4ec520601 QML UI: enable editing of weight
But only if there is only one weight system defined in the dive. Otherwise
display a read only text that explains that this cannot be edited.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 22:54:47 -08:00
Dirk Hohndel
ad7fb80d0a DiveObjectHelper: check if dive has only one weightsystem
The mobile app should only allow editing the weight entry if there is no
second weight defined.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 22:53:12 -08:00
Dirk Hohndel
535a6b9b25 Simplify sumWeight function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 22:52:30 -08:00
Dirk Hohndel
587456190f Add helper function to parse weight strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 22:51:46 -08:00
Rick Walsh
8facdc62fd profile-widget: use smaller event icons on Subsurface-mobile
Smaller event icons fit the mobile display much nicer

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 22:02:24 -08:00
Dirk Hohndel
130f4cd7ac Do not run the deco calculations in the mobile app
We don't show the calculated ceilings and calculating them is compute
intensive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 20:45:18 -08:00
Dirk Hohndel
7f70802b90 QML UI: explicitly hide the keyboard when exiting dive edit
If you save or cancel the dive edit, the keyboard should be closed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 10:49:43 -08:00
Dirk Hohndel
48695cda7c QML UI: disable download from divecomputer
This is not hooked up, yet, and would likely only confuse potential
testers.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05 09:22:54 -08:00
Miika Turkia
24e2f83d67 Allow merging of dives with zero depth/duration
Fixes #1003

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-04 12:38:48 -08:00
Willem Ferguson
545b106d5c Mobile. Modify DownloadFromDiveComputer.qml
1) Create space for sillybutton at bottom of screen
        2) Reformat columns in tableview
        3) General cleanup and simplification of code.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-03 10:50:00 -08:00
Miika Turkia
520f505d20 Fix Liquivision import crash
When we detect a redundant DC we free the memory reserved for the model.
Thus we need to malloc that memory here.

Fixes #1002

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-03 06:06:23 -08:00
Jan Mulder
ce373db951 Update copyright for 2016
Trival string update.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02 09:28:56 -08:00
Jan Mulder
e80284fcfc Simplify building of Android build from one source tree
Currently, when running the packaging/android/build.sh from a source
tree that has been used for desktop builds, libdivecomputer wants a
make distclean. This is inconvinient, and is caused by building
libdivecomputer in source. Now, configure and build libdivecomputer
in a new subdirectory, allowing to run the android build script
from the same source tree as the desktop (both desktop and mobile)
builds.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02 09:28:47 -08:00
Jan Mulder
62f7a2a8f0 Build Android mobile app against latest OpenSSL
No reasons not to upgrade to the latest OpenSSL lib. The currently used
1.0.1 branch is ending end of 2016, so a switch to 1.0.2 is useful
anyway.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02 09:28:44 -08:00
Robert C. Helling
c32f5cc278 Silence compiler warnings
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-01 18:01:05 -08:00
Rick Walsh
fdd5ee507c QML UI: Another attempt to shift dive number to top row
Commit 1030cb265a 'QML UI DiveDetailsView: shift
dive number to right of top row' was reverted because it caused mysterious
crashes for some testers, inferred to be related to sizing items in a
gridLayout.

This patch brings the dive number back up to the right of the top row, so the
page width doesn't exceed the screen width. Using text wrapping should prevent
the date text and dive number items from increasing in width, and hopefully
avoids the mysterious crashes.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-01 17:52:20 -08:00
Miika Turkia
448abec769 Mark CCR dive's divetype properly
We used to mark CCR dives by having "SP change" event at time 0:00.
As we nowadays mark CCR dives by setting dc->divemode appropriately,
better to convert the old dives to this format as well. This way we do
not have to take the special old format into account on multiple places
in the source.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31 13:06:39 -08:00
Dirk Hohndel
cba50ece33 Revert "QML UI DiveDetailsView: shift dive number to right of top row"
This reverts commit 1030cb265a.

Simply trying to find out if this is the cause for the odd crashes one
tester is seeing.
2016-01-31 11:27:13 -08:00
Miika Turkia
d6af28cc90 Attempt to detect time format on CSV import
This attempts to detect the time format when initially importing a CSV
file. Well, only the minutes:seconds notation is detected currently.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31 11:22:47 -08:00
Miika Turkia
d9072cdefd Attempt to detect date format on CSV import
This tries to detect the date format when initially reading a CSV file
for importing.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31 11:21:04 -08:00
Dirk Hohndel
16c082112c QML UI: pick new highest dive number when manually adding dive
It's possible that this will create an out of order dive list, but it
seems the most consistent way to do things and to avoid more than one dive
with the same dive number (which could have happened if you add several
dives manually that are not the newest dives in the dive list).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 11:26:16 -08:00
Dirk Hohndel
a1aa83fcfd Minor cleanups
Improve readability of the code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 10:17:22 -08:00
Dirk Hohndel
0eae59bcd2 QML UI: introduce "add" state and correctly clean up when canceled
Adding a dive is just like editing it, except that canceling the operation
has different consequences. Instead of trying to figure this out by some
inference on other state, let's just make it explicit and then clean up
after ourselves if the user canceled a manual dive add.

This also switches to use the properties that we defined in order for the
main menu to be able to setup these values. Makes the code easier to read
and is more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 07:50:45 -08:00
Dirk Hohndel
9f7ecbb53e Add helper to remove dive from model
I tried various things to do this from QML but it just doesn't seem to
work at all. So I gave up and instead added a trivial helper function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-29 07:50:38 -08:00