aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveDetailsEdit.qml
AgeCommit message (Collapse)Author
2021-01-01mobile/UI: consolidate to a single check boxGravatar Dirk Hohndel
It was very odd that we had two slightly different styled check boxes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01mobile/UI: ensure active input field stays visibleGravatar Dirk Hohndel
This reuses the logic we implemented in the SsrfTextField. Eventually we will need to clean up the inconsistent names for these elements. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01mobile/UI: ensure that edited text is currentGravatar Dirk Hohndel
By removing focus from all input fields we can ensure that we have the correct data reflected when saving an edited dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-01mobile/UI: use our small label templateGravatar Dirk Hohndel
This saves 66 lines of code. 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>
2021-01-01mobile/UI: add template for editable combo boxGravatar Dirk Hohndel
This makes the code easier to read and manage. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23mobile/UI: update location combobox for dive editGravatar Dirk Hohndel
This one was missed in commit Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-21mobile: remove non-functional codeGravatar Dirk Hohndel
This never ever worked to trigger a profile update. The code is nonsensical as we cannot access the QMLProfile in a model delegate this way from outside the delegate. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20mobile/UI: fix theming of combo boxes in dive editGravatar Dirk Hohndel
Again, not using our template combo box. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-08-16mobile/dive-edit: fix incorrect handling of multi tank gas mixesGravatar Dirk Hohndel
A silly copy and paste error caused us to overwrite the gas mixes for all the tanks with the gas mix in the first tank. Fixes #2913 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-30mobile/dive-edit: fix broken editable combo boxesGravatar Dirk Hohndel
This is a partial revert of commit 99438121c4 ("mobile/dive-edit: use template components and theme colors") Clearly the information given in the Qt documentation on how to theme ComboBox is flat out broken. The trade-off between 'better dark theme' and 'broken user experience' is fairly easy to make. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-18mobile/dive-edit: use template components and theme colorsGravatar Dirk Hohndel
Another small step to make the dark theme at least marginally useful. We now use our template components and add the necessary elements to have consistent text color. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-10mobile/undo: create EditDive commandGravatar Berthold Stoeger
Command that just swaps two dives. This is rather complex, as for example a dive site might be created. 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-02-07mobile/notes-edit: ensure cursor stays visible editing dive notesGravatar Dirk Hohndel
This seems to work much more reliably as it specifically compares the cursor position to the visible bottom and top of the screen. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-21Mobile: allow editing dive numberGravatar Dirk Hohndel
No checks regarding duplicate numbers - we trust the user knows what they are doing. 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-14Mobile: ensure input fields stay visible after keyboard opensGravatar Dirk Hohndel
When the user taps on a TextField to enter text, usually the virtual keyboard will pop up. This code tries to ensure that the keyboard doesn't cover the entry field that the user was trying to work on. In order to centralize these changes, this introduces a new SsrfTextField type which we use to also remove a few redundant default settings that we previously had for every field. The one TextArea for the Notes field didn't seem worth creating yet another type for, so there the changes are done directly in DiveDetailsEdit. The awkward timer mechanism is necessary as the keyboard pops up asynchronously and then triggers a change of height for the app, so we need to wait a little bit before doing the adjustment. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-06Fix text in darkmode on mobile app.Gravatar Paul Buxton
Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
2018-10-01Mobile QML UI: bump Kirigami imports to 2.4Gravatar Jan Mulder
Primarily for reasens of keeping up with upstream. And hopefully bugfixes and added functionality. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-25Mobile: use editText instead of currentText in Suit and DiveMaster boxesGravatar Berthold Stoeger
A user reported problems with editing the Suit and DiveMaster fields. Apparently, editing does not change the currentText. Without doing a deeper analysis, simply use editText (a more proper fix might be changing the currentIndex on editing). (Parially?) fixes #1694 Reported-by: Mark Powell <mcpowell123@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-11Mobile: fix saving new diveGravatar Jocke
With the new setup we need to know which state we are coming from when we are saving cylinder related info. When we are adding a new dive we explicitly should save cylinder data to the first cylinder. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11Mobile: fix adding new diveGravatar Jocke
All the changes to multi cylinder editing broke the option to add a new dive. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11Mobile: save pressuresGravatar Jocke
Save start and end pressures for used cylinders. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11Mobile: save gasmixesGravatar Jocke
Same as for cylinder info, we need to make sure that the gasmixes gets saved to the correct cylinder. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11Mobile: display all used gases on the edit pageGravatar Jocke
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11Mobile: save edited cylindersGravatar Jocke
Save the edited cylinder in the correct slot. Since the cylinder number and the used cylinder number need not be the same we first need to test if the cylinder are used. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11Mobile: Display used cylinders on edit pageGravatar Jocke
This displays the used cylinders in a dive so that they can be edited. Currently limited to 5 as a POC. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-04-14QML UI: if we don't have a current position, update it laterGravatar Dirk Hohndel
Once we get a new fix we asynchronously update the text. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-19QML UI: drop focus when selecting a locationGravatar Joakim Bygdell
Make sure to drop focus both for typing and when selecting an entry from the list. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19Mobile: change location combobox idGravatar Joakim Bygdell
Change the id of the location combobox to math the naming scheme of the other comboboxes. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19Mobile: Fix location comboboxGravatar Joakim Bygdell
In the initial move to comboboxes the correct location model was not used. This uses the correct model and makes it behave like the other comboboxes. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19QML UI: drop focus on editGravatar Joakim Bygdell
Drop focus on editable comboboxes when pressing enter. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19Moblie: remove comparison when savingGravatar Joakim Bygdell
Removing the comparison of currentText vs editText when saving buddies fixes the issue of data loss when dive has more than one buddy. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-03-19QML UI: drop focus when ComboBox element is pickedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-19QML UI: cylinders aren't editableGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-19QML UI: switch editing back to comboBoxGravatar Joakim Bygdell
The HintsTextEdit just doesn't feel natural and intuitive. Edit, fixed rebase issues. Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-01-31mobile cleanup: restyle construction of locationlistGravatar Jan Mulder
See also e6e1473e6. The construction of the locationlist was not the same as the 3 previous lists, and it needs the inclusion of a new model file (divelocationmodel.cpp) in the mobile app. In addition, as the mobile app is mainly interested in a simple stringList (model) to populate a HintsText field (or maybe later a combobox), this stringlist is added to the model, to easy interfacing with QML. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-31mobile cleanup: unduplicate code and do not loop over dives (3)Gravatar Jan Mulder
See e6e1473e6. Exact same commit but here for the list of divemaster. The careful reader will spot a small addition to the clearDetailsEdit() QML function. Two more field are cleared. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-31mobile cleanup: unduplicate code and do not loop over dives (2)Gravatar Jan Mulder
See e6e1473e6. Exact same commit but here for the list of buddies. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-31mobile cleanup: unduplicate code and do not loop over dives (1)Gravatar Jan Mulder
This is the first of a set of commits that are (very) similar. It appeared that a number of more or less static lists, which are constructed by a loop over all dives in the logbook, were executed when changing focus to a next dive. For example, the in this commit addressed list of used dive suits. What was wrong was that the suitList was linked to a dive. There is only a need to construct the list of used suits when data is changed (and obviously, once on startup of the app). Further, it appeared that a lot of code was duplicated and that we can use (in this case) the same code from the desktop completionmodels.cpp. Basically, this commit involves the following changes: - include completionmodels.cpp in mobile and desktop (so move it from the desktop only category to the generic category). - remove double code from DiveObjectHelper.cpp - Do not differentiate in the init phase and the normal refresh of the list - the per dive logic is now only the getting of a previously constructed list (in init or update of the divelist). There are no visible changes in the UI, other than a better performance when scrolling over dive details. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-15mobile: clear internal data when edit/add dive is finishedGravatar Jan Mulder
When editing (or adding) a dive, the internal data containing the attributes on the edit page was not cleared when editing was finished (in any way, by saving the edit or by cancelling it). As long as the user only edits existing dives, all this poses no problem, as at the start of a dive edit, the data is filled from the dive to be edited. However, when adding a dive, data coming from previous edits shows up. This not clearing data also causes the strange effect as written in issue #950: adding a dive, deleting it, and adding a dive again, added the first added dive data, without the edit screen being shown. All this can be solved by clearing the data from the edit when editing is done. Fixes: #950 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-25mobile: get GPS data from dive site nameGravatar Jan Mulder
When the user entered a dive site using autocompletion, it is a known site, of which we might have a GPS location already. Just fill the known site coordinates. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-25mobile: autocomplete location namesGravatar Jan Mulder
Add the capability to select the location name from a list, constructed from the known dive sites in the logbook. Fixes: #546 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19QML UI: QtQuick.Layouts to 1.2Gravatar Jan Mulder
And again, no visual changes. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19QML UI: QtQuick.Controls to version 2.2Gravatar Jan Mulder
Tested fine without visual changes. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19QML UI: QtQuick to 2.6Gravatar Jan Mulder
Upgrade QtQuick to 2.6. Seeing a small artifact in the application header, lets see what happens when upgrading more includes. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19QML UI: Kirigami to 2.2Gravatar Jan Mulder
When first tested this commit, especially the dive list was looking terrible. However, after including newer SHA's from libkirigami, and correcting lots of spacing/margin issue, a retest of this commit shows no strange artifact any more, and the amount of warnings in the log output is reduced significantly. So now, it appears save to upgrade. Notice that main.qml still uses Kirigami 2.0. and is not updated in this commit. With version 2.2, there is a new way of theming, that is not (yet) compatible with our current code. Blindly upgrading to 2.2 leads to a almost black dive list, wrong button colors, and runtime errors in the log, due to the fact the direct setting from QML Kirigami's Theme colors is not allowed any more. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-17mobile: silence deprecated messages in logging about Kirigami.LabelGravatar Jan Mulder
Commit 8f6827ab122 brought a new SHA for Kirigami, but that introduces a very noisy logging of "Kirigami.Label is deprecated. Use QtQuickControls2.Label instead". So, thats what done here. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-05QML UI: add transition when switching to edit modeGravatar Dirk Hohndel
The hard switch was not ideal. This isn't perfect, yet, but a step in the right direction. The 'transitions' to change the visibility properties are a bit odd, but that's how it's done in the examples as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>