summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-03-08usb-serial-for-android: Implement timeout-handlingGravatar Christof Arnosti
Since the Android USB stack and subsequently the usb-serial-for-android driver have problems with read-timeouts, the read-timeout is now implemented in AndroidSerial.java. Also, DC_STATUS_TIMEOUT is returned if there are less bytes returned than expected. Different chipsets seem to behave differently with usb-serial-for-android. On CP210x the read blocks until there is some data here, but on FTDI the chip seems to return whatever is currently in the buffer (so 0 bytes if the buffer is empty). This different behaviour should be mitigated by the changes by this commit. Signed-off-by: Christof Arnosti <charno@charno.ch>
2020-03-08usb-serial-for-android: switch detection to usb-serial and add more PID/VIDGravatar Dirk Hohndel
If we detect any of the known PID/VID combinations, use 'usb-serial' instead of 'FTDI'. Also add the now supported additional PID/VID combinations. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07debug: try to capture changes that don't invalidate git cacheGravatar Dirk Hohndel
At least in those cases where we are sending a divesChanged signal we can easily check if the cache was properly invalidated. Of course this won't help in cases where we don't notify the dive list about changes, either. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07mobile UI: remove obsolete access to already removed model roleGravatar Dirk Hohndel
We no longer have a dive role - on the plus side, we also don't use this variable, so I guess this isn't a big deal. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07mobile UI: re-enable download status when restarting downloadGravatar Dirk Hohndel
When tapping on 'retry' we didn't clear the flag that decided which message to display. Fixes: #2651 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07usb-serial-for-android: add changelog lineGravatar Christof Arnosti
Signed-off-by: Christof Arnosti <charno@charno.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07usb-serial-for-android: add PID/VIDsGravatar Christof Arnosti
Signed-off-by: Christof Arnosti <charno@charno.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07usb-serial-for-android: ImplementationGravatar Christof Arnosti
Implement the libdivecomputer API in Java and create C/JNI translation layer. [Dirk Hohndel: whitespace harmonization - yes, some of this is Java, this still makes it much easier to read for me; also changed the FTDI conditional compilation to make sure we can still use that for mobile-on-desktop if necessary] Signed-off-by: Christof Arnosti <charno@charno.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07serial-usb-for-android: Display all Serial computersGravatar Christof Arnosti
Signed-off-by: Christof Arnosti <charno@charno.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07travis build-scripts: update containerGravatar Christof Arnosti
While the project doesn't use Travis anymore, these scripts are indeed useful when building locally, so it makes sense to keep them current and working. Signed-off-by: Christof Arnosti <charno@charno.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07usb-serial-for-android: add dependencyGravatar Christof Arnosti
Signed-off-by: Christof Arnosti <charno@charno.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-07divetripmodel: send shown changed signal on resetGravatar Berthold Stoeger
Once the the mobile app uses the new models, this will be necessary to get the correct number of filtered dives after startup. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-07divetripmodel: mark derived classes as finalGravatar Berthold Stoeger
This is an idle "optimization": The compiler may now not need to access the vtable when calling virtual functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-06divetripmodel: use change of CURRENT_ROLE to propagate current diveGravatar Berthold Stoeger
If compiled on mobile, on change of the current dive, don't send a signal, but send changed-event with the CURRENT_ROLE for both dives that changed status (previously selected and newly selected). Mobile does not use this yet, but will do so with the new flattened models. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-06divetripmodel: add TRIP_HAS_CURRENT_ROLEGravatar Berthold Stoeger
This role returns true if the given trip contains the current dive. This will be needed by the mobile list model to decide if a newly added trip should be expanded right away. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-06divetripmodel: introduce CURRENT_ROLEGravatar Berthold Stoeger
Use this role to test whether a dive is the currently displayed dive. This will be needed to transport changes of the current dive to the mobile list models. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-06mobile: allow disabling BT support from the command lineGravatar Dirk Hohndel
This is a quick hack to reduce the noise in the log file when chasing other bugs. Maybe this should not be enabled on release builds, but right now I don't think the harm that having this in would do. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-06Cleanup: Move stringToList to core/qthelper.cppGravatar Berthold Stoeger
The same code was used in desktop and undo commands. Let's unify. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-06Cleanup: use getDiveSelection() for shifting timeGravatar Berthold Stoeger
There are two cases where dive-times are shifted: in an explicit dialog and when editing the date/time of a dive. In each of these cases, the selected dives were collected manually. Instead use the getDiveSelection() function. Since this returns a std::vector, change the argument of Command::ShiftTime() to such a std::vector. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-06Core: don't return invalid cylinders from explicit_first_cylinder()Gravatar Berthold Stoeger
For reasons which I don't yet understand, when plotting a dive whose first cylinder is not cylinder 0 and then plotting a dive with only one cylinder, it can happen that for the latter explicit_first_cylinder() returns an erroneous value. This is due to the way in which we copy the dive to be plotted to displayed_dive. For now, make sure that no invalid cylinder is returned to avoid crashes. This will have to be changed anyway, since this is very fundamentally not thread-safe and inefficient. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-05desktop UI: fix typo in GPS import UIGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-05cleanup: make version_printed variable static and local to functionGravatar Berthold Stoeger
The version_printed variable is used to print version information only once. It was a global variable, but never used outside of its function. Therefore, move it into the function and make it static. Since this is a plain old datatype (POD), it makes no no difference whatsoever whether the static variable is in block scope or not. Indeed, it is initialized in the data segment). Well, we are in C mode and therefore everything has to be POD by definition. I tested this on gcc and clang. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-04Mobile UI: fix typo in disabled planner setupGravatar Dirk Hohndel
While this is disabled and is unlikely to be completed, the typo caused confusion with translators. This shows one of the weaknesses of the way we set up our translations, in that always both desktop and mobile are translated together, and disabled code is also included in those translations, causing unnecessary work for the translators. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-03Update translation source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-01selection: update selection on key-pressesGravatar Berthold Stoeger
Commit 2cea115ddb7528d9e6dd1bf918ebf5c670b82479 "fixed" the selection by hooking into mouseRelease events. An unintended consequence was that scrolling with the cursor keys didn't update the current dive. Therefore, also hook into the corresponding key-press events. This is just horrible, but I'm not aware of any possibility to fix it properly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01mobile/filter: derive numShown from a new Q_PROPERTYGravatar Berthold Stoeger
The number of dives was updated when the model of the list was changed. Since we removed the multi-threading, the model is not disconnected/connected anymore and therefore we don't get the appropriate signal. Instead of introducing a different signal, make the shown-value a Q_PROPERTY. Thus, we can easily send a changed signal if we have to. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01CHANGELOG.md updateGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01mobile: remove filter settingsGravatar Berthold Stoeger
These are not used anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: don't search in background on mobileGravatar Berthold Stoeger
I experienced weird crashes that seemed timing-related when using the filter. Therefore, remove the multi-threading thing. So far no more crashes, but keep a close eye on that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01mobile/filter: use more appropriate placeholder textGravatar Dirk Hohndel
This way it matches the filter mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-01filter: introduce people- and tags-filtering in the mobile UIGravatar Berthold Stoeger
Add a combo-box where the user can switch between "fulltext", "people" and "tags" filtering. Connect the combobox to the already existing filter-code. Dirk: make combo-box smaller by using a smaller font and restricting the width. Setting both maximum and preferred widths gives more consistent results. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-01filter: implement searching for tags and people in mobile filterGravatar Berthold Stoeger
Implement tag- and people-filtering in the mobile version of DiveFilter. As opposed to the desktop version, this has no different modes: it always searches "startswith" and "all of". I.e. all of the search strings must match and a tag / person is considered as matching if it starts with the search term. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: remove diveContainsText()Gravatar Berthold Stoeger
This function checked a dive for a search string. Its functionality was replaced by a fulltext index. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: use DiveFilter on mobileGravatar Berthold Stoeger
Use the DiveFilter class on mobile to update the filter. This is mostly for convergence of the mobile and desktop models. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: implement full-text filtering in mobile version of DiveFilterGravatar Berthold Stoeger
In analogy to the desktop version, use the fulltext index in DiveFilter. This code is not yet executed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: remove DiveFilter::updateDiveStatus from classGravatar Berthold Stoeger
This function did not access any class members and was not used outside the tranlation unit. Let's make it local (i.e. static) to the translation unit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01mobile: remove DiveListSortModel::getFilterString()Gravatar Berthold Stoeger
This member function was never used. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: compile fulltext index on mobileGravatar Berthold Stoeger
The code is not used yet. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: fix tab-order of filter widgetGravatar Berthold Stoeger
This was basically random. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: on show focus on fulltext-fieldGravatar Berthold Stoeger
After pressing CTRL-F let the user immediately enter a search string. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: connect fulltext filter to frontendGravatar Berthold Stoeger
There are now three filter modes: 1) Dive site 2) Fulltext 3) Normal When doing a fulltext search, get the dives that match the fulltext filter and then apply the other filters on that list. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: add fulltext field to filter widgetGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: index/unindex dives on loading or clearing logsGravatar Berthold Stoeger
When loading dive data, populate the fulltext index. When clearing dive data, free the fulltext index. When deleting a dive, remove it from the fulltext index. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: add fulltext filtering codeGravatar Berthold Stoeger
Add code that indexes all words of a dive and provides searching for words. A query is represented by the FullTextQuery class, which can be initialized by assigning a string to it. It is basically a list of words. The result of a search is stored in the FullTextResult class, which is a list of dives. The actual indexing and searching is implemented in the FullText class. However, this class is not exported because the interface is partially accessible to C. Notably, the reloading of the fulltext index is done from the C core. Currently, the indexing and searching is totally unoptimized. In a ~4000 dives test-log searches typically took single-digit ms times. There is ample room for optimization (e.g. when searching for multiple words, chose the words with few dives first and when down to a few dives, check them individually). The words of each dive are tokenized and uppercased and cached with the dive. A pointer to these words is stashed in the dive structure. For now, compile only on desktop. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: move StringMode out of FilterDataGravatar Berthold Stoeger
The FilterData struct has the enum StringMode, which describes how strings are searched (substring, startswith, exact). To make it more generally accessible, remove it from the class. Since it is an "enum class", the values don't pollute the global namespace anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-28Update libdivecomputerGravatar Dirk Hohndel
Pull upstream libdivecomputer updates from Jef Driesen: - fix lack of "end of deco" on DiveSystem iDive computers by reporting long NDL values - clean up handling of Oceanic empty logbugger - fix BLE download for Oceanic Pro Plus X that doesn't like the serial number handshake. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-28cleanup: remove preferences-other-iconGravatar Berthold Stoeger
No user of that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-28cleanup: remove advanced.png iconGravatar Berthold Stoeger
No user of that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-28cleanup: remove gaschangeICD iconGravatar Berthold Stoeger
No user of that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-28cleanup: remove scale.svg and scale.png iconsGravatar Berthold Stoeger
No users of those. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>