aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
AgeCommit message (Collapse)Author
2014-03-03Whitespace cleanupGravatar Dirk Hohndel
Minor change to the perl postprocessing script and resulting changes to the affected source files. This deals with two issues: - "foreach"-like structures were not always treated correctly - some longer calculations that ended on "+ constant" were reformatted in a rather unatractive manner In one source file (divelist.c) I ended up adding braces to the sources... trying to cascade the indentation further down without having the block there seemed a lot more trouble than it's worth. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-02Add Units to mean depth valueGravatar Gopichand Paturi
Fixes #445 Signed-off-by: Gopichand Paturi <gopichandpaturi@gmail.com> 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-27Try to fix the font issue on the ruler.Gravatar Tomaz Canabrava
This changes the ruler a bit, I hope nobody gets offended by it. :) The main issue is that the scene is now 100x100 pixels wide, so the font was *really* huge. and setting itemIgnoresTransformations on the ruler broke a lot of stuff. I removed the code that painted the text and created a QGraphics TextItem for that - that will hold the text for the ruler. Then I played with the view to get the correct angle of the line, that was in scene coordinates and thus, could not be used directly on the item that had ignore transformation changes. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27New profile: Make the ruler work. (caution, fonts are BIIIG )Gravatar Tomaz Canabrava
This patch makes the ruler work again, the problem is that the fonts are *terribly* big, I'll fix that on the next commit. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Remove the pInfo pointer, make it a real structure instead.Gravatar Tomaz Canabrava
This fixes the invalid pointer stage crash. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27New profile: Toggle on / off the ruler via settings.Gravatar Tomaz Canabrava
This patch toggles on / off the ruler via QSettings. When the user clicks on the toolbar, this sets the settings to true / false, in a way that if the user turns Subsurface on/ off, we still get the last choosed option. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27New profile: add the RulerItemGravatar Tomaz Canabrava
This patch adds the RulerItem inside of the new profile, and already takes settings into consideration. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27New profile: DiveRuler compiles / not working yet.Gravatar Tomaz Canabrava
This patch removes the GC macros and change the calling to use the DiveCartesianAxis. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27New profile: add placeholder code for the RulerItemGravatar Tomaz Canabrava
This patch just creates two files for the rulerItem, a .h and a .cpp. nothing was done to make it visible on the new profile yet - will do that on the next commits Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27New profile: connect the scale actionGravatar Tomaz Canabrava
Just quick'n dirty glue code so that when the user clicks on the 'scale' toolbar item, the new profile graphic is scaled. Lovely thing: Animations for free. <3 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-26New profile: create fake DC if we have no samplesGravatar Dirk Hohndel
This call got lost when creating the new plot_info structures. dives/test15.xml is a good test case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-25New profile: try to pick better HR samples for which to print numberGravatar Dirk Hohndel
This simply tries to pick at least local minima / maxima. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-25New profile: fix tooltip display for eventsGravatar Dirk Hohndel
We need to use the transform() of the view, not the tooltip. Suggested-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-25New profile: small cleanup of heartrate codeGravatar Dirk Hohndel
Remove unused variable and correct comment. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-25New profile: add event info to tooltipGravatar Dirk Hohndel
This appears to correctly add the tooltip to the event item, but for some reason the tooltip isn't displayed for most events. Still needs more work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-23New profile: create new class for DiveHeartrateItemGravatar Dirk Hohndel
This allows us to give it a different color (red) and make it a smaller size. While implementing this I also fixed the size of the temperature text in the new profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-23New profile: better positioning for the heartrate labelsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-23Calculate minimum and maximum heartrateGravatar Dirk Hohndel
And setup the axis accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-23Don't try to setup event if it is NULLGravatar Dirk Hohndel
This also fixes the whitespace in a function that I instrumented to figure out what's going on. I restored it to its original state, but I couldn't leave the whitespace unfixed... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-23Don't try to set visibility of events before they have been addedGravatar Dirk Hohndel
Admittedly this code doesn't do anything useful right now, but at least have it not to anything useful in the right spot. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-22New profile: add image pixmaps for image eventsGravatar Robert C. Helling
For reasons that I don’t understand, the image is only shown if the event happens to be at the same time as a depth sample. This is, however, not specific to these image events, it seems to apply to all events. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-19Implement the rest of the heartbeat.Gravatar Tomaz Canabrava
The only thing that was missing was the size of the vertical axis. I'm setting a small line on the bottom of the temperature axis, since both have blue color, this will not make people think one is the other. TODO: change the color to red. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-19New profile: partial addition of heartrateGravatar Dirk Hohndel
This was done during an IRC hacking session with Tomaz. It compiles, it shows something but not the right graph. Committed here so Tomaz and I can continue to work on it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-19Only recalculate the tooltip if time has changedGravatar Dirk Hohndel
Small optimization, but seems to make sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-19Convert more TRUE/FALSE to stdbools true/falseGravatar Anton Lundin
In Qt5, Qt doesn't define TRUE/FALSE anymore, so we need to stick to stdbools to have Qt5 builds working. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-17Make part of the context menu work (gas change event)Gravatar Tomaz Canabrava
The code of the context menu and the gas change event callback is mostly the same as the old profile, with minimum modifications, as this changes the order of the code on the callback to make it a bit saner (declare variables first, call code later). This also fixes a bug on the model that was not cleaning itself in the correct way after a call to clear. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-17Missing initializerGravatar Dirk Hohndel
This was causing us to access uninitialized memory at times. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-16New profile: some more slight rearrangementsGravatar Dirk Hohndel
This is just an attempt to not have the time markers and dive computer name printed right on top of each other. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-16Fine tune positioning of temperature and tank pressure linesGravatar Dirk Hohndel
Maybe not yet perfect, but better. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-16New profile: improve mean depth lineGravatar Dirk Hohndel
Show decimal depth and make the line length more appropriate for the dive profile shown. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-16Clean up some warningsGravatar Dirk Hohndel
Unused variables, more initialization order complaints. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Fix z-value of the PartialPressure gas graph over the timeAxisGravatar Tomaz Canabrava
Fiz zvalue of the partialPressure Gas Graph over the TimeAxis, and also corrects the position of the PartialPressure gas graph. It now no longer appears to 'float' over the TimeAxis, now it's on the very top of it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Make it possible to hide some of the grid lines.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Better setup of the defaults for the grid.Gravatar Tomaz Canabrava
This patch creates better defaults for the grid lines, size, position and z-level. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Create the grids.Gravatar Tomaz Canabrava
Create the grids, and the way that they move is fabulous <3 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Change the axis update method to move the lines.Gravatar Tomaz Canabrava
Change the axis update method to move the lines alongside the texts. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15New template-based-function: remove the uneeded items on a QList.Gravatar Tomaz Canabrava
This function is for non-duplication of code for different QLists, since I now have Texts and Lines, I needed to make the code in a way that it worked without dupplication. It's a pretty standard use of templates, I think that even the C guys will not be offended by it. :) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Remove the class 'CartesianPlane'Gravatar Tomaz Canabrava
This class was pratically a re-do of the axis, I'll do the axis to plot the lines when it feels like it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Move the events when a partial pressure graph is enabled / disabledGravatar Tomaz Canabrava
The events were static on the canvas even if the profile changed its size because of a toggle of the partial pressure gas. This patch makes events move on the canvas to their correct place. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15If the depth is zero, dont show it.Gravatar Tomaz Canabrava
The first depth label of its axis is always zero, do not show it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Fix crash opening testdive0.xmlGravatar Tomaz Canabrava
That particular dive didn't have a temperature, and thus we got a crash while accessing the last temperature text. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Removed unused setup functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15Make font label scale a per axis propertyGravatar Dirk Hohndel
This way the partial pressure graph can have smaller pressure labels than all the other labels on the profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-15New Profile: make axis labels smallerGravatar Dirk Hohndel
Previously all text in the new profile was deawn in the same font. With this change the labels on all axes are smaller. It might be even better to allow per-axis configuration of the label size as along the time axis the bigger size looked better. But especially for partial pressures this looks much better. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-14Align Right side of Cylinder Pressure Text to the Left.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-14Left-Align the last Temperature Text.Gravatar Tomaz Canabrava
The last temperature text used to have the same align flags as all the other texts: Right. this makes it much more appealing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-14Show the last temperature on the graph.Gravatar Tomaz Canabrava
The code shamelessy copied from the old profile introduced a bug where the old temperature was not correctly shown. I'v added a new member to the class that will store the last valid temperature, and use that to calculate if there's a reason or not to display it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Replace mainWindow() with MainWindow::instance()Gravatar Boris Barbulovski
C++ style of accessing single instance class object. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Make the mean depth line follow the size of the axis.Gravatar Tomaz Canabrava
When we move, shrink or expand the depth axis, the meandepth should also change it's position. this patch adds that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>