aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2020-02-28cleanup: remove go-top.svg iconGravatar Berthold Stoeger
No user of that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-28cleanup: remove two unused icon-aliases and one iconGravatar Berthold Stoeger
There were no users of these...? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-28cleanup: remove setTabIcon() calls in MainTabGravatar Berthold Stoeger
These were used to remove warning-icons to mark tabs with user changes. However these icons haven't been set since commit a86aca037843167b26726926dbf2aebe0513afba. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-28cleanup: simplify string-comparison in CylindersModel::setData()Gravatar Berthold Stoeger
Convert to QString instead of a QByteArray. Use qPrintable() instead of data(). This might do one more UTF16->UTF8 conversion. However, this is completely irrelevant, since we don't change the type of a cylinder in a tight loop. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-28cleanup: fix leak in CylindersModel::setData()Gravatar Berthold Stoeger
The C-string cyl->type.description was set without the old data being freed. Free the old string before overwriting the pointer. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-28cleanup: make CylindersModel::cylinderAt privateGravatar Berthold Stoeger
The last outside use of the function was replaced by calls to data(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-28crash fix: Don't cast to CylindersModel or CylindersModelFilteredGravatar Berthold Stoeger
The tank-info-delegate cast its model to CylindersModelFiltered, since this is what the equipment-tab uses since implementing the filtering of unused cylinders. However, the planner users the same delegate and still uses the unfiltered CylindersModel. This means that the (dynamic) cast returns a null pointer and crashes. One possibility would be to derive CylindersModelFiltered and CylindersModel from the same class that defines virtual functions and cast to that class. This is a different attempt: don't cast (i.e. stay with a QAbstractItemModel and play it via Qt's model-view system. Firstly, replace the passInData function by a role to setData(). Secondly, read the working-pressure and size via new columns using data(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-27documentation: additional explanations around Windows USB driversGravatar Dirk Hohndel
This is adapted from a conversation with Jef. Suggested-by: Jef Driesen <jef@libdivecomputer.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-27cleanup: don't update tabs twice in MainTab::rejectChangesGravatar Berthold Stoeger
The updateDiveInfo() call updates all tabs. No need to do it right afterwards. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-27cleanup: remove weightsystems_equal functionGravatar Berthold Stoeger
This was used to test whether the "really discard changes?" message should be shown. However, we now edit weightsystems directly with undo commands. Therefore, the check is unnecessary and the whole function can be removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-27cleanup: remove MainTab::modifiedGravatar Berthold Stoeger
This field was not set to true since introducing undo of dive fields. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-25mobile/profile: make the fonts 25% smallerGravatar Dirk Hohndel
This will seem too small to many - it's pushing it, but it leads to a significantly less cluttered profile, and we now have the zoom capability for readability. I think this is a nice improvement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-25mobile/profile: make the wait before dragging even shorterGravatar Dirk Hohndel
Several users still found the wait too long - this is near instantaneous it just ignores brief taps. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-24CylinderModel: remove unnecessary "Is used" headerGravatar Berthold Stoeger
This header is a rebase artifact and introduces a pointless column in the cylinder tables. It was erroneously introduced in 6622f42aab937e72cc11cb5512012394aa687767. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-23build-system: use working version of Breeze iconsGravatar Dirk Hohndel
As of today some of the icons that we need are no longer in the git repoo but instead created via script. Instead of making this work everywhere, let's just use a working SHA... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-23cleanup: remove CleanerTableModel::warningMessage signalGravatar Berthold Stoeger
Nobody was ever listening to this signal(?) and the last sender was removed in ac52034778bc5c82bb6c689d765b337b6d75b24a. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-22Filter: move actual filtering loop to core/divefilter.cppGravatar Berthold Stoeger
The DiveFilter class defined the showDive() function to test whether a dive should be filtered or not. This was used in DiveTripModel to loop over all dives or all dives affected by an editing action. This restricts us in how we do filtering: We can't use indexes that give us directly the result. To make the filtering more flexible, move the actual loops that do the filtering to the DiveFilter class. The undo-commands likewise called directly the showDive() function to check whether newly added dives are shown. Use the new interface here as well. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-22Filter: update current dive if change hides current diveGravatar Berthold Stoeger
When changing the filter-criterion and the current dive is hidden, a new dive is made current. However, when a dive is hidden because it was edited, it is still shown. Make this consistent by also selecing a new current dive in the latter case. Do this by comparing the current_dive before and after calculating the filter. Since this is now done in multiple places move this code to the ShownChange class. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-22Cleanup: remove shown flag of DiveTripModelTree itemsGravatar Berthold Stoeger
Since we now filter at the model level, items are by definition shown. No need for a flag. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-22Cleanup: remove DiveTripModelBase::SHOWN_ROLEGravatar Berthold Stoeger
This role was used by the filter-proxy model as filter criterion. Since we don't use that model to filter anymore, we can remove the role. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-22Cleanup: remove DiveTripModelBase::sendShownChangedSignals()Gravatar Berthold Stoeger
This was used by the old filtering code. This is not necessary anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-22Dive list: remove filtering in MultiFilterSortModelGravatar Berthold Stoeger
Since we're doing the filtering at the core, don't filter in the sort-model (which is now inappropriately named). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-22Dive list: filter dives at DiveTripModel levelGravatar Berthold Stoeger
We use a QFilterProxyModel to filter out dives that are hidden according to the current filter-criterion. Instead, filter the dives already at the DiveTripModel level. Filter out hidden dives immediately when receiving them. The only difficult case is when dives are changed, because then visibility can change. This means that we have three cases to consider: 1) Visibility unchanged -> send change signal 2) Change from hidden to unhidden -> add dives to model 3) Change from unhidden to hidden -> remove dives from model Things get complicated by the fact that the tree-version of the model might have to add/remove full trips! Suggested-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-19undo: don't add dive to null-tripGravatar Berthold Stoeger
In moveDiveToTrip(), the dive was first removed from its old trip and then added to the new trip. This function is also used to remove the dive from its trip (by moving it to the "null-trip" if you whish). Even in that case add_dive_to_trip() was called. The only reason why this didn't crash is that add_dive_to_trip() checks whether old and new trip are the same. This is the case when adding to the "null-trip", since the dive was removed from the trip just before. To cut a long story short, to trust on add_dive_to_trip() not crashing if moving from the null-trip to the null-trip is way to subtly. If we remove a dive from its trip, don't call add_dive_to_trip() in the first place. Reported-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-18mobile/export: fix styling of radio buttonsGravatar Dirk Hohndel
Use the TemplateRadioButton to get the default styling - and by switching to the RadioButton from Controls.2 we also get exclusivity by default. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18mobile/user-manual: additional changes for style and FTDI supportGravatar Dirk Hohndel
Replace passive voice 'one' with active voice 'you'. More strongly articulate the limitations for FTDI / cable based downloads on mobile devices. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18mobile/user-manual: add short section about Dive DetailsGravatar Dirk Hohndel
This includes comments on how to zoom and pan the profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18update CHANGELOGGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18mobile/profile: enable zoom and pan for the QML profileGravatar Dirk Hohndel
When running mobile on desktop there are some odd jumps in the mouse position while in drag mode (press and hold, then move). They make the user interface seem jerky. But I haven't observed the same behavior on the mobile device when testing. So I'm not sure what to do with that. Using opacity to indicate that the user is able to pan the profile seems reasonably obvious; not sure if it's the best possible way to do this. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18mobile/profile: add x/y offsets to widgetGravatar Dirk Hohndel
This will allow us to pan the profile around in the QML UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18mobile/profile: add elapsed time reporting for profile renderingGravatar Dirk Hohndel
In verbose mode we log how long it took us to render the profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18mobile/profile: create updateProfile methodGravatar Dirk Hohndel
This allows us to trigger an update even if the dive displayed stays the same. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18mobile/profile: add invisible rectangle around QMLProfileGravatar Dirk Hohndel
This way we can clip the profile to it's designated size. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-18mobile/developer: add menu entry to temporarily enable verbose modeGravatar Dirk Hohndel
One could argue that this should be a preference. I like the fact that it isn't persistent, though. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-17mobile/export: fix horrendous user interfaceGravatar Dirk Hohndel
This should never have been merged as it was. The UI was atrocious and the functionality was by and large untested. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>