summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-03-21mobile/models: make dive invalid flag available to mobile UIGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21Android: use Subsurface as TAG for log messagesGravatar Dirk Hohndel
Having the file name as TAG was just stupid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile/tripedit: close page after savingGravatar Dirk Hohndel
That's consistent with how we do things on other pages. Also hide the on-screen keyboard. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile/settings: attempt to fix the layoutGravatar Dirk Hohndel
The hardcoded widths with fixed values was just flat our broken and created all kinds of strange artifacts. But even with this somewhat more idiomatic approach this still isn't perfect - on wider screens it doesn't shrink back to the minimum column width. But that seems like a bit of a corner case. Overall this feels like a huge improvement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile/DCdownload: try harder to get the right elements selectedGravatar Dirk Hohndel
The number of possible sequences of events when the user is connecting a USB device is rather surprising. These changes try to ensure that in every case we get USB connection information we do in fact show the correct (or best guess) connection. See #2686 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile UI: stop the use of dark icon themeGravatar Dirk Hohndel
This was used very inconsistently and had more bugs than positive impact. See #2686 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-20Ignore invalid dives in statisticsGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Core: consider invalid flag when adding divesGravatar Berthold Stoeger
Adding dives uses the number of the last dive to create a new dive number. Ignore invalid dives. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Dive filter: reset filter on change of display_invalid_dives flagGravatar Berthold Stoeger
The user had to restart the application or manually change the filter if they changed the flag. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Dive list: add option to mark dives validGravatar Berthold Stoeger
If the dive the user clicked on is invalid show an option to make the dive valid. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Dive list: mark invalid dives with a struck out fontGravatar Berthold Stoeger
Mark invalid dives in the dive list by striking them out and rendering them with a grey color. The color-change is not sufficient, because the default model delegate ignores color hints if the item is selected. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Filter: hide invalid divesGravatar Berthold Stoeger
Hide invalid dives if prefs.display_invalid_dives is false. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Undo: implement invalidate-dive commandGravatar Berthold Stoeger
Connect command to context menu. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Core: introduce invalid flag for divesGravatar Berthold Stoeger
Implement reading/writing the flag from/to XML/git. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-19More translation updatesGravatar Dirk Hohndel
Good progress by the translation teams! Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-19cleanup: fix mis-spelling of UCT in comments as wellGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-19Typo: UCT to UTCGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-03-19cleanup: remove unnecessary includeGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-18mobile: remove QMLManager::updateSiteList()Gravatar Berthold Stoeger
The location information model is updated automatically by the divelist-model and the undo commands. Therefore remove the QMLManager::updateSiteList() function. We do have to keep the locationListChanged() signal though, because the list of dive sites is not exported via model/view but rather via a Q_PROPERTY. We really should change that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-18models: update divesite-model when clearing/updating dive modelGravatar Berthold Stoeger
When the dive list is cleared or updated, the entries in the divesite-model become stale and therefore the divesite-model (with the actual name LocationInformationModel) also must be updated. This was done manually in some parts of the code and forgotten in others. Therefore, do it directly in the clear() and reset() function of the dive list-model. This might be a bit of a layering violation: why should one model call into another if they are not in parent/child relationship? However, this seems easier than introducing a global "reset dives" function that coordinates the models. Moreover, it does not appear 100% safe: if the clearing of the divesite model causes accesses to the divelist-model, they happen in the midst of a model reset and we had horrible bugs with that kind of things. However, I don't think that should happen. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-17undo: remove EditNumber commandGravatar Berthold Stoeger
Number editing works via the RenumberDives command. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-17divetripmodel: remove setData() functionGravatar Berthold Stoeger
The setData() function was used to edit the number of a dive. However, that doesn't appear to be functional. Therefore, remove the code. There is a context-menu entry "renumber dives" for that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-17filter: update fulltext index when editing diveGravatar Berthold Stoeger
In edit commands, the fulltext might have changed and therefore we have to update the fulltext index. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-17cleanup: remove record_dive() functionGravatar Berthold Stoeger
No user left. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-17git: load into arbitrary dive tablesGravatar Berthold Stoeger
The git parser loads into the global dive table, even if it is called indirectly via parse_file(). However, parse_file() may be given a different table. Fix this by extending the git parser state. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-17mobile/cleanup: add some more log messagesGravatar Dirk Hohndel
This will help understand the control flow in the log. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-17mobile/cleanup: remove the second access to cloud dataGravatar Dirk Hohndel
While I remember some of the thinking that went into doing things this way, the more I read the code, the less it makes sense to me. This is a rather drastic step, but in reasonably extensive testing it seems to work in every case that I tried. That's rather embarrassing, actually. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-17mobile/edit: don't add dive site twice to tableGravatar Berthold Stoeger
When editing a dive on mobile we might have to create a new dive site. That site is added to the global dive site table in the undo command. However, the code in QMLManager created the dive site with create_dive_site*() functions, which already adds it to the table. The undo command then added the dive site again leading to a hang of the application. To solve this problem, create new alloc_dive_site*() functions that do the same as create_dive_site*() but do not add it to the table. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-16mobile/DC-download: select reasonable connection after rescanningGravatar Dirk Hohndel
This seems to make more sense than to not select anything (which was the previous behavior). If the same connection is still available, select it again. Otherwise pick the top connection (which is the right thing to do if the user has just plugged in a USB device and refreshes the list -- that device will show up as top entry). Based on a suggestion by Christof Arnosti <charno@charno.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16mobile/DC-download: show USB devices before BT/BLEGravatar Dirk Hohndel
This makes sense because USB devices will only show up when connected, while BT/BLE will get listed once they are paired, even if not currently connected. So the higher likelihood of being the device a user is looking for is for any USB devices that show up, so those should go first. Suggested-by: Christof Arnosti <charno@charno.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16git: return strdup()ed empty string on error in pop_cstringGravatar Berthold Stoeger
The pop_cstring() function is used by the git parser to duplicate a quoted string. On error, it returns an empty string literal. Since the caller expects a copied string and takes ownership of that string, it will ultimately be freed. Concrete example: a log with erroneous cylinder data was opened getting such an empty string literal as description. On closing or syncing with the cloud, the dive is freed, leading to a free of the string literal -> crash. Return a copy of the empty string instead. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-16Translation updatesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16translations: add missing plurals for en_USGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16Mobile user manual: some updates for Subsurface-mobile 3.0Gravatar Dirk Hohndel
This needs more work and especially new screen shots, but for now this covers at least some of the most important changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16Update Subsurface-mobile versionGravatar Dirk Hohndel
I believe this deserves a major version number increment. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16Android: remove legacy FTDI supportGravatar Dirk Hohndel
This works on almost no devices anymore and has been replaced by the USB serial support for Android. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: better memory managementGravatar Dirk Hohndel
Instead of relying on the std::vector staying unchanged and not freeing its members, instead keep a copy of the object in our DCDeviceData class. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: simply restart the download after receiving permissionGravatar Dirk Hohndel
If the user tries to download from a device that he hasn't given the app permission to read from, Android will pop up a dialogue asking for that permission. With this after giving the permission we continue (well, technically, restart) the download which is likely the expected behavior. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: refresh USB device list on entering download from DCGravatar Dirk Hohndel
The usbRescan() code is smart enough not to duplicate entries that might already be there. And with this the user doesn't have to manually tap rescan if they didn't open Subsurface-mobile via the intent after a device was plugged in. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android: don't show /dev/ttyS* connectionGravatar Christof Arnosti
Signed-off-by: Christof Arnosti <charno@charno.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: remove "autoselect driver" option for unknown VID/PIDsGravatar Christof Arnosti
Signed-off-by: Christof Arnosti <charno@charno.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16mobile UI: rescan button on DC Download page rescans BT/BLE/USBGravatar Dirk Hohndel
This way even if a USB device wasn't added through an Android intent, we still have a way to scan for it and select it. This is especially important in case a user has a cable that we haven't seen yet (i.e. with a VID/PID that we haven't added to Subsurface-mobile), but that nevertheless works with the android usb serial drivers. This also makes the flow a little more logical / consistent when deciding which connections to show. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16mobile UI: remove special case for Atomic AquaticsGravatar Dirk Hohndel
This dive computer hasn't been supported on Android in quite a while. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: stop adding the obsolete 'usb-serial' connectionGravatar Dirk Hohndel
The code that supported this has now been replaced by the USB device selection code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: pass in the UsbDevice when downloadingGravatar Dirk Hohndel
This finally allows us to download from not just the first device, but specifically the device that the user picks. Passing the object through a void pointer is not nice - but since this traverses C code other solutions (like passing an index into the list) seemed even worse. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: show download page again after USB permission grantedGravatar Dirk Hohndel
If the user hadn't granted USB permissions, yet, we asynchronously get informed once they did that. This ensures that the user gets taken back to the download page once they approve. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: parse the usbDevice when responding to intentGravatar Dirk Hohndel
This vastly simplifies our handling of devive information as we simply use what is already in the descriptor. This way we do not duplicate information about USB devices in the QMLManager. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: pass the usbDevice for intent handlingGravatar Dirk Hohndel
Instead of creating a string with all the object information, simply pass the actual object to the C++ code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: remove alternative way of scanning for devicesGravatar Dirk Hohndel
We now always create a list of usb devices that doesn't list a driver for known devices, and adds multiple entries with each of the drivers for devices that are unknown to us. This removes some debugging output in the ..._open() function as well. This could be combined with Christof's earlier commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16android/usb: add helper to recognize chipsets known to usGravatar Dirk Hohndel
This will allow us to know when we can guess the driver. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>