aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
AgeCommit message (Collapse)Author
2019-10-27Mobile: make the GPS service icon work againGravatar Dirk Hohndel
I don't recall when this stopped working. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: ensure we go back to the dive list after downloadGravatar Dirk Hohndel
The pop() by itself wasn't enough to do that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: try harder to get the right dive listGravatar Dirk Hohndel
This should ensure that the dive list correctly repopulates after the model was updated. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: also show busy spinner when applying GPS fixesGravatar Dirk Hohndel
That's another function that can take a little while. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: simple message and busy spinner while storing downloaded divesGravatar Dirk Hohndel
Due to some recent changes processing the downloaded dives and re-displaying the dive list can take quite a while. So show a small message and the busy spinner to warn the user. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: change show/hide busy functionsGravatar Dirk Hohndel
The old code was ill named - this way the busy spinner itself becomes reusable with a reasonable set of function names. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: provide better tracking of applied GPS fixesGravatar Dirk Hohndel
Also reset the page stack to make sure we don't end up with stale data. 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: reset dive list after applying GPS fixesGravatar Dirk Hohndel
This way new fixes are actually shown when the user looks at the dive list after applying the GPS fixes. 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-26Mobile: fix incorrect variable dereference for dive siteGravatar Dirk Hohndel
Since we are accessing the model, this is the variable we should use. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: don't push map page if it's already on the stackGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: avoid dereferencing undefined valuesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: fix cacheBuffer for log windowGravatar Dirk Hohndel
The old value made no sense at all. Why would we want to cache up to 10k entries of the log? 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-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: 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-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: improve helper function to track selected divesGravatar Dirk Hohndel
While on mobile there should always be only one selected dive, it's very cheap to make sure that amount_selected is tracked correctly. The incrementing of amount_selected is done in case an invalid id is passed in. Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: bring back the adaptive size for the tool barGravatar Dirk Hohndel
When switching to the global tool bar this was lost, and then it turned out to be broken and required more patches to fix. Commented out because it doesn't work at all. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: ensure consistent path when accessing arrow iconsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: implement our own back entry for GlobalDrawerGravatar Dirk Hohndel
This way we'll get a working back icon on Android and also correct font size for the (translated) Back text. 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: add helper function to keep selection in syncGravatar Dirk Hohndel
Without this the core data structure never gets updated to reflect which dive is currently selected. 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-10-13Mobile: use tri-state variable to improve the map hackGravatar Dirk Hohndel
QML enums are a bit painful to use, so this uses poor man's emums instead. Basically what this changes is that a forced switch to the map doesn't count as picking the map. That seems obviously correct, as otherwise you could end up in a situation where a legitimate switch away from the map is ignored. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: insane hack to make map page workGravatar Dirk Hohndel
This makes no sense and seems crazy. But it also seems to work, For some reason with the current Kirigami version and Qt 5.13.1 selecting the map page makes the pageStack jump back to the previous page right away. I cannot find what triggers this behavior. Since I cannot fix the root cause, I am working around the bug. When we select the map page we remember that fact and when a different page is picked with the mapPage being the last page on the stack, we force the page selection back to the map page. I can imagine countless ways in which this could go horribly wrong - but right now I can't figure out a better solution. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: keep existing page stack when showing mapGravatar Dirk Hohndel
There doesn't appear to be a reason to pop all of the existing pages from the stack. Just on principle, only close the drawer if it was open. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: need to recalculate column width when rotatingGravatar Dirk Hohndel
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: change handling of columns and column widthGravatar Dirk Hohndel
The old calculation was clearly bogus, we'd also get zero columns here. Instead do a correct calculation of the number of columns and make the resulting column width a property of the rootItem so we can refer to it elsewhere. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: ApplicationHeader is now deprecatedGravatar Dirk Hohndel
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-10-06Fix text in darkmode on mobile app.Gravatar Paul Buxton
Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
2019-10-04Cleanup: Turn DiveListSortModel into classical singletonGravatar Berthold Stoeger
To make this class available from QMLManager, the run_ui() function would create the object and then set a pointer in QMLManager. It works, but is inconsistent with the rest of the code. Therefore, make it a classical singleton class, which is generated on demand. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-02Mobile: fix reloading dive list after downloadGravatar Dirk Hohndel
There was a sad typo in commit eecca6aab0 ("Mobile: replace model-reset by row-addition in DiveListModel::reload()"). Additionally, we need to also refresh the dive list so that the new dives are shown. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-02Mobile: don't allow width change without rotationGravatar Dirk Hohndel
We get incorrect changes to a new screen width that causes us to try draw to a much larger screen than we actually have. Ignore those changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-02Mobile: add more debugging output for screen width issueGravatar Dirk Hohndel
Somehow we need to be able to figure out which width information is correct. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-02Mobile: recalculate base units only for first real changeGravatar Dirk Hohndel
Different Android devices seem to have different patterns of throwing incorrect width information at us. This seems like a really bad hack, but for the ones I've seen so far this should give us the right width information. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-02Mobile: only print debug output if there's informationGravatar Dirk Hohndel
On many devices the Screen property doesn't give us a manufacturer, model, or name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-02Import: Make DownloadThread a subobject of DiveImportedModelGravatar Berthold Stoeger
Currently, desktop and mobile are accessing the DownloadThread and the DiveImportedModel concurrently. This makes a big data flow mess. To achieve a more hierarchical data flow, start by making the DownloadThread a subobject of DiveImportedModel. Start the download by calling a function in DiveImportedModel. Route the finished signal through DiveImportedModel. Thus, the model can reload itself with the new data. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-27Mobile: replace model-reset by row-addition in DiveListModel::reload()Gravatar Berthold Stoeger
Owing to apparent QML breakage, a model-reset leads to the DiveDetail page being reloaded for every dive in the list(!). Therefore, add rows instead. This leads to extremely subtle code, as it is now imperative that the model has been properly cleared beforehand. Nevertheless, for now we have to do this to fix a severe performance regression. Fixes #2295 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-27Mobile: clear dive data via modelGravatar Berthold Stoeger
Clearing the dive data directly in the core leaves us with an inconsistent model. Therefore, clear via the model. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-27Mobile: Don't access dive-id via DiveObjectHelperGravatar Berthold Stoeger
There is already a role to do that. Query the model directly to avoid creating a full DiveHelperObject. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-09-27Revert the singleton PRGravatar Dirk Hohndel
It turns out that this isn't working the way it was intended to. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-09-25Cleanup: Pass gpsTrackers directly to GpsListModel::update()Gravatar Berthold Stoeger
Instead of using the GpsLocation singleton in GpsListModel::update() to extract the gpsTrackers, pass the gpsTrackers as function argument. The caller has direct access to the GpsLocation object anyway and this make things less entangled. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>