aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.h
AgeCommit message (Collapse)Author
2013-11-26Remember Trip Selection.Gravatar Tomaz Canabrava
This patch remembers the trip selection across the Dive Tree Model. It's a tiny bit big because we used to have a variable 'selected trips' that's now calculed dynamically - this is more future proof. This is a start of Un-cluttering the view ( for 4.1 I hope to reduce the code in this class to nearly a half. ) Fixes #303 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Shift times of selected divesGravatar Robert Helling
This patch adds the possibility to shift the times of all selected dives by a fixed amount to correct for time zone problems or mis-set dive computer clocks. Select the dives and right click in the dive list. [Dirk Hohndel: added .ui file to FORMS and fixed some whitespace damage] Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-17Add "add dive(s) to trip above" featureGravatar Dirk Hohndel
This honors the sort order of the dive list when figuring which trip is "above". It works both on a single dive or all selected dives. This also fixes a couple other cases where the dive list selection and trip display could get messed up. Fixes #287 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-16Fix wrong handling of Dive Table, and revert some wrong changes.Gravatar Tomaz Canabrava
This patch just reverts some wrong changes that I'v done on a past commit ( sorry ) and correctly handles the selectDive, by using a IDX instead of the dive pointer, as dirk told me it's extremely error-prone since the pointer can change. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Manually add trips from dive list context menuGravatar Dirk Hohndel
We had all the logic, we were just lacking the UI. Fixes #243 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Fix Last Column adding a horizontal Scroll on the Dive List.Gravatar Tomaz Canabrava
Fixes the last column adding a horizontal scroll on the dive list, since we have the hability to show / hide columns, I had to create a helper method to discover what is the last column and set the size of it very small so no scroll is created. Also, I'v set the setStrechLastSection to true. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Maintain the selection when aborting "dive add"Gravatar Dirk Hohndel
We remember what was selected before and restore it. Maybe there's a more "Qt way" of doing this, but my implementation appears to work :-) Also remove unconditional debug output that snuck into an earlier commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09Save / Restore the Tree after organizing by other columns.Gravatar Tomaz Canabrava
This patch saves and restores the state of the TreeView after the user clicks on another columns that will make the tree disappear. All of the branche states are saved, this way the expanded nodes will be restored when the user gets back to tree mode. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09Moved the code that handles DiveList column sizes to its correct file.Gravatar Tomaz Canabrava
I got a bit lost trying to find the code that handled DiveList columns today, so I thought it was better to move it to its file, after all we do have a divelistview.h :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-05Remember the column we are sorting byGravatar Dirk Hohndel
A call to DiveListView::reload always reset our sortcolumn to be 0. Instead we are tracking the correct sort column and sort direction. This also removes an obsolete private member that was unused. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-20Export dives in UDDF formatGravatar Miika Turkia
Implement exporting in UDDF format as was done in Gtk version. File menu exports all the dives, right click on selection exports the selected ones. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17Added 'Save As' option on the dive list menu.Gravatar Tomaz Canabrava
This adds the 'Save As' option on the dive list, very straigth forward, just simple and beauty. tested and working. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11Good deal of whitespace fixes and code cleanup.Gravatar Tomaz Canabrava
I just went thru all of subsurface code removing some whitespaces issues and trying to make the code prettyer, I also removed a few QString issues.d Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
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>