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>
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>
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>
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>
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>
Instead of passing magic values around, calculate the columnWidth as part
of the SubsurfaceTheme object.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There are two cases where this is important
- when running Manually add dive which may add a dive in the middle of the
dive list
- when editing the date and time of a dive which may move it around in the
dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Having both the dive list (the vertical list) and the sequence of dive
details (the horizontally swipe-able list) named the same caused me
endless confusion.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With this edit seems to work again. The edit page can be scrolled around on
smaller screens to allow editing every part of it and to allow the user to
press the "save" button.
This is mainly intended to make sure testing can continue - it's unclear if
this will be the final design.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit f3f7930 introduced a more attractive button style to the start page.
This patch turns it into its own type so it can easily be used everywhere.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch reworks the navigation of the dive details.
- The detailsview is now a list view with page-sized delegates. This
allows horizontal swiping to the next and previous dive.
- The central button now allows to open the edit mode for the dive.
Original patch was done by Marco Martin, but needed to be reapplied by
hand.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This isn't quite perfect yet. If it takes too long to get the GPS fix (i.e., if
you save it before you get the fix), this will simply fail and not store a
position. But in normal conditions (you check the box, you edit the data, you
save), especially when outside on a dive boat, this should work fine.
For the other cases we need to implement some kind of callback to still collect
the data.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Getting closer to being able to really edit / add dives in the mobile UI.
This works for manually added dives - needs a bit more thought for dives
downloaded from dive computers as we don't necessarily want to change the
maxdepth in conflict with the samples.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of doing the silly "onEditingFinished" we get the strings from the QML
components at the time we commit the change. Much more logical, much more
straight forward, no issues with the TextArea not having an onEditingFinished
signal.
This still has a few open todos: the temperatures aren't parsed, the edit
screen is missing depth and duration, we can't edit the dive time (and it isn't
passed in on the commit). But it's progress.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So this has a lot of caveats:
- right now it only works for buddy, divemaster and suit
- you have to actually exit the field with your cursor or the change
doesn't take - that's ridiculous, there must be a far more clever way to
do this
- because I use the onEditingFinished handler I can't do this for the
Notes (so here's another reason why I KNOW that this is the wrong way to
do this)
But it shows in principle how this could be done and once someone who
actually knows what they are doing gets their hands on the code I'm
optimistic that this can be morphed into something much more useful.
It does tie together the changes made in the previous commits so that both
clicking around on the dive list gives the expected results and synching
the data back to the cloud actually works.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This splits the dive detail page into two modes: view and edit
- The edit part loses the profile (it's not editable anyway)
- The view part gets a new layout, friendlier for viewing
- Properties for diveNumber, duration, depth and weight are added
Signed-off-by: Sebastian Kügler <sebas@kde.org>
This is the first part of splitting the dive details into edit/view
modes.
- introduce a state machine to switch between view and edit mode
- factor out the editor into its own component
Both components are almost the same, but we can change them individually
now.
Signed-off-by: Sebastian Kügler <sebas@kde.org>