Sometimes we want to create a dive site just based on a name, sometimes we
have both a name and GPS coordinates. Let's make a helper for either case.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This doesn't make the code necessarily more compact, but easier to read
and is consistent with our other patterns.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Read and write divesite sections in the XML file.
Read divelogs of version 2 and create dive site structures on the fly.
Read version 3 files that have divesiteid instead of location / gps.
Saves version 3 files where dives no longer have location and gps but
instead refer to a divesiteid
The commit contains quite a few fprintf(stderr,...) in order to allow
better monitoring of the parsing / transforming of locations and gps to
dive sites. This will need to be removed later.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The detection of Windows 10 is broken in Qt 4.8.6 and in Qt 5.2 through
5.4.1 (see QTBUG-43413). The commit above fixed it.
I backported only half of the solution, since the other half requires
the private class QSystemLibrary.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is the start of the preparations to edit the dive site,
passing a uuid so we can retrieve it later.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Name and coords of the current dive are copied to the edit dive site
screen.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make it possible to cancel or accept the location edit and
get back to the mainwindow default state.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Clicking on the 'Manage' button now brings you to the widget to manage it.
Nothing has been added on it yet.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Just the xml file for the Ui location information.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add ability to undo deleted dives by storing a list of the
deleted dives in a QUndoCommand.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add the undocommands.cpp / undocommands.h files, which will hold a
collection of classes that will hold undo commands.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add an instance of QUndoStack in the mainwindow, and add undo/redo
actions in the edit menu. The QUndoStack will have a collection
of QUndoCommands to process the undo and redo events.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Reverse all the code using the UndoBuffer class so that we can
use the QUndoStack and QUndoCommand classes. These are Qt's own
inbuild undo framework classes, offering a better undo/redo
process.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds tests if the computer is actually a Predator and
if the value is close to what we would have computed anyway.
[Dirk Hohndel: minor change to use same_string() ]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A section on multicylinder dives has been added.
Just to warm LongJohnSilver's heart, a short section on pSCR has been added.
Please feel free to add to the pSCR section, LongJohn.
Replaced the sidemount figure with obsolete mean depth line.
Fixes#827Fixes#828
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We want to get rid of the dreaded red line.
This gets rid of some of the last Ubuntu screenshots.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If current_dive and displayed_dive still have the same tags then we
shouldn't touch the tags of other selected dives.
Fixes#826
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we have no default cylidner set and get no data about an air tank from
libdivecomputer, our cylinder will look completely empty by mistake.
Always setting some kind of description fixes that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This increases the limits when parsing CSV files with dive profiles,
allowing us to import bigger files in one go.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the filename has extension of .apd, then set the known import
automatically.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
For some dive computers (at least the Shearwater Predator, I haven't
checked if there are others), libdivecomputer used to return setpoint
values in each sample even if the dive computer was in OC mode. Those
setpoint values are redundant and confuse our algorithm that tries to
detect if a dive is OC or CCR. So when manually switching from CCR to
OC we make sure that there are no setpoint values in the samples.
This is a destructive change - if the user switches to OC by mistake and
accepts that change, even when switching back to CCR the setpoint changes
during the dive are lost.
I rewrote the code dealing with the events as it was rather confused.
Looping over the events that way didn't make any sense since
get_next_event() is guaranteed to give you the first (if any) event of the
requested name.
See #826
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Facebook integration.
Damn, my last patch is always late for the release.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>