aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.h
AgeCommit message (Collapse)Author
2013-09-23Add "merge selected dives" to dive list popup menuGravatar Dirk Hohndel
This is fairly straight forward. What I dislike is the check for the magic number of "14 indeces". I'm sure there's a better way to tell if more than one dive is selected... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-04Qt: Implement trip merging logicGravatar Linus Torvalds
So during my Maui trip, I had a short hiatus in diving, causing subsurface to start a new trip for the last day of diving. I could have just started the old gtk branch to fix it up, but decided that I might as well try to implement the "merge trip" logic in the Qt branch instead. This is the end result of that. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Consistently use slots / signalsGravatar Dirk Hohndel
We started out using Q_SLOTS and Q_SIGNALS but then changed our mind. Let's make this consistent again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-14Show & edit trip location and notes when exactly one trip is selectedGravatar Dirk Hohndel
While we still show the selected_dive in the profile and use it for Dive Info and Equipment, in the Dive Notes tab we now show the trip location and trip notes (and none of the other fields), if the user directly selects a whole trip by clicking on the trip header. This clever reuse of the widget now allows trip location and notes to be edited in place. As a side note: the Gtk version has long allowed the user to edit the trip location and trip notes, but nowhere did it ever SHOW the trip notes... so this is more than just feature parity... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-12Implements the DiveList to behave like Linus Explained.Gravatar Tomaz Canabrava
Implements the divelist to behave like linus explained, essentially, it filters the layoutChanges of the model, greps for trips, and for each trip that it finds, it set the 'firstColumnSpanned' property, to make the column to have the size of the whole table. e Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-07Make a map ctrl-click toggle the selection stateGravatar Linus Torvalds
This way the map selection works like normal selections do. Except we don't do "ranged" selections (shift-click) for fairly obvious reasons. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-06Try to get rid of unnecessary reloads of the dive listGravatar Dirk Hohndel
Don't call refreshDisplay() after preferences change. This strangely somehow leads to a situation where I need to move the mouse over the dive list before changes to the units are reflected. When calling reload() do not force layout change / resort unless that is the intention. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-06Add delete dive context menu entryGravatar Dirk Hohndel
Getting closer to the way this should work. Adjusted the call to reload to not switch back to tree view and resort (oops). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-06Implement the context menu a different wayGravatar Dirk Hohndel
It seems that this is the way this is supposed to be done - instead of manually looking at what kind of click we get, Qt decides when to create a context menu for us - this way things like the Windows Menu button will work automagically. As an example I also implemented the "remove dive from trip" functionality, which exposes some other bugs (like the fact that the dive that isn't part of a trip ends up being sorted at the very end of the dive list). This commit contains a "testSlot" implementation to remind me how to figure out which dive / trip we are on. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-06Add context menu to dive listGravatar Dirk Hohndel
So far we support "expand all" and "collapse" all. This still needs to be restricted to only be shown when in trip / tree mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-05First cut at selecting dives from the mapGravatar Linus Torvalds
We'll want to enhance this: better logic for which dives are near the selection, and it's probably best to have a "control-click" that adds the dives to the selection rather than deselecting all the old ones. But it's already useful. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-30Add a proof of concept for filtering the Dive List,Gravatar Tomaz Canabrava
Press CTRL+F and a line edit will appear, whenever you write on that will be used as a filter against all columns. The results are maybe somewhat surprising in trip mode, but when sorting by another column this shows some potential. Hit ESC to remove the filtering. I need to find a better position to put the Widget, but it's a proof of concept. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-29Fixed the regression of selection not being stored from table to treeGravatar Tomaz Canabrava
This fixes the regression that I caused in the last commit, where the selection was being correctly reestored from tree-to-table, but it was incorrectly being restored from table-to-tree. I also added a bit of speedup on the view while changing columns. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-29More work on bug 111, Sorting works as it should.Gravatar Tomaz Canabrava
Sorting is now working as it should, changing from table to tree, keeping the selection from table to tree ( but there's a regression on tree to table conversion, I'll try to fix it in the following commit. ). this commit also cleans a lot of boilerplate code that I wrote to bypass a graphics bug, that I seem to have correctly fixed in this version. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-28Switch between Tree / list on column - click.Gravatar Tomaz Canabrava
This patch adds support for switching Tree / List while clicking on a column header. This triggers a sad-painting bug on the list - I guess I'll have to fix it too. I'd apreciate some help on it, tougth. next: keep the selection. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-26Fix colum visibility selection in the divelistGravatar Dirk Hohndel
Several changes: - split the reload of the DiveListView from the reload of the header - don't include the column title in the name of the setting; the title will change depending on the units and localization chosen by the user - rename the slot that toggles visibility to make the code more readable - use setCollumHidden() method to simplify the code - don't save the width of hidden columns (as they would be saved as zero width and can then no longer be enabled) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-21Added code for handling of show / hide of columns.Gravatar Tomaz Canabrava
The code also remembers to save in the config file. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-16Fix loading a second dive, after the first file was loaded.Gravatar Tomaz Canabrava
This patch fixes loading a second dive-file after the first one had been loaded. it simply clears some information and makes sure that the current selected dive is invalid when the file closes. I also did a bit of code cleanup on this one to make things simpler in the future. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-14code to show profile againGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-13shift-key + shift-click + key corner cases covered.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-13Trying to make the DiveList selection behave correctlyGravatar Tomaz Canabrava
And rip out all the code that Dirk put there to do that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-13Add Qtr_ macros that uses gettext in a tr() compatible mannerGravatar Dirk Hohndel
This should wrap gettext nicely and replace the "_()" macros we use in C code. Also added comments to the top of all the new files. Suggested-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-12Add dive list view to main windowGravatar Amit Chaudhuri
Add files for dive list model/view implementation. Replace TableView with the custom list view. Amendments to makefile to match. Note: we don't yet handle trips and may want to add additional columns to describe the dive. A single, dummy dive is added to show how this works (get root; item is child of root). Purely to illustrate - needs proper integration etc. Amend member names for dive list view components Various naming changes to conform to coding style. Required changes to members (remove prefix) and methods (avoid clash with members). Clean up indentation (swap spaces for tabs). Code for model/view was written with a different editor which had different settings :-/ [Dirk Hohndel: minor whitespace cleanup] Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>