aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveDetails.qml
AgeCommit message (Collapse)Author
2021-09-13mobile: remove current location checkbox from dive editGravatar Dirk Hohndel
Since we no longer access the device location, we can't do that any longer, either. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18mobile: add ability to edit tagsGravatar Dirk Hohndel
We already showed the tags, but we didn't allow the user to edit them. This tries hard not to create inconsistent or illogical tags by trimming white space and being careful with how the tags are added. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19mobile/UI: move dive delete to context menuGravatar Dirk Hohndel
Having this as the right action button (same one used for 'cancel' in the edit screen) made it too likely to inadvertantly delete a dive. And outside of testing, wanting to delete a dive really shouldn't be all that common an operation. So remove the function from the action button and place it into the context menu instead, right next to the undo action so the user also is aware that there is an undo option. Suggested-by: Peter Zaal <peter.zaal@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01mobile/UI: don't try to set the combobox indexGravatar Dirk Hohndel
There's no point in doing that - we set the correct text and leave that in the editText and displayText for the combo box. If the user uses the drop down they can replace that. This works correctly for single people, and for multiple people the drop down doesn't work at all, anyway. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01mobile/UI: don't show virtual keyboard when starting dive editGravatar Dirk Hohndel
When we start editing a dive the OS will open the virtual keyboard if any of the input fields have focus (which they might get when we set their content). The explicit closing of the keyboard might be overkill, but also doesn't appear to hurt. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23mobile/UI: initialize Kirigami theme to use our colorsGravatar Dirk Hohndel
With this we should finally get the correct button colors even when switching color theme. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-21mobile/UI: again, correct side button colorsGravatar Dirk Hohndel
I am confused how this worked and then got broken, but this appears to once again fix the colors. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-21mobile/profile: directly set up the diveIdGravatar Dirk Hohndel
The weird 'Component.onCompleted' always felt like the wrong way to do this. Setting this directly from the model seems like the much cleaner solution. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20mobile/UI: correctly color the action button icons for dive viewGravatar Dirk Hohndel
This uses one of our changes to Kirigami that allows us to set the correct overlay color for our icons. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile/dive-details: add option to toggle the invalid flagGravatar Dirk Hohndel
Simply for consistency with the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile/dive-details: fix incorrect call to create tripGravatar Dirk Hohndel
This was using the myData alias that exists in the dive list but not on the dive details. This might work (because the models both use the same underlying base model), but given that we are using the currentItem of this ListView, I'm guessing that this would just silently fail (maybe with a warning in the log). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile/dive-details: if menu is open, close that with back buttonGravatar Dirk Hohndel
A second tap on the back button will then end add/edit or close the dive details and get us back to the dive list. This fixes an issue where tapping on back with the context menu open would bring you back to the dive list with the context menu still open, and because then change the text in the context menu as those are designed differently. Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile/dive-details: don't show virtual keyboard in dive view modeGravatar Dirk Hohndel
At least in 4.9.3.1258/3.0.1 I was able to reproduce a situation where I edit one dive, go back to the dive list, then tap on a different dive and then the keyboard pops up, obscuring a big chunk of the screen. This tries to make sure the keyboard isn't shown in dive view mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26mobile UI: add create trip to DiveDetails context menuGravatar Dirk Hohndel
Should have done that in the first place. That's what happens when you are rushing it... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26mobile UI: undo partial dive add when cancelingGravatar Dirk Hohndel
When we start adding a dive, we actually create a diveAdd undo command so we have a dive that the user can edit. Which means we need to undo this action if we cancel. Also, for a more consistent UI, we should pop the dive details page that we used to edit this dive and bring the user back to the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile UI: stop the use of dark icon themeGravatar Dirk Hohndel
This was used very inconsistently and had more bugs than positive impact. See #2686 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile UI: six new iconsGravatar Dirk Hohndel
I will (mis)use these for moving dives out of trips and to the trip above or below and of course for undo/redo. And the weirdest one is the 'local offer' icon that seemed a reasonably good fit to edit trip details. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile UI: allow adding a dive to a trip from context menuGravatar Dirk Hohndel
Right now this is only available on the DiveDetails screen. The menu entries are only enabled if there is such a trip to add the dive to (and if the dive isn't already part of a trip). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile UI: add ability to remove dive from its tripGravatar Dirk Hohndel
If we remove the newest dive from its trip, it becomes inaccessible in the app, but the dive data saved to disk appears to be correct. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile UI: only show context menu when viewing a diveGravatar Dirk Hohndel
In add and edit mode this is confusing and wrong. There is a bug in Kirigami that creates lots of bogus error message about missing mainFlickable. That needs to be patched out. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile UI: set the correct location string when editing divesGravatar Dirk Hohndel
In some situations we ended up with the wrong location name. One way to reproduce the problem was to edit an existing dive location to be a substring of an existing location name. Save the dive, then immediately edit it again. The wrong location would be filled in. The code here looks strange and unnecessary, but it seems to fix the issue. The aliases don't seem to make the code any easier to understand. This replaces them in the case of the location combo box with direct accesses to the data on the DiveDetailsEdit page. It may be worth removing all of them. The locationModel alias was unused. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile UI: add context menu to DiveDetailsGravatar Dirk Hohndel
The undo and redo action actually work already. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile: replace undoDelete() with generic undo()Gravatar Dirk Hohndel
Since we are using the existing command infrastructure, this isn't specific to undoing a delete. This commit renames the function and removes its use in the UI, the next commit will then add the generic undo to the UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile: remove selectedDiveTimeStamp logicGravatar Berthold Stoeger
Since the selection is now handled in the core this is not needed anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-10mobile: remove updateSelectedDive logicGravatar Berthold Stoeger
Selection is now be handled by the core. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-10mobile UI: use undo-command for adding dive.Gravatar Berthold Stoeger
Instead of using the model, copy the code we have in the desktop version which manually creates a 15m/40min dive and passes that to the addDive undo command. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile UI: don't hide dive view when deleting diveGravatar Berthold Stoeger
The next dive is automatically shown anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-10mobile/divelist: select dive after swipeGravatar Berthold Stoeger
After swiping through the dive list, select the currently visible dive. Thus, the dive is highlighted in the overview pane. The connection with the QMLManager feels atrocious, but I would prefer to have as little logic in QML as possible. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-10mobile/divelist: don't set currentIndex on undo of dive deletionGravatar Berthold Stoeger
The core sets the current dive when undoing something. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-10mobile/divelist: remove showDiveIndex QML-functionGravatar Berthold Stoeger
The currently shown dive is now controlled by the core. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile/divelist: implement model that shows all dives in trip-orderGravatar Berthold Stoeger
MobileSwipeModel is probably not an ideal name, but all I could come up with. One of the main complications here is that our list is reversed with respect to the source model. We should change that one day. Probably by moving the sorting down to the core-model. Since looking up the source row is somewhat expensive, the lookup is cached for a single entry because accesses come in bursts for a single dive. This should be a good compromise and avoids keeping track of a full row-to-dive array. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile/divedetails: send current-dive changes up to mobile UIGravatar Berthold Stoeger
To unify mobile and desktop, let's use the current_dive variable of the core to indicate the current dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07mobile UI: remove obsolete access to already removed model roleGravatar Dirk Hohndel
We no longer have a dive role - on the plus side, we also don't use this variable, so I guess this isn't a big deal. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-03mobile-widgets: switch to new subsurfaceThemeGravatar jan Iversen
Remove subsurfaceTheme from main.qml Replace ThemeNew -> subsurfaceTheme change registration ThemeNew -> subsurfaceTheme Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-26mobile-widgets/qml: integrate ThemeNew in qmlGravatar jan Iversen
Update Settings to use ThemeNew (for theme change) Reduce subsurfaceTheme in main Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08Mobile: derive the index from the dive idGravatar Dirk Hohndel
The previous code assumes that both the vertical dive list and the list of dive details which allows the horizontal swiping from dive to dive are based on the same model. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-03Mobile: use appendTextToLog to get timestamps in logsGravatar Dirk Hohndel
This helps tremendously when tracking down some problems. We should never use console.log. In the process this also updates a couple of the messages to be clearer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: more code to deal with undefined elementsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: don't show nothing for the locationGravatar Dirk Hohndel
We use 'Dive details' as page title, everywhere else we use '<unnamed dive site>'. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-20Mobile: remove remaining accesses to DiveObjectHelper from QMLGravatar Dirk Hohndel
Add a couple more roles and remove the dive role that allows accesss to the DiveObjectHelper in the first place. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-20Mobile: get dive details directly from the modelGravatar Dirk Hohndel
By getting a DiveObjectHelper and then dereferencing that we ended up creating hundres and hundreds of these objects, only to immediately destroy them after using a tiny part of the data. Instead make those data available directly from the model, without having to create a DiveObjectHelper forst. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14Mobile: pick icons depending on themeGravatar Dirk Hohndel
QML has ways to style icons - and we use that for the main theme color, but it doesn't seem to work (anymore?) for the edit and save icons. Instead of tracking down what changed there, simply switch between icons with different foreground color, depending on theme. All the other icons seem to work well in all three themes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: update the map when the selected dive changesGravatar Dirk Hohndel
Now we see the highlighted dive flag match the dive selected in the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: don't make sub-pages fill the parentGravatar Dirk Hohndel
This had very strange results with the current Kirigami. Instead set the width of those pages based on our overall column width. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: show the undo for delete for 5 secondsGravatar Dirk Hohndel
Before that it was 3 seconds that was a little too short for peopl to be happy. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-09-14Mobile: don't generate numerous DiveObjectHelpers in startEditMode()Gravatar Berthold Stoeger
Since that object is very heavy, generate one object and read out all the necessary values. The old code accessed the model again and again. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-11-15Mobile: Allow multiple divemastersGravatar Jocke
While not something that many will use, editing a dive on Subsurface-mobile should not result in data loss. This makes the divemaster field behave in the same way as the buddy field with regards to multiple entries. Fixes #1853 Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-29Dive site: replace UUID by pointer in mobile codeGravatar Berthold Stoeger
Replace UUIDs by pointers to dive-site in mobile code. In both cases, the value is transported via a QVariant. The function getCoordinatesForUUID(), which was only used from mobile, can be replaced by a getCoordinatesFor() function taking a variant supposed to contain a dive-site pointer. Likewise, the variant of the centerOnDiveSite function is now supposed to wrap a pointer-to-divesite. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-12QML, cleanup: remove stackViewGravatar Jan Mulder
There is no reason (any more?) to have a property defined that basically renames the global pageStack into a local pageView. Just cleanup. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-07QML UI, consistency: add text attribute for all actionsGravatar Jan Mulder
Something I only see on mobile-on-desktop, so at this point in time not very relevant to the device apps. When hovering on the action button, a toast message shows a hint box. These where empty in some cases. So, just give the actions a text attribute where it was missing. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>