summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.h
AgeCommit message (Collapse)Author
2014-12-29Move the Facebook send profile buttonGravatar Tomaz Canabrava
Move from the Dive List context menu to the Dive Info tab, it will only appear when connected to Facebook. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24Create a Facebook album for SubsurfaceGravatar Tomaz Canabrava
We still need to do a lot of stuff on that part. Currently when asking for sending a profile, it will just create a private album. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> 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-10-31Ctrl+F now opens the Tag FilterGravatar Tomaz Canabrava
And old code for the old searchbar removed. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-21Dive list: seriously simplify the "add to trip" codeGravatar Dirk Hohndel
The existing code seemed way complicated, made way too many assumptions and apparently was broken in certain cases. This code seems very simple, looks correct and should fail gracefully (i.e. simply do nothing) if things get confused. Fixes #706 (I hope) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26Fix crash when trying to add a dive or plan when a filter is active.Gravatar Tomaz Canabrava
The planner used the selected dive on the dive list, and when there's a filtering in action it can be in a state where there's no dive selected. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-28Fix crash on adding / removing a dives from add menuGravatar Tomaz Canabrava
This patch removes some inconsistencies that were happening on the add dive / cancel actions. a bit of legacy code from the old system was still in, which made things quite... EXPLOSIVE. This fixes restoring the selection only if we have a selection and not deleting the temporary dive twice. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Speed up the multi dive selectionGravatar Tomaz Canabrava
Dirk's code in commit a3d300ca919d ("Correctly implement multi dive selection") had a major flaw - it kept redrawing the selected dives one after another. Not what we need. So this fixes this up so that it doesn't take more than a sec to select all the dives that are on the same part of the click on the globe. I've achieved this by creating a boolean ' dontEmitDiveChanged and sending the signal only if this flag is false. The reason that we can't simply remove the emit from the selectionChanged is because the selectionChanged is what we have when we click on the diveList, if we removed this from there, nothing will happen upon selection. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Remove export and save as from dive list context menuGravatar Dirk Hohndel
The context menu is getting way too big and confusing. This is now much more cleanly done from the File->Export dialog. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-21Implementing export dialogGravatar Miika Turkia
As our menus are getting many export entries, it is better to create a single export dialog where user is able to select the export type and whether to export selected dives or all of them. This should also be more intuitive than the current way when export from file menu export all dives and right click menu on divelist exports only selected dives. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-20Dive list: add context menu function to renumber dive(s)Gravatar Dirk Hohndel
No attempt is made to ensure that what the user does is sane. So this can result in duplicate numbers, non-consecutive numbers, non-monotonous numbers, whatever floats the users boat. You can renumber a single dive or all selected dives (with a starting number given that is applied to the oldest selected dive and then for each newer selected dive that number is incremented by one). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-26Add exporting selected dives into CSV fileGravatar Miika Turkia
This adds option to export selected dives into a CSV file to the right click menu on dive list. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Enable posibility to add dives to trip belowGravatar Anton Lundin
When I'm on a dive trip i usually download dives multiple times to start logging them while i still remember them. When i have already created a trip and downloads new dives they needs to be able to be added to the already existing trip, without relying on autogroup. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-18Make lastUsedImageDir static to prevent a crashGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-17Compute dive computer/camera time offset from sample pictureGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-17Store camera time offset in preferencesGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09DiveListView tiny cleanupGravatar Boris Barbulovski
* Change 'searchBox' member type from 'QLineEdit *' to 'QLineEdit' Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-06Include images in profileGravatar Robert C. Helling
This adds an entry to the dive list context menu to load images. The user can select image files and set a time offset to align camera and dive computer clocks. Using the exif time stamp the images are tried to match to the times of the selected dives (with a grace period of an hour before and after the dive). Upon success an event of type 123 is created per image with the string value being the path to the image. Those images are displayed as thumbnails in the profile. If the matching dive does not yet have a geo location specified but the image provides one it is copied to the dive (making the camera a poor man's companion app). This patch includes easyexif https://code.google.com/p/easyexif/ which is originally under a New BSD License to parse the image meta data. This commit includes a new test dive dives/test31.xml with a matching image wreck.jpg to try out the functionallity. Obvious to do's: Have images on the map Have the images clickable Have a proper picture viewer Give visual reference for image time shifting. Use the new profile Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09Divelogs.de: add a divelist context menu item for uploadGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-06Stub out a mark dive invalid functionGravatar Dirk Hohndel
Not sure I'll be able to finish this for 4.0 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02Huge speedup when selecting Dives from the Globe View.Gravatar Tomaz Canabrava
The old code ( slow++ ) ignored that each new dive-selection we recreated all information on the profile window, so this version ( a lot more verbose, I know. ) will ignore all dives that are being selected and will only send the 'dive was selected' information in the last line of the algorithm, instead of calling it for each dive on the list of 'to be selected' dives. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>