aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2013-06-20Added a 2 Ruler Items, Time and Depth.Gravatar Tomaz Canabrava
The ruler items are needed so I can get the correct coordinates of the planned dive. This is a very rudimentary ruler and it needs a bit of love, but it already gives me something to work on. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Added the skeleton for the Ruler Item,Gravatar Tomaz Canabrava
The ruler will deliver the Time and the Depth, later. it should be vertical or horizontal, and will have ticks Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Make the plan handlers to not move across other handlers.Gravatar Tomaz Canabrava
This patch disables the hability to move handlers across the others, making a 'zigzag' in the time line. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Added drag and drop code to the dive planGravatar Tomaz Canabrava
Added drag and drop code to the dive plan, it can move the user- inputted data, but will not touch the computer generated ones. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Created a class DiveHandle to make drag drop work.Gravatar Tomaz Canabrava
Create d a class DiveHandle to make drag drop works, it has a from and to Lines, and it will move them around. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Make the cross red when you cant plot a dive stopGravatar Tomaz Canabrava
Make the cross red when you cant plot a dive stop, also make impossible to put a dive stop before the last one. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Better defaults for placement of dive stops.Gravatar Tomaz Canabrava
This patch makes it impossible to create a dive stop outside of the scene - this, messing the complete planning system. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Created a cross that follows the mouse on the dive planner.Gravatar Tomaz Canabrava
Created a cross that follows the mouse on the dive planner, this will help the user to know where it is placing the stop. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Fix creation of the poligon-based lines for the dive plannerGravatar Tomaz Canabrava
This fixes the creation of the poligon-based lines next thing to do is to forbit creation of the next point before the last one. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Better handling of the scene size for the dive PlanGravatar Tomaz Canabrava
Better handling of the scene size for the dive plan, The scene can be resized and a transform will be applied, the handles will not resize however - they are 10x10px and that's it. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Plots Lines and handles on the PlannerGravatar Tomaz Canabrava
This is still a bit bugged - the lines are going to the wrong end - most probaly I messed something on the math. I'll now fix the sizing issue then I'll try to make it behave in the proper way. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Make double click work to put new items on the canvas.Gravatar Tomaz Canabrava
Make double click work to put new items on the canvas. Those items right now are QGraphicsEllipseItems, but it will change to 'draggable' items. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20Added the first scope of the visual dive planner.Gravatar Tomaz Canabrava
Added the first files and skeleton code for the visual dive planner. now I need to fill things. The code is using the print action borrowed, this will need to move to a better choice in the future. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-19Show sample pressures in the cylinder equipment pageGravatar Linus Torvalds
If we don't have any manually set pressure data, show the data from the samples instead. It uses an italic font for this case, mainly because I couldn't figure out how to gray things out. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Don't show '0.0%' gas percentagesGravatar Linus Torvalds
It's just distracting. Leave it empty. No helium should be visually very different from actual trimix, and for oxygen, zero means something different anyway (it's air). In neither case is '0.0%' a good string to show, just show it as empty. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Fix the imperial cylinder size calculations in equipment handlingGravatar Linus Torvalds
This makes us use the same linear calculations as we did in the Gtk branch. We don't take compressibility into account, since tank manufacturers don't seem to either. A Luxfer AL80 is 11.1 liters, and with the standard (non-compressibility) calculations, 80 cuft of air at 3000 psi is 11.094 liter, so that is the right model to use. Also, stop with the horrible "units in edited numbers" stuff. It uses up precious space, and doesn't look any better. If the user asked for cuft, give him cuft without making a big deal about it. Oh, and if the working pressure doesn't exist, sizes are always in liters. That's what we did in the Gtk branch, that's what we do here. Again, no reason to even bother stating units, it's not helping. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19O2/He percentages aren't integralGravatar Linus Torvalds
We do gas mixes in permille, not in percent. Some people really like using the value they got from the analyzer, which is generally something like 29.4% or whatever. So don't truncate percentages to integers. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19More logical layout for the Dive Info tabGravatar Dirk Hohndel
Up until now the tiles seemed to be arranged rather randomly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Replace wet_volume calculation with straight forward pressure formulaGravatar Dirk Hohndel
Since no one else approximates gas volumes at higher pressures, we shouldn't do that either when converting imperial tank names (cuft @ working pressure) into wet volumes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Fix cylinder data O2/He percentage entry braindamageGravatar Dirk Hohndel
I can't even begin to explain what got me to write this in the first place. It makes no sense from any angle I look at it... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Better minimum width for yearly statistics windowGravatar Dirk Hohndel
The Qt default was way too small. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19Improve readability of yearly statisticsGravatar Dirk Hohndel
Make the entries for years bold, keep the months non-bold. It's still a sea of data, but this is an improvement. 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-18Fix yearly statisticsGravatar Dirk Hohndel
This commit fixes two issues. One is that there were situations where the code would read an uninitialized parent pointer, the second was that instead of the monthly statistics the tree view would show the yearly statistics again under the yearly entries. I assume that the second part of the fix (initializing the parent pointers) actually takes care of both of them (that patch was suggested by Tomaz), but the first part that just makes sure the pointer is at least initialized to NULL seems to be at least not harmful, so I kept it as well. With this the yearly / monthly statistics seem to be pretty much at feature parity. Fixes: #115 Suggested-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-18Improve display of yearly statisticsGravatar Dirk Hohndel
Display the units in the header, make the header more consistent looking, convert the values into the right units with appropriate precision. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-18Reduce the bleeding in my eyesGravatar Dirk Hohndel
This is all just coding style and white space cleanup. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-18Clean up the last mergeGravatar Dirk Hohndel
While the code is correct, splitting the class like this is silly and will confuse me later. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-18Merge branch 'qtHelper'Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-18Converting the device_info list into a Qt data structureGravatar Dirk Hohndel
This data structure was quite fragile and made 'undo' when editing rather hard to implement. So instead I decided to turn this into a QMultiMap which seemed like the ideal data structure for it. This map holds all the dive computer related data indexed by the model. As QMultiMap it allows multiple entries per key (model string) and disambiguates between them with the deviceId. This commit turned out much larger than I wanted. But I didn't manage to find a clean way to break it up and make the pieces make sense. So this brings back the Ok / Cancel button for the dive computer edit dialog. And it makes those two buttons actually do the right thing (which is what started this whole process). For this to work we simply copy the map to a working copy and do all edits on that one - and then copy that over the 'real' map when we accept the changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-17Yearly stats are being displayed.Gravatar Tomaz Canabrava
Yearly stats are being displayed. the code is similar to the GTK one, but I advise the reader that it's a bit risky ( I got an unreproducible crash but it seems to be fixed now. ). The selection behavior is *weird* and I have no idea why, but I'm very sleepy - will try to look at it again tomorrow. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-17Create a view for the Statistics Model and Fix displaying the headerGravatar Tomaz Canabrava
This simply creates a view to show the model, while doing that I noticed that the model header wasn't showing, so I fixed it too. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-17Started to do the Yearly StatisticsGravatar Tomaz Canabrava
This is the fisrt bunch of compilable code for the new Yearly Statistics there's nothing to see here, move along... Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-17Changed a lot of code to reduce boilerplate on models in the future.Gravatar Tomaz Canabrava
So, I changed a lot of code to reduce boilerplate on models in the future. Currently we do not have a lot of models, but this can increase quite rapdly. There's a second TreeModel in the works, the Yearly Statistics, this patch will save around 250 LOC for this new model, and more and more models will give us a greater saving. Iwll do that for the table models in the future too - I did the tree models now because they are the most complex case and I didn't wanted to create a second tree model without this. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-17Merge branch 'renumberDialog' of github.com:tcanabrava/subsurfaceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-17Show the device id in hexGravatar Dirk Hohndel
This is consistent with what we used to do Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-17Improve the initial size of the device name editing dialogGravatar Dirk Hohndel
This is not "automagic" as I had hoped but appears to give a good starting point. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-17Merge branch '119_divecomputerManagement' of github.com:tcanabrava/subsurfaceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-17add forgotten file.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
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>