Adding support for importing .apd files (APD Log Viewer). They are CSV
files and already supported in CSV import, but the file extension .apd
is added here.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While this text makes sense if this is a CCR dive and the diver does bail
out, the more neutral text "Manual switch to OC" works in all use cases
for this event, e.g. at the beginning of a dive when we manually set this
dive to be OC.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When using that to indicate the dive type at the start of the dive, it's
visually strange to have an event marker.
See #826
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Allow users to delete dives using the delete key.
[Dirk Hohndel: small whitespace fix; removed an unnecessary
include file]
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch cleans up code for achieving the above with respect to
CCR dives. The code is simplified and shortened. The display of
gas lables on the profile is made consistent with the cylinder
pressure closest to the graph and the gas composition above/below
the cylinder pressure. The patch significantly improves the
maintainability of this code.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The user may have a different theme, as i did, and it
looked very wrong.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This sets the combobox to disabled if the profile is in
any mode besides PROFILE.
Fixes#824
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We can end up having a divepoint that is outside the dive profile. In
this case, we used to crash, but this hack prevents the index out of
range issue.
Fixes#784
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I have no idea how the index ends up outside the range, but at least
this prevents a crash in this case.
See #784
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of inventing another way to do this (and inevitably forgetting a
path where this should be re-enabled) I renamed the DcShortcup related
function and made them enable/disable the copy and paste shortcuts as
well.
Of course there now is one exception (isn't there always?): in "ADD" state
we don't want to be able to switch DCs, but we do want to be able to
paste.
Fixes#825
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On Ubuntu, the completer often prevents applying/discarding the changes
on the dive info pane and disrupts editing of other fields as well. This
patch prevents the completer popup from appearing when not in edit mode
(apply or discard is pressed) or when the string is still empty.
Fixes#818
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Why someone would log in but then not allow us to post I don't know... but
it seems useful to at least handle it...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Without this patch, the user effectively cannot change the dive mode as
any change is overwritten by replot copying current_dive over
displayed_dive. The way out is not to call replot but only update the deco
ceiling directly.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit b72c32da7 turned off replotting while the cylinder
combo box was active to speed up editing. After leaving
the combo box, replotting was enabled again and a replot
was called.
This replot is too agressive, as it overwrites the displayed
dive with the current dive and thereby resets the cyinder
change. This eliminates the replot call.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
They stay valid while Subsurface is running, but once you quit, the
credentials are gone.
This way no one can steal them from our settings.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The XSLT based exports can consume long time while applying the xml format.
This time can make the GUI unresponsive. Simply call the export functions
in a new Thread.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit d329420d55 changed the name of the
header from "Max depth" to "Max. depth", so we need to use that in the
code as well. (The dive profile is not drawn if we do not have max
depth.)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
probably just a typo; taking the value of a (char *) will return
the first char (or byte).
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We should mention the iPhone companion app either alongside the Android
app or at its own line if more precise information is wanted. I suppose
this text change should be enough as we should get more precise
statistics of usage of these apps from the server logs.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show either the login screen or the disconnect button, plus some text that
explains what the user is expected to do.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The maintab view should be consistent; some fields just go to edit mode
whenever they acquire focus and most of them wait till their values are
changed.
Change the dive notes field to be consistent with the other fields and
only enter edit mode if its value is changed.
[Dirk Hohndel: changed to use same_string()]
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We always call reply->deleteLater(), so we where actually calling delete
on a stale pointer, that caused subsurface to crash on shutdown.
Reported-by: Sergey Starosek <sergey-starosek@yandex.ru>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There are reports that the replace calls can cause the application to
crash. This doesn't seem to make sense, looking at the code - this change
shouldn't make any difference. But it makes it even more clear that there
shouldn't be any possible scenario in which we call replace with an index
that's out of range.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When the help dialog appears, remove the shortcuts for filter and close from
the main window so that the identical keys for the help window work. This is
not necessary on other platforms, but on Mac it appears to be required.
[Dirk Hohndel: Tomaz had a slightly different approach of removing the actions,
instead I changed this to just modify the shortcuts]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We changed this MeanDepthLine to the MeanDepthCurve (or something),
no need to keep old code around.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This ruler shouldn't appear in ADD or PLAN mode, it's a bug
and may crash things.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This hides the whole QWidget with the share-to-fb button in it. This
lets the Notes field expand to the full width.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As the heading above says.
1) Place user manual option in main menu at the bottom of the Help submenu.
It is more easily seen in that position.
2) Replace two images. I forgot one of the images that had been changed to F20 format.
3) A few small changes, including in the systematic description of the main menu.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit e219bc70f8 ("Refactor dctype -> divemode") introduced a few issues.
For one thing it causes a warning about incorrect use of zorder - I don't see
why this would be needed here, so I simply removed it.
Secondly, it adds a new, automatically named layout element that therefore gets
handled by our "consistent margin" code which creates a messy layout for the
Dive Notes tab. This patch gives that horizontal layout a useful name and adds
it to the list of "zero margin" layouts. Signed-off-by: Dirk Hohndel
<dirk@hohndel.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
the manual uses "Sensor 1:", not sure if it breaks anything.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Last index was not included in the selecting or unselecting the
downloaded dives.
Fixes#819
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The reset call hides the progress bar text, and that way it hides our
error messages we try to show with the progress bar.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Mean depth/s sounds too much like a rate of change but this
referers to instantaneus mean depth at a time.
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With this we can easily eliminate duplicates from our user statistics. The
UUID is completely random and there is no way to link it back to a
specific user. By deleting the settings a user can force a new UUID.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In a previous patch, 37830bdb ("Always show deco gas as dive gas") the
semantic of the last variable was changed. This updates other calls to
this function.
This is nothing but documenting changes.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If update checking is allowed we want to do so but we want to be careful,
which messages we show - specifically we don't want to show "your version
is newer" unless it's a manual check.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The unit was stored to the variable after it was used, thus we need to
delay the print of the unit slightly. (In practice the depth unit for
first picture was null before this fix.)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
some common nouns, even if the S in OS is capitalized but
that's when it's in acronym form.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This improves the column name matching so our own columns are properly
supported.
See #814
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As changing the export to use tabs, we need to switch the import to do
that as well. However, we also need to support comma separation as older
exports use that.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It seems that at least in this occasion, the signal blocking requires
the UI element to be given.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The import dialog now displays only a maximum of 10 lines of the CSV
file to be imported.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This assumes that we have either dive details or dive profile, not
combined log files. Before the change in the import UI, user selected
the import type by the tab on import dialog, now we make an educated
guess based on whether sample time field is available.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we have the separator as tab, we need to use the proper tab
character instead of the string for known imports.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch takes the cylinder pressures of CCR dives and prints them
in a non-overlapping way.
Remaining issue: When the dive profile is made taller by dragging the
window or the appropriate slider far down the screen, the labels move
further apart; similarly, when the profle is made flat/shallow by dragging
the window edge or appropriate slider up, the labels get close to each
other and start to overlap.
There are quite a few lines of additional code going into the patch. This
is primarily because separate provisions for when po2 > p(diluent) or vice
versa. In addition, I could not determine the size of the text characters
which would allow much more precise placement of text. This is because the
.scale member of the text is private and not available in the methods
involved in printing the labels. However, the height of the vertical scale
of the cylinder pressure graph can be determined [e.g. vAxis->maximum()].
This helped a lot to get the positioning of the text more or less correct.
While the results of the patch is not perfect, It contributes
significantly to make the profiles of Poseidon dives more readable.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the header line is not set up properly, the known imports assignments
will index out of the array.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When calculating maxima for a dive, we need to take data from all existing
dive computer structures plus potentially also a fake dive computer
structure that is just passed in in order to create a meaningful profile.
Commit 86c961614b ("Actually walk all dive computers, don't just claim
to do so") missed that second case and no longer took the fake_dc into
account, breaking the display of dives that don't have samples.
Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There were situations when the last text was still shown. E.g. when the
current file was closed and then a new dive was imported from CSV.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch does some cleaning up of the code that provides visualisation
of CCR o2 sensor and o2 setpoint data. It reduces the number of
conditional evalauations that are required and it improves the readability
of these parts of the code.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As the string was changed in our CSVApps array, we must change it here
as well.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We use the human readable name here as XML tag name so it cannot contain
spaces. Note that currently some of the names can have spaces in them as
they are special cases and not used as XML tag name.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Unfortunately we are referencing these separators with index, so they
need to be on same order as used in XSLT files.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These files contain a bit of extra data before the actual CSV part, so
we need to skip there to show sensible information to users.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This switches from a couple of labels in the dialog to a progress bar,
to later being able to use it to provide better user experience.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch creates the possibility of viewing the individual sensor
values when the po2 button on the profile toolbar is activated. This
follows exactly the procedure for optionally displaying the setpoint
values while viewing po2. A checkbox in the preferences panel determines
whether sensor information is shown. By default it is set to OFF. When
checked, and the po2 button is activated, sensor1 values are shown in
grey, sensor2 in blue and sensor3 in brown.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the first dive computer had pressure samples, but the second one (and
no higher one) did, then we would draw a flat horizontal line for the tank
pressure graph (but lable it with the correct pressures). This routine
that is hunting for the actual maxima and minima does have to really go
through all dive computers, not just "this one and up".
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This ONLY hides the old flag if the current dive is the only dive on that
location (which seems to make sense).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we don't modify the dive list, the new flag wouldn't show up until
we accepted the change - that's not user friendly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead be consistent with other parts of the code and put us in editing
mode so the user can accept / reject the change.
See #800Fixes#801
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Whoa, this deserves a good explanation.
Everytime that the mouse moved in add / plan mode, or anytime a new dive
was displayed on the profile, this method would be called and connect the
dataModel to the modelChanged method. This added the slot in a call-vector
that the fired signal would call, adding one call to the Slot per add /
plan mouse move (about 20x/s) or each time a new dive was displayed.
Quickly filling the vector with more than 200 - 300 calls to this same
Slot.
The fix is to only connect one time. this made the add / plan mode *so*
much smoother... :)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We were updating the dive quite a lot of times, we really didn't need to.
This will help, but not fix, the issues with plan / add dive.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
qt-ui/profile/profilewidget2.cpp:1351:10: error: invalid use of incomplete type ‘class QDebug’
qt-ui/printlayout.cpp:141:27: error: variable ‘QPointer<ProfileWidget2> profile’ has initializer but incomplete type
In commit f9ceff009b ("Clean up the header files") things got broken for
an as of now unreliesed future version of Qt.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move the heart rate graph down to the same space as the tissue saturation
graph so that it does not overlap with temperature or partial pressures.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Lots and lots and lots of header files were being included without being
needed. This attempts to clean some of that crud up.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This cache give us a huge gain in performance, going from
17% moving the mouse frenetically to 9%, wich is quite acceptable.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We used to create a new QGraphicsRectItem everytime a Pixmap
changed. Since I'm pretty sure I deleted every bit of the
PictureItem before setting a new one, no leak was due, but this
version is safer.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We were calling this even if we didn't really change anything
and paths are expensive to paint.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We were recreating the PathItems (one for the outline, other for the real
text) for every call to setText. This was a very un-smart move.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Do the switching based on the index rather than the string (which is
translatable!).
Update set-points when turning on/off CCR mode (remeber: the rebreather
mode is stored in two places: the divemode and implicitly in the setpoitns.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update O2 metabolsim rate and adopt default gas switch depths to
pSCR oxygen drop.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This reduces a lot of CPU time and makes the overall use of the tooltip a
breeze.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The tooltip animation had a fixed animation speed, this patch
honors the anim_speed on the preferences, and also disables
the animation completely if the speed == 0.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There are a few calculations that go on boundingRect that can be avoided
if we simply store the result.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correct pen and brush set. the ToolTip now is correctly rounded,
translucent and happy.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The rectangle is now correct, but the collors are still
wrong. I'm tracking that down - most probably I've set
the wrong pen or brush ( or both ) somewhere.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Those items were used to fake the background of the path item
but since the rectangle can be painted with a border and a
fill, this is uneeded.
The rect is still ugly.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
a rectangle is *much* faster to paint than a simple ShapeItem,
so this is a safer choice. We still need to create the paint
method so we can use the correct roundness for the rectangle.
Currently it's white with a 1px solid line - terrible. :)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We were deleting / recreating the graphics background item for *every*
mouse movement. Now we are just creating the painter path; no more
allocations / desalocations, adding, removing from the scene. This should
make things a tiny bit faster.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While analizing the code for the mouse movement I've discovered that
we did a lot of uneeded things: Set the color, the pen, the size
of a fixed-colored line, twice.
We also deleted-newed the same Pixmap / Text for every mouse movement
so now we reuse the 'entryToolTip' that consists of a huge line and
a pixmap, and after that we add the other tooltips that are not static
Also, reduced a lot the number of calls to expand() (that did a lot of
math).
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Strangelly, this method was being called even if the rectangle was the
same, so we deleted everything and recreated everything again. tsc tsc.
Some more improvement is needed but we are getting there.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Very often the rectangle of the ToolTip doesn't need to change but we were
calling and firing an animation for it for *every* mouse movement, even
when we didn't really needed it.
Now it will only fire something if the rectangles are indeed different.
From my tests we reduced the number of calls to the animatior by about 20%
using a real divelog as test.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is an attempt to make fewer calls to alloc functions when the mouse
is moving.
We were creating a membuffer, filling it (malloc / realloc), then freeing
it just after use. but we could simply hold that allocated area and reuse
it again.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We did three cals to mapToScene / mapFromScene on the mouse moveEvent at
the ProfileWidget2 where we only needed to call one in the common case and
two in the worst case.
This doesn't really help in terms of speed (unless you have a really old
cpu) but since it's code that gets called *very* often, it seemed a
reasonable thing to do.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The QPainter and the QPixmap were being created but never freed. A QPixmap
and a QPainter don't need to be created by new, they can be safely created
on the stack.
So, create them on the stack, pass them via const-reference
and use them correctly.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After looking with great care at the result of the mouse movement
on the profile, and also playing a bit with callgrind I've found
out that one thing that we were doing wrong was the way we looked at the
items in the scene, by calling scene()->items with
Qt::ItemIntersectsShape, our shapes are very complex curves
with thousends of points and we have lots of them. and it usually
doesn't matter because *most* of the time we are getting the
tooltip information from 'get_plot_details_new', so no accessing
to items was necessary.
By changing the access from Qt::ItemIntersectsShape to
Qt::IntersectsItemBoundingRect we had a speedup of almost 500x in a
section of code that's very important, and the good thing, nothing bad
happened because one of the only things that we are using this code is to
get information from the events, not the curves.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Take instantMeanDepthLine out of the code. We have the moving average line
plus the exact data in the information overlay.
Signed-off-by: Cristine Guadelupe <cristineguadelupe@me.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Ignore QWebView instances in the preferences dialog when compiling under
Android, as QWebView is not yet supported under Android.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I could have sworn we did this at some point. The vendors are already
sorted, but the products for each vendor should be sorted, too.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After a partial download (because the user hits cancel or because there
was an error, if the user hits Retry the list of dives downloaded so far
should be cleared because we will simply try to re-download the same dives
again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This will crash if for some reason current_dive is invalid.
And in general, when displaying information, we want to use the correct dc
in the displayed_dive, not the current_dc, which references the
current_dive...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When changing to a CCR dive, add a setpoint change to the default setpoint
at the beginning of the dive. Otherwise add an explicit setpoint change to 0
.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is bigger and more invasive then I wanted, but it's hard to break it
down into smaller pieces. Here's what it does:
The former "Download" button becomes the "Download", "Cancel download" and
"Retry" button. So this button controls your interaction with the dive
computer.
The other two buttons are now purely "OK" and "Cancel" for the dialog.
"Cancel" discards what happened (much easier now that we download into a
different table), and "OK" adds the dives that were selected in our
selection UI (by default all downloaded dives) to the real dive_table.
And while redoing all this, I also redid some of the state machine
underlying the dialog. The biggest change that the user will see is that
partial downloads (after canceling or after an error) will still offer the
dives that were completely downloaded up to that point in the selection
menu.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We pass a different table to libdivecomputer (and the uemis code) and have
that table filled. And then we simply copy the dives from that table into
the real dive_table when the user accepts the download.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This will allow us to download the dives from the dive computer into a
separate table just for that purpose and not into the main dive_table.
I really dislike the code that's in place that dates back to the very
earliest code written for Subsurface. Dumping the dives straight into the
main dive_table seems really stupid to me.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we now track all clicks on the row, having the setData() actually
neutralized the action that we took on the clicked() signal.
Now you can select / deselect a dive, regardless where in the row you
click.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Yet another bug because the indices are inclusive. We need to start off
with the last being smaller than first and we need to adjust the row
count. It might be easier to just fix thing to make last be exclusive...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>