aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/filterwidget2.h
AgeCommit message (Collapse)Author
2019-11-19Filter: split out filter from modelGravatar Berthold Stoeger
Split out the actual filtering from the MultiFilterSortModel. Create a DiveFilter class that does the actual filtering. Currently, mobile and desktop have their own version of this class, though ultimately we may want to merge them. The idea here is that the trip-model and undo-commands have direct access to the filter-function and thus can take care of keeping track of the number of shown dives, etc. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12Filter: call update title directly in filter modelGravatar Berthold Stoeger
Instead of sending a signal when counts change, catching them in the filter widget and update the window title there, directly update the window title in the model. This removes a signal/slot pair. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-19Desktop: show the filter information in the window titleGravatar Dirk Hohndel
Instead of using the filter widget itself to show the information how many dives are displayed, put it in the window title where it's visible even if the filter widget isn't shown. If the filter is not active, simply show the total number of dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-19Desktop: track if the filter widget is activeGravatar Dirk Hohndel
This is not perfect - if you open the filter, set some criterion and then remove it again (without resetting the filter), this variable will give you a false positive). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-26Filter: implement close & resetGravatar Berthold Stoeger
Implement the close & reset functionality, by reseting the application state to "Default". This is currently the only state from where the fiter can be called. To make it consistent with CTRL^F, clear the filter in the hide() slot, which is called in both cases. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-26Filter: implement reset filterGravatar Berthold Stoeger
Move initialization to a separate function and connect that to the reset button. Two points of note: 1) Reseting the text-fields causes signals. Thus, signals have to be ignored during reset. Do this with a new flag. 2) To make reset of the from-date work, the from-date has to be initialized to a distinct value. Setting a default-constructed QDateTime leaves the widget unchanged. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-26Filter: update counts if dives added / removedGravatar Berthold Stoeger
Update the filter counts if dives were added removed by the undo commands. The undo commands call into the filter model at the right time so that hidden_by_filter is already set. The filter model keeps track of the counts and emits a signal, which is caught by the widget. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-22Filter: support imperial unitsGravatar Berthold Stoeger
1) Choose the correct conversion function for comparison. 2) Add a unit suffix to the fields. 3) Update the suffixes on change of preferences. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-19Filter widget: make Ui class subobject of widgetGravatar Berthold Stoeger
Commit 8e81d3f10087fa7ac600dcb18cfebf27716c4209 changed a bunch of Ui classes to be subobject of the widget. For consistency do the same with the filter widget. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-19Filter: connect widget and filterGravatar Berthold Stoeger
In the latest version of the new filter-widget the connection between widget and filter was lost. Connect both - but use a simple function call instead of a signal, since it is not immediately obivous where the connection should be made. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-08Filter for logged/planned divesGravatar Robert C. Helling
Add filter for dives having a planned dive computer or a logged dive computer. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-12-14Handle Show / Close of the Filter BoxGravatar Tomaz Canabrava
when you close, remove filter. when you open again, restore. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2018-12-14Struct FilterDataGravatar Tomaz Canabrava
The idea is that this struct will have all the needed data that will be passed to the filter model. Everything that happens on the filterwidget will fill out this struct, then forward it to the model, that in turn will activate the filter hiding some of the dives that matches on your divelist. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2018-12-14Start to implement a simplified version of the filter widgetGravatar Tomaz Canabrava
The idea of this new widget is to be able to filter more types of data, while keeping it simple and extending the feature set to something that was impossible with the old implementation. While the old implementation had 4 panels that you could use to filter specific tags / people / types of dives the new one will let you filter by visibility, temperature people, name, equipment, etc, in a more natural way than the old one. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>