Don't do the slow motion scrolling through the list if we previously
showed a different dive in the list.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This code is very similar to the undo code in the desktop UI, but
untangling that from the desktop seemed massive overkill; we don't have
lists of dives to delete and undelete here - so this is actually much
simpler and easier to maintain (I hope).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The dialog gives the user 3 seconds to undo the delete and then disappears
without any user interaction.
This isn't hooked up, yet.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This reduces the margin to use more of the available space and also makes
the first column slightly wider so the word "Cylinder" isn't broken on a
Nexus 6p.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Normally this is triggered when the DiveDetailsView component is
completed, but since QML isn't recreating this component unless we switch
to a dive a couple of spots in the dive list away from this one, we
wouldn't get any changes in the data reflected in the profile.
But since this now redraws the same dive that potentially was drawn last,
we need to make sure we call plotDive() with force=true.
I also suspect that this could help with the strange bug that sometimes we
show a blank profile after certain edits.
See #1013
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This allows the user to delete the currently shown dive. This action takes
effect right away, no confirmation, it gets right away written to the
local git cache.
One idea for an undo operation here could be to simply reset the git tree
to HEAD^ and reload. Not elegant, but would work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't allow negative depth or depth beyond 500m.
Additional checks that the gas mix is possible (even thought QML code
SHOULD only allow valid combinations).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The input is restricted to
EAN100
EANxx (with 'x' one of 0..9)
AIR
xx/xx (with 'x' one of 0..9)
xxx (with 'x' one of 0..9 and the number <= 100)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We (ab)use fake_dc() to create a pleasing profile for a manually added
dive. Based on it's intended use, fake_dc() simply handed back a dc
structure that pointed at staticly allocated samples - that's obviously
(now that I think about it) going to blow up in my face if I edit a
manually added dive more than once.
So now we have an option for fake_dc() to actually allocate the samples -
this way the rest of the code can treat these samples as we would treat
samples created any other way. We can free them and replace them with a
new set.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We only need to deal with this if the dive changed. And in that case, if
we calculate a new fake DC, we need to clear out the meandepth as
otherwise the algorithm will try to match both max and mean depth. Since
the user potentially changed the max depth that could have very odd
consequences.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When the user explicitly sets the units when editing or adding dives, we
used to change the display preferences. This was changed for some but not
all fields in commit 6252d0cd3b ("While parsing weight and pressure we
should not change the users settings")
Now we do this consistently for all inputs.
Also, when editing the depth of a manually added dive, we now throw away
the samples (as those are certain to be inconsistent).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A dive with zero duration creates an odd profile that is 2min 30seconds
long and looks just weird. Instead, simply show a text that there is on
profile shown for such a dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is more consistent with the rest of our UI
To make this work you once again need changes to the mobile components
that aren't upstream, yet.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
Now it is possible to enter a specific unit that is different from the
unit stored in the preferences. If only numbers are inputed the unit will
be the same as specified by the users preferences.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Android users are well used to using the back key for this. I kept the
code in place as things may end up completely different on IOS or other
mobile platforms.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should have been obvious. Without explicitly asking for only local
git activity, it will connect to the remote.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This allows us to shrink the top bar quite a bit and have a little more
screen real estate. In order to maintain functionality we need to reenable
the context menu on some screens.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since some users report hangs when changing credentials it would be useful
to see how far the application got.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This doesn't quite work yet as the start page appears to miscalculate its
height (the cloud credentials page appears to be missing).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make things centered, lay them out correctly, make sure the image fits.
This includes the re-indentation of the previous commit - but the changes
are so massive that it seemed pointless to do this as its own commit.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>