aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveList.qml
AgeCommit message (Collapse)Author
2019-10-26Mobile: avoid dereferencing undefined valuesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: move pageIndex function to main.qmlGravatar Dirk Hohndel
This way it can be more easily called from other pages. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: when selecting dive via map, expand its tripGravatar Dirk Hohndel
Previously if the dive was in a different trip, we'd scroll to that trip but not expand the trip, which was a confusing user experience. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: when selecting dive via map, update details viewGravatar Dirk Hohndel
We updated the selected dive in the dive list, but not the one shown in the details view. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: when switching to the details, reuse existing pageGravatar Dirk Hohndel
While pageStack.push() can handle pushing a page that's already there, that creates an unfortunate sequence of currentItemChanged signal which leads us to do the wrong thing with our map hack. This commit changes things around to first look for the page in the page stack and just switch to it, and only pushing the page as new if it cannoot be found oon the page stack. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-09-21Mobile: pass section directly to tripTitle() and tripShortDate()Gravatar Berthold Stoeger
Instead of converting the section-heading string to a trip-pointer in QML and pass that to the tripTitle() and tripShortDate() functions, pass the string and convert in C++ code. Hopefully, this makes the code more robust. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-21Mobile: don't show filter button when entering credentialsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-09-14Mobile: return depthDuration directly from DiveListModelGravatar Berthold Stoeger
We don't want to generate a DiveObjectHelper numerous times for every item in the dive list. Therefore, return this data directly from the model. In this case, don't remove from DiveObjectHelper, as these data might be used by grantlee templates. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-14Mobile: return location directly from DiveListModelGravatar Berthold Stoeger
We don't want to generate a DiveObjectHelper numerous times for every item in the dive list. Therefore, return this datum directly from the model. In this case, don't remove from DiveObjectHelper, as this datum might be used by grantlee templates. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-14Mobile: return dive-number directly from DiveListModelGravatar Berthold Stoeger
We don't want to generate a DiveObjectHelper numerous times for every item in the dive list. Therefore, return this datum directly from the model. In this case, don't remove from DiveObjectHelper, as this datum might be used by grantlee templates. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-14Mobile: return dive-id directly from DiveListModelGravatar Berthold Stoeger
We don't want to generate a DiveObjectHelper numerous times for every item in the dive list. Therefore, return this datum directly from the model. In this case, don't remove from DiveObjectHelper, as this datum might be used by grantlee templates. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-14Mobile: return dateTime directly from DiveListModelGravatar Berthold Stoeger
We don't want to generate a DiveObjectHelper numerous times for every item in the dive list. Therefore, return this data directly from the model. In this case, don't remove from DiveObjectHelper, as these data might be used by grantlee templates. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-14Mobile: move tripNrDive from DiveObjectHelper to DiveListModelGravatar Berthold Stoeger
We don't want to generate a DiveObjectHelper numerous times for every item in the dive list. Therefore, return this datum directly from the model. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-14Mobile: move tripId from DiveObjectHelper to DiveListModelGravatar Berthold Stoeger
The canonical way of displaying lists in Qt is via models. Thus, return the tripId directly from the DiveListModel instead of going indirectly via a DiveObjectHelper. In the future, this will allow us to make the DiveObjectHelper value-based, as it is not generated numerous times for every list item. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-11Mobile: adjust grid unit on very narrow screensGravatar Dirk Hohndel
If the default font size is big enough to leave us fewer than 21 grid units per row, shrink the grid unit. In order for this to create consistent results, we need to reduce the default column width to 21 grid units as well. And with that change, the columnWidth property becomes obsolete. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-12-21Mobile: copy the dive data when configuring settingsGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-12-21Mobile: UI for selecting what to copy-pasteGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-11-23Mobile: don't format trip heading for all divesGravatar Berthold Stoeger
QML's ListView uses the "section" property to test if items belong to the same section. Apparently, this must be a string and therefore we can't pass e.g. a dive-trip object. Therefore a specially formatted string was passed in, which was guaranteed to be unique (contained the dive-trip pointer value) and the fully formatted trip-title and short-date. The disadvantage of that approach is that the formatting is performed for every dive and not every trip. Perhaps not a problem now, but it makes it for example necessary to cache the number of filtered dives. To be more flexible, pass in only the pointer value formatted as hexadecimal string and provide a function to convert that string back to a trip-pointer (in the form of a QVariant, so that it can be passed to QML). Moreover provide two functions for formatting the title and the short-date. The three new functions are members of DiveListSortModel. This might not be the perfect place, but it is easy to reach from the DiveListView. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-11-18delete-copy-paste buttons layed out properlyGravatar Miika Turkia
Now these buttons are finally shown with long press and seem to be working more-or-less as intended. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-11-18Support for copy-pasting specific fields on mobileGravatar Miika Turkia
Initial implementation/prototype of copy-paste support for Subsurface-mobile. The UI part is really lacking; right now the copy button is initially visible and paste is achieved by long press on a dive and clicking the paste button when it appears. Delete is currently not possible at all, as I just failed to layout the buttons properly using QML. It just sounds so simple, to put all the copy-paste-delete buttons next to each other... The data to be copied is currently hard-coded. A dialog to choose inteded fields would be nice, but it'll take quite a bit effort to get used to QML enough to be able to hack something together. Anyway, this seems to work, even though the UI is not always reflecting the paste without switching dives (when testing on laptop). Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-31Mobile/filtering: don't show the filter line when pulling divelist downGravatar Dirk Hohndel
Even though the height was zero, when pulling down the dive list for refresh, the filter input line would still be visible. With this fix it no longer is. Also remove unused property. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-27QML UI: we don't need Controls 2.4Gravatar Dirk Hohndel
In commit 99c06dec3d ("Mobile/filtering: simple busy indicator") we switched to Controls 2.4 which requires Qt 5.11. Revert that one line of the commit as it isn't necessary. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: update number of dives shown when resetting filterGravatar Dirk Hohndel
Otherwise we start showing an illogical '0' there when first opening the filter dialog, and the equally wrong previous count when closing and then re-opening the filter dialog. Reported-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23QML UI: remove some of the log file noiseGravatar Dirk Hohndel
A couple came from this series, others are much older. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: show a better message while waiting for the filterGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: implement the filter update through a threadGravatar Dirk Hohndel
It's important to disconnect the model from the ListView, otherwise the update in a different thread will fail. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: remove redundant busy indicator on dive listGravatar Dirk Hohndel
We should use the global one instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: simplify the filter toggleGravatar Dirk Hohndel
Simply make it always reset the filter. There's no point remembering the last filter pattern and explicitly setting it, if the last thing we do is to reset this pattern. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: add properties for dive list model and filter textGravatar Dirk Hohndel
This allows us to modify those from different parts of the code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: clean up whitespace from last commitGravatar Dirk Hohndel
This one does nothing but whitespace - separating it into two commits makes the previous one a lot easier to read. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: add background rectangle for filter rowGravatar Dirk Hohndel
We are still trying to ensure that the filter is indeed shown in front of the dive list. This is working when running on the desktop without the rectangle, but on Android this appears to be needed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: simplify transitionsGravatar Dirk Hohndel
We don't need to toggle visibility, toggling height is sufficient. This dramatically simplifies the transitions. But as a result we need to use the 'enabled' property to reset the filter. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: simple busy indicatorGravatar Dirk Hohndel
Filtering takes a noticeable time on mobile, so lets show the user we are doing something. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: make sure the header is top-most elementGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: ensure filter input field has focus when shownGravatar Dirk Hohndel
QML's logic for who gets focus is a bit complicated. But forceActiveFocus() cuts through the confusion and makes sure that your field does indeed get focus. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: use margins instead of rectangles to create spaceGravatar Dirk Hohndel
I'm not sure why this had initially failed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: only filter when editing is finishedGravatar Dirk Hohndel
This is a usability / performance tradeoff. I like it better when it filters as I type, but on mobile this may make things feel sluggish. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: reset the filter text when toggledGravatar Dirk Hohndel
This seemed less UI clutter than adding a clear button. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: improve code readabilityGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: animate the filter headerGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: add count of filtered dives to search barGravatar Dirk Hohndel
The count in the trip headers is still that for the complete trip and therefore misleading. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: make the search box an overlayGravatar Dirk Hohndel
This way it stays at the top of the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: first attempt to filter on dive siteGravatar Jan Mulder
[Dirk Hohndel: this is the starting point of my following commits, I decided to leave it in place to give Jan credit for the work he did on figuring out some of the plumbing needed to get things to work] Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
2018-10-07QML UI, cleanup: remove usesless ItemGravatar Jan Mulder
Trivial cleanup. A QML Item is intendend for visual items, so embedding a timer in it is plain useless. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-02Mobile: simpify startup logicGravatar Jan Mulder
When starting the mobile app, I noticed a short display of an empty page with title "Cloud creditials" just before showing the divelist. Simply a not nice visual effect. This commit simplifies some logic and resolves this. As the code in this part is fragile, this is tested for normal and clean startup of the app, switching credentials, from no cloud to valid account (which even nicely imports the no cloud dives: this surprised me as I have never seen this working). Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
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-10-01QML UI: trivial resize of dateboxGravatar Jan Mulder
Something that I simply overlooked earlier with respect to scaling the divelist. The trip databox did scale a bit, but it was not nicely related to the hight of the trip header. So there was a tiny overflow on the small scale on a small device. Fixed here. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-30QML UI: correct trip separator lineGravatar Jan Mulder
Partially cosmetic and partially a bug fix. 1) the seperator line between trips and dives that are not in a trip was drawn in the background color => the line was invisible. 2) When looking very closely, there was a 1-2 pixel wide error between the seperator line between trips and dives that are not in a trip. 3) there was a comment that the trip separator needed to be extra thick. IMHO, this looks ugly, and is superfluous as there is a nice sidebar along the dives that belong to the trip. Finally, the line shall not be displayed when not in a trip. So, basically, the line (the QML rectangle) is completely rewritten, to take care of all issues. There is 1 hack: the line color is taken from the dive separator line. But its fully unclear to me where that color is defined in Qt/QML or Kirigami, so I hardcoded the proper color. That just works. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>