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>
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>
Right now the search button isn't connected for any device (clearly an
oversight). At least for the Uemis I think I have a sane implementation of
what that should do.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Some digital cameras do not set the DateTime exif field bat use
DateTimeOriginal. If the first option is not found, use the second one
to try to detect the moment when the image was shot.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I get compile errors from these lines. Removing the class name from the
calls allow me to compile the current master.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
If the user never clicks on the log and dump checkboxes (and that's what
we expect to be the case by default), then the log / dump flags (and
filenames) were never initialized.
I am reasonably certain this will close the following three bugs, that all
show the same symptom: they behave as if libdivecomputer dump was set,
even if it wasn't.
Fixes: #426Fixes: #431Fixes: #435
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
Just removed the unused tanks from the toolbar,
since it's just a removal of something on the ui
related code, it's good to see how much verbose
the xml to generate the UI is.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
First attempt to use the tools on one of our source files.
So far so good. Not perfect, but a HUGE improvement.
Most importantly it effortlessly fixed the Allman style braces introduced
in commit 51220f26ef ("Add recent files to main menu.").
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add(up to four) recent files to File main menu.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
C++ style of accessing single instance class object.
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
The extra axis labels on the Temperature and Cylinder Pressure
graphs are not wanted in release mode as they create a lot of visual
clutter, but they are useful to have in debug mode since we can then
better understand what went wrong.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Same as the last commit, but for cylinder pressure. Another bug
was spotted, where the mean depth line does not move to the correct
location after a axis-size-changed - fixing that on next commit.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds shrinking of the Temperature axis when partial
pressures are shown. This adds an unwanted side effect however,
the axis started showing it's values - and we didn't do that on
the gtk version or on the old profile. While this is good for
debugging, it's not wanted for the software if it's on release
mode. I'll fix that in due time.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When the user checked the option to show or hide the partial
presure graph the size of the profile graph was kept the same;
usually I do those changes on the objects themselves, on the
settingsChanged method, but since the calculation of the
size of the profile was done on the ProfileView class for
consistency with the other objects, I had to change it there
too.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The coding style for switch isn't the prettiest, but let's at least keep
things consistent.
Also, those ugly break statements never got reached, anyway.
And there was no need to re-declare and re-generate currentString.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't have nested loops with the same loop variable. Really. Even if it is
legal C++.
And don't declare local variables more than once. This will only cause
issues later.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>