Commit graph

29 commits

Author SHA1 Message Date
Dirk Hohndel
7be962bfc2 Move subsurface-core to core and qt-mobile to mobile-widgets
Having subsurface-core as a directory name really messes with
autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an
autocomplete conflict and also was inconsistent with the desktop-widget
name for the directory containing the "other" UI.

And while cleaning up the resulting change in the path name for include
files, I decided to clean up those even more to make them consistent
overall.

This could have been handled in more commits, but since this requires a
make clean before the build, it seemed more sensible to do it all in one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 22:33:58 -07:00
Marco Martin
c780cfd7ce port to Kirigami imports and new api
first quick and dirty port of the imports to Kirigami 1.0
(using system installed for now) adapt to api changes and
try out some of the proposed ui changes from the HIG

Signed-off-by: Marco Martin <notmart@gmail.com>
2016-03-08 21:26:54 +01:00
Dirk Hohndel
605d085573 QML UI: resolve confusion about dive list model ordering
Oops, I forgot to take the sort model on top of the model into account.
Now everything should stay consistent - ListView order when accessed from
QML, but internal order when accessing the underlying array.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-02 09:02:00 -08:00
Dirk Hohndel
ce83357889 QML UI: after adding a dive, jump to it in the list
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>
2016-03-02 04:47:51 -08:00
Dirk Hohndel
2bf6f4e45d QML UI: ensure that after a dive edit the profile is redrawn
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>
2016-02-28 16:46:50 +01:00
Dirk Hohndel
8b39352d4e QML UI: only allow valid gas mixes
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>
2016-02-20 21:57:53 -08:00
Dirk Hohndel
e22a452cf5 QML UI: don't allow negative duration or depth
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-20 21:50:11 -08:00
Dirk Hohndel
0ce1dd80cc QML UI: change the dive add/edit action button to be save
Remove the button on the page and instead use the action button to save
and the back key to cancel.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13 21:25:10 -08:00
Joakim Bygdell
ae116c5bc8 QML UI: enable edit of gasmix
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-13 10:04:05 -08:00
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
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
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
ba4bb56701 QML UI: better way to determine dive details edit width
Instead of passing magic values around, calculate the columnWidth as part
of the SubsurfaceTheme object.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 22:49:46 -08:00
Dirk Hohndel
6dd3e4c30e QML UI: use the new helper to ensure the right dive is selected after edit
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>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
034ffa229b QML UI: add field to edit the total weight
This isn't hooked up to anything, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-28 18:33:22 -08:00
Dirk Hohndel
c52769a90f QML UI: use unique names for the different ListViews
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>
2016-01-28 18:20:15 -08:00
Dirk Hohndel
260cd14a2b QML UI: maximize horizontal size of notes when editing
This seems a bit brute force but I couldn't get the width to propagate
correctly any other way.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-21 13:09:10 -08:00
Dirk Hohndel
f84e823879 QML UI: switch edit back to not being a drawer
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>
2016-01-20 14:07:06 -08:00
Rick Walsh
471270437b QML UI: make all buttons more attractive
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>
2016-01-20 07:53:49 -08:00
Sebastian Kügler
6540e95425 dive details navigation
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>
2016-01-12 03:06:09 +01:00
Dirk Hohndel
9c0cb6cfef QML UI: edit notes in rich text mode
This way we don't show <br> for line breaks.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-06 23:03:07 -08:00
Dirk Hohndel
415536aba9 QML UI: in dive details edit, put date on its own line
This way we can support a simple way for the user to edit the date.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05 22:50:31 -08:00
Dirk Hohndel
fa338a26b8 QML UI: add feature to add current position when editing dive
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>
2016-01-01 17:26:26 -08:00
Dirk Hohndel
a0aa27e864 QML UI: handle editing of depth
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>
2016-01-01 00:55:34 -08:00
Dirk Hohndel
2c28b16b26 QML UI: handle editing of duration
I don't think these regular expressions are sufficiently exhaustive - but this
is forward progress.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-01 00:55:25 -08:00
Dirk Hohndel
99a5a743c4 QML UI: change the way we extract input data from dive edit
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>
2015-12-26 22:57:47 -08:00
Dirk Hohndel
8baae6a3b6 QML-UI: make dive edit almost sort of work
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>
2015-12-07 22:24:56 -08:00
Sebastian Kügler
8cf4725742 split divedetails into view and edit parts
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>
2015-12-07 18:46:32 +01:00
Sebastian Kügler
bd7af5a511 state machine controls edit/view dive details
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>
2015-12-07 18:46:32 +01:00