This is subtle. The modifications to the selection cause a redraw of the
profile. So we need to make sure that we leave the plan state and return
to profile state BEFORE we do this, otherwise we'll call into
createTemporaryPlan() with invalid data.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With this information, when we re-plan a dive we can bring the user right
back to the point where they ended - they have the waypoints in the dive
pointes table and handles are shown on the right points in the profile -
and the rest of the dive is once again calculated by the planning
algorithm.
For now this state is lost when saving the dive file as we don't add this
flag in the sample to our saved files. So if we don't find any samples
marked as manually added we add ALL of the samples as way points on the
diveplan and the user has to manually remove the ones that were
calculated.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In some cases we don't appear to remove all of the old handles from the
scene and end up showing a handle from a previous instance of the planner
in the upper right corner of the profile.
This patch makes sure that we remove any stray handles that might still be
around before entereing plan or add mode.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While planning we might have made changes to the displayed_dive. So we
need to make sure that the profile is redrawn after we cancel a plan (or a
re-plan).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When doing this, all waypoints of the calculated ascent are now waypoints
in the plan - so the user has to remove the ascent part of the dive in
order to really replan the dive. That's a pain, but we don't keep the data
around that would tell us which waypoints are user input and which ones
were calculated.
Fixes#527
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's silly to carefully calculate our ascent for each new waypoint that we
add to the plan. Let's get them all in and THEN calculate an ascent.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply setting the pointer to NULL leaks memory.
And that C++ recursive two function implementation... oh boy.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The old implementation was... let's call it creative.
This tries to actually get things right instead of using magic.
Don't pretend that double values are ints.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use the same logic as we do for newly added dives.
As a side effect this patch appears to fix the issues with getting the
newly planned dive selected.
Fixes#692
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In some circumstances Qt will draw a really thick border around
rectangles. This explicitly makes the border of the tank bar thin.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
<QPrinter> is in QtPrintSupport, so we need to declare we want to use
it.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we can easily decode the start time of the dive that is currently being
parsed (i.e., if the information doesn't happen to straddle a block
boundary) then show that in the dialog's progress bar.
Make the explanatory text before it shorter so there's enough space.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This change changes the way we present the OSTC 3 firmware version to a
correct value, showing the major and minor version number.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
-Change column name to 'Gas' as changed in Subsurface.
-Replace '--' with 'Air' to empty tanks.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Buttons and fields colors must be consistent in different themes.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also change the separator to a colon which is more readable.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't show the table header of cylinders or weights if they are not
available.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't export 'others' trip unless there is really at least one dive to
be inserted into the 'others' group.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This function created a QFile that it didn't need and it returned a
dangling pointer (the std::string object was destroyed at the end of the
function).
The function now returns a pointer that the caller must free. For that
reason, it's easier in copy_image_and_overwrite to just go for the
QFileInfo call.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should correctly set all the values and puts us in edit mode.
Testing so far looks good for both single dive and multiple dives selected
(i.e., you can paste into multiple dives).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The OSTC3 functions we need were introduced in 0.5.0 (more specifically,
in commit 56e2dec7266e71e725604a4a8bff5e61f3d62259).
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Some divecomputers only report at minute granularity, anyway. And when
diving with multiple dive computers they will never agree on the exact
time. And anyway, what's the point of second granularity when it comes to
the start time of a dive?
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since printing EANxx was met with a lot of resistance as it wastes space,
maybe this makes things slightly better at least.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit doesn't do anything, yet. It just puts in place helper
infrastructure that will later allow us to cut and paste parts of the data
of one dive into another dive (or set of dives).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the GPS coordinates for a dive were incorrect for some reason and the
user wanted to clear them in order to then re-download / apply GPS
information from the Subsurface webservice, prior to this patch we would
always match the location name and re-populate the GPS coordinates, making
it impossible to clear a GPS location without also changing the location
name.
This patch fixes this - but if you have multiple dives with the incorrect
name / GPS location pair, the next edit to a dive that had the GPS
coordinates cleared will re-populate the GPS coordinates (at that point
Subsurface can no longer tell that this was intentional).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the cylinder description starts with D%d we test if the size in
description matches the cylinder size. If the cylinder size is double
compared to size in description, we mark the dive as double tank dive to
divelogs.de.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Which actually makes the code much clearer as now the object is at the
correct spot on the canvas and the positions inside are relative to that.
No more magic gradiants starting at "92"
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a checkbox for the divecomputer download dialog that allows you
to tell the download to put the newly downloaded dives into a trip of
their own. That in turn will disable the dive merging with any existing
dives, which means that you will not mix up your newly downloaded dives
with any old dives.
That, in turn, is very convenient of you know that some of the dives were
done by other divers (or from testing that happened during servicing etc),
or the dive dates etc were wrong because the dive computer date had reset
due to battery changes etc.
Once you have all the dives in a private trip of their own, you can then
fix them up (delete dives you don't want to merge etc), and then after all
the data is ok you might want to merge the cleaned-up results with
previous trips etc, and then manually ask subsurface to merge the dives or
whatever.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also restructures the code a bit to make it a little more sane and changes
the colors slightly.
With these changes I think we can claim that this
Fixes#557
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This shows a color-coded bar at the bottom of the graph that corresponds
with the active gas.
Todo:
- text that explicitly states gas on the left edge of the bar
- better vertical positioning of the bar
- ability to turn this on and off
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- Export dive coordinates (if exist) to JSON file.
- Add dive coordinates to list view and detailed dive view.
- Add hyperlink that opens the dive location in a new tab viewed in
Google maps.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Sorting by the number must be based on either subsurface number or the
regular indexing as choosed in settings.json
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When exporting selected dives, traverse the trips and export the trip if
it contains at least one selected dive then search for all selected
dives in this trip.
Exporting selected dives only must contain trip infromation.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The navigation arrows from the detailed dive view is based on the full
dive list, regardless of 'items_to_show' list.
This can introduce unexpected behaviour if some search results or
explicitly sorted list are shown in the list view. Restoring this
list view from the detailed dive view after some arrow navigation.
Arrow navigation must be separte and don't change the 'start_id'
variable.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When looking at the dive list view, clicking on the 'show more details'
retains the view at the current vertical position, meaning that the
graph is somewhere above, outside the page view.
Page must be scrolled to the top before viewing the detailed dive view.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>