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>
Once again this requires changes that aren't upstream in Kirigami.
But with this the bread crumbs update when the user swipes from dive
to dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This requires a change to Kirigami so that a property change (instead of
calling the open() function) can trigger the animation.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This merge was a bit more challenging given how far things had diverged,
but I hope I got it mostly right.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way we have one function that correctly ends both modes.
As a positive side effect this fixes a bug where one could exit the
add mode by tapping Dive list in the main menu which would not delete
the partially created dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Especially when showing the dive details and editing dive details,
having the option to go back in the context menu is nicer on iOS.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way we shouldn't have a drawer or other changes to the UI prevent the
user from seeing / interacting with the notification.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
don't create a local PassiveNotification copy,
use the global show/hidePassiveNotification from
ApplicationWindow, now that it works
Signed-off-by: Marco Martin <notmart@gmail.com>
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 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>
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>
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>
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>
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>
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>
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>
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>
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>
I couldn't make sense of either the code nor the comment, so I tried what
broke when I removed it. Nothing that I could find. So maybe we don't need
this after all?
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>
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>
We keep losing the time when people move code around. date really is just the
date and doesn't include the time component.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- stop at bounds, this is in line with other flickables. I really
don't like Flickables floppy default behavior to allow dragging and
scrolling over the bounds.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- As the list may get reset on save, the dive_id effectively changes
since currentItem isn't updated. So after editing, we end up with a
different currentItem than visible. This is very unintuitive, but
has to do with the model resetting. It would result in the edit view not
showing the current dive when opened the second time. Let's make sure
that out currentItem is always the visible one before we're filling
the data into the edit page.
- Close the drawer when we're navigating away from the dive item, for
example when hitting the back button.
Signed-off-by: Sebastian Kügler <sebas@kde.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>
With the mobile components fixed we can now simply switch between different
menu content - no need to play games and redefine the actions on the fly. This
also adds a cancel button for editing and cleans up when the user hits cancel.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a bit more complicated because we are asking the user to edit the text
field instead of giving them a date and time picker. This is not a great
choice, but let's run with it for now.
One downside is that the user is likely going to edit the date "Oct 29" -> "Oct
25" without adjusting the day of the week. And if we then try to parse that Qt
correctly complains about an invalid date. So we hack around this by removing
the day of the week from both the format and the date entered (which of course
now will break things if the user did, in fact, adjust the day of the week). As
I said, not a great solution.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- flickable is gone, Page now just takes the children items, meaning we
can remove this assignment
- BasicListItem is factored out, and we now need it in our qrc
Signed-off-by: Sebastian Kügler <sebas@kde.org>
The automagic update gets disabled once we overwrite the text with "Save" at
some point, so instead we appear to have to do this manually.
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>