aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
AgeCommit message (Collapse)Author
2020-06-08mobile/dive-details: restrict width of tags fieldGravatar Dirk Hohndel
Having a lot of tags (or more precisely, a tags string that is very long) could cause the width of the dive details view to extend past the width of the the page. The txtTags label was missing a maximum width, and to make the result more useful, I also added correct wrapping and elide to the mix (stupidly, we had the wrap and width for the fixed name of the field ('Tags'), but not for the user determined content of that field). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-07mobile: add option to merge local cloud cache dataGravatar Dirk Hohndel
The UI is ugly, and of course this is hidden in the developer options that have to first be enabled in the advanced settings. As I mentioned in the previous commit, I believe the actual risk that something gets damaged here is very low, but still, explaining this so it makes sense to the casual user may be a bit... difficult. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-07mobile: add helper to import data from local cloud cacheGravatar Dirk Hohndel
If you pass in the repo name, it isn't treated as cloud storage, but simply as local git storage and imported (i.e., added) to the current dive list. This allows the user to work around failed no-cloud->cloud transitions, merge different accounts, and most importantly deal with situations were conflicts on the server caused us to move a cache out of the way and potentially make dives that were on the mobile device inaccessible to the user. Once a UI is added, this allows the user to recover those dives (realistically this is not really all that potentially 'dangerous' to do, but it's definitely something that would best be done after talking to someone who understands the cloud storage and can guide the user...). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-07mobile: make list of local cloud cache directories availableGravatar Dirk Hohndel
This way QML can show those to the user. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-07mobile: tiny whitespace updateGravatar Dirk Hohndel
Every time I edit main.qml, QtCreator fixes this for me. And then I filter it from the commit to not mix white space and actual changes. So let's just get this fixed and move on. 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-25mobile/credentials: email address must be lower caseGravatar Dirk Hohndel
I could have sworn that I have fixed this several times in various places, but apparently (as shown by todays support emails) it's still possible to setup a mixed case email address. So let's try to solve this problem at the very top. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-22cleanup: create common QDateTime -> timestamp conversion functionGravatar Berthold Stoeger
In analogy to the timestamp -> QDateTime conversion, create a common function. 1) For symmetry with the opposite conversion. 2) To remove numerous inconsistencies. 3) To remove use of the deprecated QDateTime::toTime_t() function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
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-05-18mobile/UI: correctly theme template spin boxGravatar Dirk Hohndel
This was all hard coded and wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-18mobile/dc-download: fix dark theme appearanceGravatar Dirk Hohndel
I noticed that the download from dive computer page looked especially bad in the dark theme (a user sent us some screenshots for a different reason) and a quick look at the sources showed that we weren't using our template label. Switching to that gives us the correct size by default so we can drop all those explicit font size parameters. And we get the correct color as used in the theme. One random whitespace cleanup snuck into this commit. Oh well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-14mobile/dive-details: show tagsGravatar Dirk Hohndel
So far the user can't edit them, but at least they are now shown as part of the dive details. Usage of tags varries widely, I've seen people who use a LOT of tags to classify their dives, so I'm giving this a complete row by itself. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-14mobile/dive-details: less whitespace at the topGravatar Dirk Hohndel
This always seemed odd - the location looked like it sat 'low' on the screen. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-14mobile/dive-details: use our labels to create denser displayGravatar Dirk Hohndel
This makes better use of the screen real estate, without (IMHO) seeming too crowded. This is a tough balance to strike. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-14mobile: reduce vertical white space around labelsGravatar Dirk Hohndel
Our labels all seem to have a lot of empty vertical space around them. Try to be a bit more conservative with space. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-14mobile: add smaller, vertically dense template labelGravatar Dirk Hohndel
By default single line text has too much white space around it. This smaller, denser label works well to more efficiently use screen real estate, I think. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-07cleanup: invert control-flow when resetting the core structuresGravatar Berthold Stoeger
To reset the core data structures, the mobile and desktop UIs were calling into the dive-list models, which then reset the core data structures, themselves and the unrelated locationinformation model. The UI code then reset various other things, such as the TankInformation model or the map. . This was unsatisfying from a control-flow perspective, as the models should display the core data, not act on it. Moreover, this meant lots of intricate intermodule-dependencies. Thus, straighten up the control flow: give the C core the possibility to send a "all data reset" event. And do that in those functions that reset the core data structures. Let each module react to this event by itself. This removes inter-module dependencies. For example, the MainWindow now doesn't have to reset the TankInfoModel or the MapWidget. Then, to reset the core data structures, let the UI code simply directly call the respective core functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-21cleanup: replace constructs of the type &vector[0] by vector.data()Gravatar Berthold Stoeger
It appears that some misguided compiler / library combinations crash on &vector[0] for empty vectors. Even though very unfriendly, they are technically correct, so let's remove these constructs. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-18mobile UI: indicate status of verbose flagGravatar Dirk Hohndel
This way the user can verify that they have set the log to verbose mode in the developer menu. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-13mobile: don't call main loop for notifications once initializedGravatar Berthold Stoeger
Calling qApp->processEvents() in QMLManager::setNotificationText() caused crashes, because it could lead to the context-menu that initialized the call being deleted. Something that QML apparently doesn't like. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-13mobile: remove overwriting of line special case in ui-notificationGravatar Berthold Stoeger
On startup, we showed progress of the population of the fulltext and listmodels for every 100th dive. This worked by overwriting the last line if the new line started with '\r'. Since we don't do that anymore, we can remove this special case. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-04mobile/startup: fix potential crash when switching back and forthGravatar Dirk Hohndel
If the user switches away from Subsurface-mobile and back while we are in our initialization phase, that code might run more than once leading to undesirable results. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/cleanup: create helper function to hide verbose castsGravatar Dirk Hohndel
The strange enum casts (that apparently we needed in order to have strongly typed enums in QML) are really ugly and confusing in the code. Since we had this three times it seemed worth to create a little helper that hides this nonsense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/cloud-storage: correctly transition from no-cloud to cloudGravatar Dirk Hohndel
We know that we have valid credentials, so calling openLocalThenRemote() makes no sense, worse, it doesn't respect the special case of transitioning between accounts. That's the whole point of having a separate loadDivesWithValidCredentials() call. Once we have transitioned state, we need to record the now current state as the old state so that future transitions will work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/cloud-storage: fix test for no cloud to cloud transitionGravatar Dirk Hohndel
The noCloud variable contains our desired state, we need to test for the previous state for this to make sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/cleanup: remove outdated comment and fix whitespaceGravatar Dirk Hohndel
We haven't supported the GPS web service for a long time. Also, add another message for the log to be able to more easily trace one error case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/undo: set undo stack as clean after saveGravatar Berthold Stoeger
If we're using the undo stack for determining the whether there are unsaved changes, we have to mark the undo stack as clean after save. This duplicates code from desktop. It is planned to unify this in the near future. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-04mobile/undo: consider undo-stack when checking for unsaved changesGravatar Berthold Stoeger
In analogy to desktop, also consider the state of the undo-stack when testing for unsaved changes. This prevents us from missing changes. This adds duplicate code, which will be unified in the near future. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-04mobile/edits: ensure changesNeedSaving is calledGravatar Dirk Hohndel
These appear to be the only cases where we forgot to ensure data is saved. And pastDiveData is currently not called as the UI to use it has been removed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile: when creating gps dive site use the new dive site nameGravatar Berthold Stoeger
The code was using the pre-editing dive site name, which appears weird. Not sure if that was on purpose. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-04mobile: properly recognize changed dive siteGravatar Berthold Stoeger
QMLManager::checkLocation() would only return true if the dive-site itself was changed, not if the dive-site was set to a different site. Thus, in some cases edit events could be lost. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-04mobile/download-from-DC: ensure that changes get actually savedGravatar Dirk Hohndel
Calling saveChangesLocal() seems like the right thing to do, but it doesn't do anything useful if the dive list hasn't been marked as changed. The correct helper function to call is changesNeedSaving() which makes sure we save the changes and update all UI information. [Berthold: since this removes the last QML caller of saveChangesLocal() we can make that function private.] Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-04mobile/cleanup: fix whitespace and remove verbose messagesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile UI: delay reading the dive list until app is activeGravatar Dirk Hohndel
This way the launch screen is shown significantly shorter on a device, and instead the user sees our progress notifications. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile UI: only test for plugged in USB serial device on AndroidGravatar Dirk Hohndel
This test makes no sense on other platforms (and the log file text is frankly confusing when not running on Android). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/core: remove locking for git accessGravatar Dirk Hohndel
We have convinced ourselves that only the main thread will ever trigger a save operation, therefore the locking is not needed (and it has recently started to cause user problems where local changes aren't saved to storage and get lost). Fixes #2718 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/dive-list: don't use cacheBufferGravatar Dirk Hohndel
QML documentation recommends against using the cacheBuffer for longer lists and doing more testing shows that this really doesn't help at all. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/dive-list: performance improvement for invalid divesGravatar Dirk Hohndel
Small optimization that reduces the number of accesses to the underlying model. Instead of evaluating the isInvalid member eight times per delegate, we only check it once. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/dive-list: only show dive list notifications when it is visibleGravatar Dirk Hohndel
Without this check we'll show the 'Please tap the plus botton...' notification during app initialization as we are showing the initial set of messages - which makes no sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/startup: show progress update earlierGravatar Dirk Hohndel
Instead of not showing a notification until after we are done loading the data into our models, tell the user that we are about to do that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile/startup: show notification directly in the UI windowGravatar Dirk Hohndel
Until the app is initialized, we have problems getting the 'floating' passive notifications to show up and be useful. Instead update the user by filling a text block on the otherwise empty initial page of the app. Delay the switch to the dive list until the app is initialized and then use the passive notifications again. While we are initializing also show a busy spinner so the user doesn't think the app is hung. As a side effect of this change, the dive list isn't shown until our models are initialized. And strangely this causes every single possible delegate to be instantiated. We can prevent that by not setting the dive list model until after we are done setting up the model. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile UI: setup callback for the new notification mechanismGravatar Dirk Hohndel
This simply passes the text to the existing notification text mechanism. The call to processEvents() ensures that Qt processes the UI events after we updated the notification and that the user gets timely updates; otherwise the UI might look like the app is hanging. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04mobile: add indication if the app has finished initializingGravatar Dirk Hohndel
This will help us to ensure that notifications are actually shown on the UI during the startup phase. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04cleanup: update all copyright dates to 2020Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04undo/mobile: keep track of dive sitesGravatar Berthold Stoeger
When editing the dive site of a dive, the dive-table of the corresponding dive site was not properly updated by the undo commands. Try to get this right. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-31mobile/dive-list: try to force focus on filter text fieldGravatar Dirk Hohndel
This was triggered by a change in enabled, but what is really changing is the visible property. This should work better. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile/dive-summary: make the drop downs smallerGravatar Dirk Hohndel
Especially on smaller screens we had issues fitting this on the screen. And it looks fine on larger screens as well. 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>