aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2013-06-17Addes a simple 'Renumber Dialog', very similar to the GTK one.Gravatar Tomaz Canabrava
This code adds a Renumber Dialog, that's most a copy & paste of the GTK visual, I didn't tried to do anything fance with it, but I still dont like how it looks like. a better management form is needed. :) ( Well, actually my dislike is mostly because it's on a menu and it's on a popup, I think a 'toolbox' should exist to hold all of those widgets that don't belong to the menu - will try that later ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-16Properly initialize device_data_t when downloadingGravatar Linus Torvalds
The old gtk branch started out with device_data_t explicitly cleared, but the Qt version never did that. And we actually depend on the deviceid in particular being initialized to zero (and then we fill in the details in the divecomputer download callbacks) Not properly initializing it meant that we ended up with random deviceid's that got added to the divecomputer device lists, and then saved to the XML file without actually matching the data in the dive computers in the actual *dives*. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-16Save / Restore the sizes of the columns in Cylinders / Weigth widgetsGravatar Tomaz Canabrava
This patch saves / restores the sizes of the columns in the cylinders and weigth table widgets, so everything is now properly behaved. There 's still other things to do - but I'm tired. i's sunday and there's a protest against the brazilian government to go. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-16Removed the grid lines of the table views.Gravatar Tomaz Canabrava
Removed the grid lines of the table views, this makes the table view more similar with the dive list - I'm searching for an application identity here. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-16Remove the Vertical Header on Cylinder and Weigth editGravatar Tomaz Canabrava
Remove the vertical header on the cylinder and weigth edit, It was strange to show, since we don't show a thing there. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-16Make the columns have a sane default width for 'type'Gravatar Tomaz Canabrava
Make the columns on Cylinders edit and Wheight Edit to have sane values for 'type', this is needed because the old behavior was to set it fixed size, and the default fixed size was silly. this calculates a good predefined value taking the font size in consideration. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-16Better handling of default sizes on the Cylinder and Weight widgetsGravatar Tomaz Canabrava
Better handling of default sizes on the Cylinder and weight widgets, the weigth widget didn't had a CSS applied so it looked odd compared to the cylinder one, also the default behavior for the combobox delegate didn't worked very well with the css applied, being too small. this patch fixes that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-16Made all models have the same font.Gravatar Tomaz Canabrava
The models were a bit messy - some of them got the correct font, other didnt. This patch creates a new function 'defaultModelFont()' that is being used to return the font in all cases now. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-16Create a 'ComboBoxDelegate' to concentrate the comboboxness of delegates.Gravatar Tomaz Canabrava
This patch creates a ComboBoxDelegate where the other specific delegates should inherit from. this adds a little code cleanup for the current version, and will help as soon as more delegates got added to the code. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-15Partially fix dive downloadingGravatar Linus Torvalds
The Qt branch didn't set the preexisting dive count, so matching old dives didn't work and it always downloaded all of them. Also, we need to autogroup dives before displaying them if autogrouping is on. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> 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-14Don't offer "delete dive" context menu for tripGravatar Dirk Hohndel
If we are not on a dive we shouldn't try to delete it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-14First deselect, then selectGravatar Dirk Hohndel
For reasons I still don't understand, sometimes (but not always) when clicking on a trip header we appear to get a select notification for the trip and at the same time deselect notifications for every dive in the trip. This seems wrong but I can't seem to figure out why it happens - and of course it causes us to have a mixed up interpretation of what is selected in our internal selection tracking. Simply acting on the new selection after the newly deselected items are handled appears to fix the issue, but I do worry about this change. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-14Plot cleanupGravatar Dirk Hohndel
Use a helper to make things easier to read. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-13Improve the trip headerGravatar Linus Torvalds
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-13Merge branch 'linusDiveList' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-12Fixed the show / hide dialog shortcuts to take the splitter into considerationGravatar Tomaz Canabrava
Fixed the show / hide dialog shortcuts to take the splitter into consideration, So, here's the deal. We have a few QSplitters that takes care of helping us with the size of a few widgets, they are ok, and we should continue using them to manage the visibility of them too. But the way that we did before was to widget->hide(); something, and if you hided something using the splitter, by holding it's handle and collapsing the widget, then you used the 'ctrl+number' shortcut to show it, it whould only show a gray panel. This patch makes everything behave using the splitters. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-12Add fifth view mode "Globe" for main windowGravatar Dirk Hohndel
For consistency I didn't change the meaning of Ctrl-1/2/3/4 and added this as Ctrl-5 - but one could just as easily make the argument that "ViewGlobe" should be Ctrl-4 and "ViewAll" should be Ctrl-5. This ensures that only one of the four widgets is shown in the individual modes, but it doesn't address the drawing issues with the profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-12Do not plot on showEvent if dive is already plotted.Gravatar Tomaz Canabrava
We do a force-plot on showEvent because the user can have asked to open a dive file via command line, so the app needs to open already with a profile plotted. if the user opens the program, loads a map, hides the profile by hitting ctrl + 1, then shows the profile again by hitting ctrl + 2, we do not want to do all the math to show the profile again, because we already have it in memory. this also fixes dirk's strange behavior of funky profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.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-12Display the correct metric SAC rate in divelistGravatar Dirk Hohndel
We were doing integer math by mistake. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-12Change title of dive download formGravatar Benjamin Fogel
The title of the form to download dives from a computer was simply "Form". Signed-off-by: Benjamin Fogel <nystire@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-10Added a slot to set the full time of the dive planGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-10Added a simple "TextEditor" in the graph, for a plan mode.Gravatar Tomaz Canabrava
Added a simple TextEditor in the graph for the 'Dive Plan' mode, this text editor is very simple, so the user can double click on 'depth' or 'duration' to set the depth or duration of the dive. Since this was a test, only 'duration' was done, and I'll add duration on the next commit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-10Added a 'Plan' mode and a 'Dive' mode on the profile.Gravatar Tomaz Canabrava
Added a 'Plan' mode and a 'Dive' mode on the profile. Those modes tell the application what can be done: Plan - the dive's dinamyc and can be changed, 'Dive', the dive is fixed ( most probably downloaded from a dive computer and it's readonly. ) - now I need to properly populate stuff. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-10Added the option to create a new dive from the menu.Gravatar Tomaz Canabrava
This patch adds a dive from the menu, it's the dive that will be used to add a new dive plan. so, I also removed the option 'add imput plan' from the menu. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
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-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-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-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>