aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-06-10Implemented the movement of the ToolTip by Hand.Gravatar Tomaz Canabrava
Reimplement the movement of the tooltip by hand, we were adding / removing childs of the tooltip quite often, wich broke the movement of the item using the default behavior, aparently Qt uses a cache of the transformation of the item, assuming that the bounding box of it will not get modified while dragging. wich in our particular case, is a falacy. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-10Save / Restore toolTip information position on the Profile when switching dives.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-10Fix memory leakGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-10Moved the 'create fake dc' to it's own function in device.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-09Merge branch 'fileopen' of github.com:heliocastro/subsurfaceGravatar Dirk Hohndel
2013-06-09Ticket 127 - Repopulate context menu on preferences changeGravatar Helio Chissini de Castro
Ticket 127 mention that context menu is fixed on imperial mode, which is partial true. Context menu only not have the changes on header model updated when preferences are chenges during execution. Hard to note because if program is closed and opened again, the context is initialized properly. Since actions aren't bound to the header model, we need iteract of current items and change the title. Signed-off-by: Helio Chissini de Castro <helio@kde.org>
2013-06-08Fix webservice download dialogGravatar Dirk Hohndel
We need to close the dialog after applying what was downloaded, and we should not try to delete the manager in case of cancel (as that reliably causes the SIGSEGV. Suggested-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-08Include more information on Aquadivelog importGravatar Miika Turkia
This adds information on cylinders and gas changes and some other basic stuff like buddy, dive site, weights. Visibility should probably be ignored as UDDF specifies it as meters and we have a scale of 0-5. But currently it is copied as is to the visibility field in Subsurface. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-08Sort 'dive number' column by date, not numberGravatar Linus Torvalds
Ok, so this sounds insane, but it fixes our currently broken sorting of dive trips vs plain dives not in trips. The reason for that is simple: the dive trips are sorted by date, but that's column #0, and for plain dives is the dive number. So currently the trip-vs-dive sorting looks at the date of the trip, and compares that to the number of the dive. Since the date of the trip is expressed as seconds-since-1970-in-UTC, unsurprisingly the dive number is generally much smaller (even for some very avid divers ;), and so the plain dives end up sorting way at the bottom (or at the top, if you do "oldest trips first" Since the dive number *should* sort as the date, this stupid attached patch just makes us return the dive date instead. Now, there are other possible solutions to this: - make the date of the dive be column 0, and make the dive number be column 1. Quite frankly, while more logical for this particular problem, it probably sucks as a solution. We do want to have a column we can sort dives by that is date-based, but doesn't include trips. And while the dive number *should* sort identically to the date one, the fact is that you can have dives without any numbering, so it doesn't. In contrast, all dives have dates, and sorting numbered dives by date should still result in sane behavior (and if it doesn't, then the insanity comes from the dive numbering, and odd sorting is the fault of the user and indicative of a problem) - We could possibly do something magical like sorting dives by number when they are inside trips, or when no trips exist at all. But then we'd sort by date when there are trips and the dive is outside the trip. But quite frankly, that just sounds insane. So on the whole, I don't love this patch, but it seems to be the least confusing of the possibilities. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-08Use the official QItemSelectionModel::SelectionFlagsGravatar Thiago Macieira
It's a typedef to the QFlags<QItemSelectionModel::SelectionFlag>. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-07Fix compile: mixup of GeoDataCoordinates and GeoDataPointGravatar Thiago Macieira
Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-07Disable Document Mode for MainTab on MacOSXGravatar Henrik Brautaset Aronsen
Commit c4f06dc536392e31a477e592d30fb946f1499595 introduced Document Mode on the MainTab QTabWidget. This doesn't look good on MacOSX. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-07Support for aquadivelog UDDF importGravatar Miika Turkia
This implements limited support for importing dives from a Palm divelog software called aquadivelog. Basic depth graph is imported but most of the metadata is currently discarded. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.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-07Hide/Show tooltip on mouse over view widgetGravatar Helio Chissini de Castro
Proper hide/show tooltip under ProfileGraphicsView. Events are not properly handled and no custom tolltip status was stored. Text are properly hidden now when tooltip is collapsed. Reported-by: Tomaz Canabrava Signed-off-by: Helio Chissini de Castro <helio@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-08Keep last open dives directoryGravatar Helio Chissini de Castro
Last open dives directory is stored in settings, so no need to walk through all subdirectories all the time. Signed-off-by: Helio Chissini de Castro <helio@kde.org>
2013-06-07Remove the dive computer clicking on the trash icon.Gravatar Tomaz Canabrava
This code removes the dive computer clicking on the trash icon, the result is not saved on the XML, this will need a bit of hacking from some of the older guys. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-07Added the code to remove a dive computer.Gravatar Tomaz Canabrava
Added the code to remove a dive computer, plus a few fixes Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-07Removed the buttons on the Edit Dive computers.Gravatar Tomaz Canabrava
This edit dive computers thing doesn't really need buttons anyway. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-07Edit the name of the Dive Computer via dialog.Gravatar Tomaz Canabrava
The GTK version seems to be bugged on this, since the dialog doesn't save the dive computer nickname that I setted, but the Qt version shows less dive-computers than the GTK one on the same dive. I want somebody to do a quick review of my code too. :) I also plan to remove the 'OK' and 'Cancel' buttom, they seem to be overrated on this dialog - fairly uneeded. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-07Created a new dialog - Edit DiveComputerGravatar Tomaz Canabrava
Created a new dialog, Edit Divecomputer, it will currently only lists the divecomputers that are used on the xml file. I used the same method that the gtk version used, but only 2 divecomputers got visualized in the dirk dive data. I'll assume that it's correct and will fix it in the next couple of commits. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-07Allow ctrl-click to select dives incrementally from the globe viewGravatar Linus Torvalds
I guess we should support de-selecting dives this way too, but right now the interfaces only do selection. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-07Fix unused variable warning and spellingGravatar Linus Torvalds
Commit 4b405caa2c47 ("Clean up divelist dive selection") made the sort model variable in headerClicked unused, so get rid of it. Fix a speling eror closeby while at it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-07Merge branch '129_moveOverlay' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-06-07Merge branch '112_webservices' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-06-06Fix movement of the tooltip overlayGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-06Hoocked up the Apply button.Gravatar Tomaz Canabrava
Hoocked up the apply button - Didn't tested ( as I frankly don't know what the expected result should be. ). but the app is not crashing, yey. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-06Hoocked up the buttons and the parsing of the XML.Gravatar Tomaz Canabrava
The XML is now being correctly parsed, Clicking on Help will open the browser pointing to the api site, and clicking on cancel will cancel the download. Clicking on Apply still doesn't apply, but that's next. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-06Added initial support for download dive info from the subsurface web service.Gravatar Tomaz Canabrava
Added initial support for download dive info from subsurface web service, the current code only downloads and output the xml downloaded in the debug area. Now I need to parse things up and plug the unplugged stuff. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.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-06Only show expand/collapse context menu when in tree modeGravatar Dirk Hohndel
The options make no sense when in list view mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-06Distinguish between "collapse" and "collapse all"Gravatar Dirk Hohndel
Some users might want to really see nothing but trips, others might want to be able to keep the trip with the selected dive open. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> 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-05Clean up divelist dive selectionGravatar Linus Torvalds
Since we have a "selectDive()" method, let's just use it rather than opencoding it. Similarly for "unselectDives()". Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-05Fixing some issues with the dive selection after OK on preferencesGravatar Dirk Hohndel
These changes should be correct - but they still don't fix the problem that after we click 'OK' on the preferences (regardless of whether any changes were made), the first dive is set as current dive and shown in the map window. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-05Keep selected dive in viewGravatar Dirk Hohndel
Somehow we managed to break this. Again. 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-06-05Get single click on the map widget in a callback for further processingGravatar Dirk Hohndel
Now Linus can write the code that selects the right dives... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-05Show locations with same name on the map if they are more than 50m apartGravatar Dirk Hohndel
Not showing them at all was a little too blunt of an instrument. There likely are dive spots with the same name at different resorts. And even at the same resort you could have multiple morings for the same dive site. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-05Reload globe after dive location was modifiedGravatar Dirk Hohndel
This way a change to the location name is immediately reflected in the map display. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-05Merge dive tags when merging divesGravatar Linus Torvalds
.. otherwise the dive tags generally end up cleared when you download a duplicate dive from another dive computer. This uses MERGE_NONZERO, which means that if one of the dives has tags set, we'll prefer those tags. If both dives have tags set, we take the tags from the first ("preferred") dive. We could do a "just or all the bits together" too. But this way we at least take a set of tags that are consistent (ie we don't get both "boat" and "shore" set unless one of the original dives already had that inconsistency) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-05Merge branch 'minMaxAvgWidget' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
2013-06-05Update the current dive when no dive was selectedGravatar Dirk Hohndel
The check to only update the dive if there were already dives selected before seems bogus. I'm sure I put it there for a reason but it seems flat out wrong. This gets triggered when you select a trip by clicking on the trip header. In that case all dives get unselected (amount_selected = 0) and then we try to select the first dive in the trip - which fails because of this check. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-04Added a new widget 'MinMaxAvgWidget'Gravatar Tomaz Canabrava
Added a new widget, MinMaxAvgWidget, a simple widget that displays values in 'min, max, avg' fashion. it has a setMaximum, setAverage and setMinimum methods, that is userful for setting the minimum, maximum and average of stuff. Ah, it also shows the minimum, maximum and average of things. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-04Stop showing the first dive after a preferences changeGravatar Dirk Hohndel
What is missing is the code to actually show the RIGHT dive... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-04Rewrite readSettings to do what it should have done from the startGravatar Dirk Hohndel
This function was supposed to take the default_prefs into account but clearly wasn't. Now it should be much more readable and maintainable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-04Explicitly store UI values to prefsGravatar Dirk Hohndel
This helper wasn't called as intended - but because of the syncSettings call which emits settingsChanged this only became visible for the default_filename. Next I need to clean up what is called for the settingsChanged signal. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-03Tie all the pieces together and make Preferences work as intendedGravatar Dirk Hohndel
Not Apply / Close without Saving / OK work as designed. And things get correctly stored and reset. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>