Commit graph

7463 commits

Author SHA1 Message Date
Dirk Hohndel
5c4d266060 Make editing a location work with dive sites
Not sure if this is the final implementation, but at least for simple
cases it works now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
cd28e88bee Improve helper functions
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>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
ccf833b45c Clear the location if we have no dive site
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
f8b63e1bb6 Update completion model for dive site names
This way the drop down works again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
801e584029 Another helper: for_each_dive_site()
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>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
d488c37cc1 Show dive coordinates on map based on dive site
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
9ef81d3ed3 Show GPS coordinates based on dive site on MainTab
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
6a812c6b6d Show location based on dive site on MainTab
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
05948530e9 Save and load dive sites in git format
Update the version to 3.

Continue to read version 2 files and create dive sites on the fly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
4b15b9dfe9 Save and parse dive site structures to XML
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>
2015-02-12 11:19:27 -08:00
Dirk Hohndel
e720c82aa1 Some dive site helper functions
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:05 -08:00
Dirk Hohndel
dcfda29da6 Add dive site data structure
This leaves location and gps coordinates in the struct dive to allow a
step by step migration.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:18:12 -08:00
Thiago Macieira
2843dc38c9 Backport 6796f2337ee31b4b4f07eaa54d868b999c39233a from Qt
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>
2015-02-12 00:20:01 -08:00
Thiago Macieira
8a5f4455ac Detect Windows 7 or higher with a numeric comparison
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 00:19:38 -08:00
Dirk Hohndel
9edb7811ef Remove redundant function
We had two functions doing exactly the same thing. Let's drop the one with
the highly confusing name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
42afb4972a Pass a fake dive site UUID to the callback.
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>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
d769c6016f Copy the name and the coords when entering the EditDiveSite state
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>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
68691c9d6d Accept / Cancel location edit
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>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
7d66dcd12d Enable the location edit widget on mainwindow
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>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
e3d800885f Create a new state for the MainWindow: EditDiveSite
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
3516ff2ab2 Create simple class to hold the location management.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
63e998b4bd More meaningfull names for the ui elements.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
c173fc567d Add the ui file for the location information
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>
2015-02-11 16:34:02 -08:00
Lubomir I. Ivanov
fd1a33d935 mainwindow.cpp: don't use ui.globePane
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:18:25 -08:00
Martin Long
dca78fe6fc UDDF Export: Moved equipmentused to informationbeforedive section as per updated spec
Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:15:28 -08:00
Martin Long
9b6c546244 UDDF Export: Moved tankdata before samples, as expected in xsd definition.
Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:15:19 -08:00
Grace Karanja
60a7404ed4 Add option to undo deleted dives
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>
2015-02-11 08:07:23 -08:00
Grace Karanja
6d996a7874 Add a structure to hold undo commands
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>
2015-02-11 08:05:53 -08:00
Grace Karanja
ef14798d6d Add undo stack
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>
2015-02-11 08:00:39 -08:00
Grace Karanja
013da6b0af Reverse undo buffer
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>
2015-02-11 07:59:46 -08:00
Dirk Hohndel
6374d9cc03 These pO2 samples exist in both the Predator and the Petrel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 15:19:57 -08:00
Dirk Hohndel
6b7b2a7427 These pO2 samples exist in both the Predator and the Petrel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 15:19:01 -08:00
Salvador Cuñat
a2db0df886 Update spanish translation of user manual to english 7b44cf2
- Multi-cylinder dives.
- SCR dives.
- Changes on mean depth line explanation

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 15:11:11 -08:00
Robert C. Helling
73145325ed Be a bit more careful when deleting pO2 values
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>
2015-02-10 15:09:12 -08:00
Guillaume GARDET
e40798770b Documentation: Update french translation
Update french translation of user-manual.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 15:08:39 -08:00
Sergey Starosek
841f1836c0 Update russian translation of user manual (7b44cf2)
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 15:07:25 -08:00
Sergey Starosek
11a21b9eda User manual spelling fixes
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 15:07:13 -08:00
willem ferguson
ebfab5a131 User manual: small updates
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 #827
Fixes #828

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 15:06:36 -08:00
willem ferguson
f0c026a9d9 Update screenshots for user-manual
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>
2015-02-10 15:06:03 -08:00
Dirk Hohndel
d449ac3208 Only update tags in the selected dives if they were changed
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>
2015-02-10 15:04:29 -08:00
Dirk Hohndel
47dd0a1ec5 Prevent a tank from looking undefined by mistake
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>
2015-02-10 15:03:48 -08:00
Miika Turkia
f39962469d Increase the limits for recursion and variables on XSLT parsing
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>
2015-02-10 15:03:28 -08:00
Miika Turkia
01199728fb Select the known import for APD automatically
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>
2015-02-10 15:03:28 -08:00
Miika Turkia
c104ff67e4 Add the .apd file extension to be treated as CSV file
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>
2015-02-10 15:03:28 -08:00
Dirk Hohndel
2dab00f5dc Change the tooltip for bailout
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>
2015-02-10 15:02:53 -08:00
Dirk Hohndel
e0ad44c1b3 Don't show a setpoint switch event at t=0
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>
2015-02-10 15:02:53 -08:00
Dirk Hohndel
cafda9530c Deal with setpoints in samples when switching a dive from CCR to OC
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>
2015-02-10 15:02:53 -08:00
Salvador Cuñat
8b9cf5d092 Update spanish translation of user manual to english 6913ff5
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>
2015-02-10 14:58:49 -08:00
Salvador Cuñat
3d7bbcac7e Fix three broken image links
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 14:58:49 -08:00
Dirk Hohndel
1e6135f2d3 Reenable Russian translation of the manual and update html in git tree
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 14:58:49 -08:00