aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml
AgeCommit message (Collapse)Author
2018-12-21Mobile: deal with BT name and address when tapping DownloadGravatar Dirk Hohndel
Instead of trying to update this whenever the connection text changes, instead deal with it right before it actually gets used. 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-12-17Import: unglobalize downloadTableGravatar Berthold Stoeger
To make data flow more clear, unglobalize the downloadTable object. Make it a subobject of DownloadThread. The difficult part was making this compatible with QML, because somehow the pointer to the download-table has to be passed to the DiveImportedModel. Desktop would simply pass it to the constructor. But with objects generated in QML this is not possible. Instead, pass the table in the repopulate() function. This seems to make sense, but for this to work, we have to declare pointer-to-dive-table as a Q_METATYPE. And this only works if we use a typedef, because MOC removes the "struct" from "struct dive_table". This leads to compilation errors, because dive_table is the symbol-name of the global dive table! Sigh. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
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-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-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-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-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: make busy indicator smallerGravatar Dirk Hohndel
Suggested-by: Jan Mulder <jlmulder@xs4all.nl> 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-23QML UI: add busy indicator to the main windowGravatar Dirk Hohndel
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: add Settings options for filteringGravatar Dirk Hohndel
Toggle case sensitive and whether or not to include the notes in full text search. 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-23Mobile/filtering: add icons for filter and sortGravatar Jan Mulder
Add 2 icons for filter and sort capabilities. And as before, these icons are coming from the Google Material design set. [Dirk Hohndel: Jan's commit forgot to add the actual icons, I added those so the commit matched its message] Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-21Mobile UI: make SsrfSwitch resizableGravatar Jocke
Back in 8ab8a67f the checkbox where made resizable. This applies the same functionality to the selector switch and makes the two objects match in vertical size. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
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-10QML UI: disable rescan when no bluetoothGravatar Jan Mulder
This is cosmetic only. It make no sense to selected rescan when Bluetooth is off. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-10QML UI: do not try to download from DC with empty vendor/productGravatar Jan Mulder
Disable the Download button when one of the fields vendor, product, connection is not filled in. The app will crash when trying. In addition, make the underlying core code to actual download more safe by checking this, and silently fail instead of crash. And, yes, this is a double fix in this scenario, but the core code is used in more places, so better safe than sorry. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-09Mobile/DC download: reset the "Download" buttonGravatar Jocke
When changing to another DC, reset the "Download" button text. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-10-09Mobile/rememberDCs: remove duplicated codeGravatar Jocke
The code to disable a quick button has moved to the DC matching logic, in order to inactivate the correct button also for USB DCs. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-10-09Mobile/rememberDC: update matching logicGravatar Jocke
Update the matching logic to account for known and unknown BT DCs. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-10-09Mobile: factor out syncToCloud [3/3]Gravatar Jan Mulder
After the previous commits, we now have a preference that nicely preserves the state of the UI, and we have the well known git_local_only global, that is used to denote whether we want to use to local repo only, or we want to interact with the online cloud as well. This commit gets rid of the now superfluous syncToCloud logic. Instead we simply set the git_local_only directly. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-09Mobile: preserve auto download status [2/3]Gravatar Jan Mulder
Hook up the new preference to the UI. So now, an earlier choice if automatic or manual download to the cloud is preserved in between sessions. Strictly speaking this fixes issue 1725. Notice that there is also a higly related syncToCloud thing present. As factoring out that seemingly duplicate piece of code is non-trivial, this will be done in a seperate commit. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-09Mobile: no switch to auto cloud in no-cloud modeGravatar Jan Mulder
We disabled the drawer menu button to switch between auto/manual sync when in no cloud mode. Unfortunately, disabeling does not give a visual cue to the user (like greyed out). Instead, just make this button invisable in no cloud mode. In conjunction a question. The manual sync to cloud menu item takes you to the Cloud Credetials page in case pressed in no cloud mode. While valid, this seems strange. This is not changed in this commit. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-07QML UI: set proper active background color for downloaded divesGravatar Jan Mulder
And another simple one. Make the active background of the dowloaded dives follow the theme. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-07QML UI, trivial: set proper background color GPS listGravatar Jan Mulder
The background color was plain white, where we use a slightly different color in other places. In addition, the background when clicking on a row did not follow the theme setting. Consistency fix. 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>