aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
AgeCommit message (Collapse)Author
2014-11-08Reorder initializers to be more c++-strictGravatar Anton Lundin
c++ have some idea about in what order things should be initialized. This makes us comply with that order. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07Remove leading spaces in buddy tagsGravatar Anton Lundin
The buddy list generated by the buddy tag logic gets separated by ,<space> so this trims away any leading spaces from the buddy name. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07Show extra data in separate tab on MainTabGravatar Dirk Hohndel
This way any extra data probided by the dive computer is visible to the user (without other processing). This data cannot be edited by the user as it reflects the information given by the dive computer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04Make sure we don't use the 'changed' flag uninitializedGravatar Dirk Hohndel
Valgrind reported this while I was testing the previous commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03Correctly unselect trips when dive list filters changeGravatar Dirk Hohndel
Oddly Qt left the trips selected (but all dives where unselected in the UI). This got our internal state rather confused. With this change we clean up that mess and go back to just having those dives that were originally selected and are still visible show up as selected. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03Improve selection behavior of the multi filterGravatar Dirk Hohndel
Only dives that remain visible stay selected. And if all selected dives are removed by the filter, pick a new selected dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01Show single buddies instead on the filter.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01Make filter UI comply with capitalisation styleGravatar Tim Wootton
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Small random whitespace cleanupsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31FilterRow implemented for LocationFilter.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Repopulate method on LocationFilterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31setData method for LocationFilter.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implemented the flags method for LocationFilter.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implemented the 'data' method of LocationFilter.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implemented the constructor of LocationFilterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implemented the instance method of LocationFilterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Location Filter, skeleton code.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Treat buddy as Buddy and Divemaster, sort the filter lists.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Fixes in the buddy finding algorithm.Gravatar Tomaz Canabrava
I was comparing the strings in the opposite direction. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implement the Buddy Filter interface.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implemented the filterRow method for BuddyList.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implemented the 'repopulate method' for BuddyFilterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implemented the flags method for BuddyFilterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implemented the setData method for BuddyFilterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Impelmented the Data method for BuddyFilterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implemented the constructor for the BuddyFilterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Implemented the instance method for the BuddyFilterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31Added the skeleton for the BuddyFilterGravatar Tomaz Canabrava
Just the skeleton of the functions, nothing working yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31TagFilter -> MultiFilterGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30Revert "Divelist: make the column headers for units left aligned"Gravatar Dirk Hohndel
This reverts commit d5f19c43c925468f363f0e509816df724f930db9. With the changes to the headers in commit 3515ad71c159 ("Divelist: remove units from header, add tooltip") I think this isn't needed anymore and actually reverting it creates a cleaner look. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30Display dive duration in dive list in whole minutesGravatar Linus Torvalds
The whole "duration in seconds" is being way too OCD about the information, and just makes it harder to read. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30Divelist: remove units from header, add tooltipGravatar Dirk Hohndel
This should help with the issues we are having with alignment / visibility of the relevant information in the divelist. Most people will never switch the units (or maybe switch them once, the first time they use Subsurface). So having the units shown in the table header quickly becomes redundant - yet having the units in there causes all kinds of layout issues. This patch adds a tooltip to both the header and the main data area of the divelist. The tooltip shows the column name plus unit and the column header no longer shows the units. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29Divelist: make the column headers for units left alignedGravatar Lubomir I. Ivanov
Fixes #739 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19Resolution-independent trash iconGravatar Giuseppe Bilotta
Also, generate the corresponding pixmap only once, and distribute it to all models that need it. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Define auxiliary functions for metricsGravatar Giuseppe Bilotta
Collect font, font metrics and icon size functions in a separate module. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-02Add possibility to filter by more than one criteria at a timeGravatar Tomaz Canabrava
This new version of the TagFilterSortModel actually accepts *any* new MultiFilterInterface. So, how to use it to create a new filter: Implement a class that inherits from MultiFilterInterface Implement the filterRow method TagFilterSortModel::instance->add( myClass ); and you are done. [Dirk Hohndel: removed some debug code and did whitespace cleanup] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-20Show everything when nothing is checked.Gravatar Tomaz Canabrava
This patch fixes a bit of the logic used. Now we show every dive if nothing is chedked. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18Switch some columns to right alignment in divelistGravatar Anton Lundin
Some columns in the dive list makes more sense to have right aligned than left aligned. This switches the numeric columns to right alignment so they is more easily compared visually. But, we keep the NR-column left-aligned because we use its left indentation as dive-in-a-trip marker. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17Fix crash at startupGravatar Dirk Hohndel
Not sure this is the right fix, but at least it doesn't crash any more. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17Random whitespace updateGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17Show everything by default.Gravatar Tomaz Canabrava
We should show all dives by default. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17Better filtering of dives with no tags.Gravatar Tomaz Canabrava
New rules for them, a new item on the model with the text "Empty Tags" should be marked if the user wants it to be displayed. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17Implement trip-filtering.Gravatar Tomaz Canabrava
Trips will be filtered if it doesn't find any tags for dives. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17Correctly filter dives. (trips are always shown)Gravatar Tomaz Canabrava
This patch correctly filter dives based on tags, but it will also keep showing all the empty trips. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17Create the sorting method.Gravatar Tomaz Canabrava
This method should remove a row on the dive list model visualization if none of the tags that it have are marked as 'visible'. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17Implement the TagFilter model.Gravatar Tomaz Canabrava
This model accepts check / unchedk. Now, I need to also plug the result of the check / uncheck to the list model. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27Use one consistent font size throughout the appGravatar Dirk Hohndel
Let's see how much people notice it / hate it. Fixes #712 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-22Divelist: switch to better column headersGravatar Dirk Hohndel
And move the units there. This is a long going back and forth. What we want is narrow columns. But what we need is something that's easy to understand for our users. I'm open to other suggestions, but I think this moves us in the right direction. See #712 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11Rename dive gas function and defines for clarityGravatar Anton Lundin
This renames the dive gas functions to not talk about just nitrox, and to instead talk about gas. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11Rename the model column from NITROX to GASGravatar Anton Lundin
The column isn't just about NITROX, there might be air and trimix in there too. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>