Commit graph

4097 commits

Author SHA1 Message Date
Willem Ferguson
c8e4ce9b81 User manual: update
1) Text about libdivecomputer log and dump files
2) Text about coordinate formats acceptable
3) Text about CSV import
4) Minor reorganisation of TOC

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-25 12:46:10 -08:00
Dirk Hohndel
d42cc5a40c Enable libdivecomputer log or dump from the UI
Pick filenames for these functions as they are selected.
Use the windows-safe fopen function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 16:26:00 -08:00
Miika Turkia
4de739b935 Sample dive from XP5
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 10:43:29 -08:00
Jef Driesen
ca1947f3cf Support downloading memory dumps.
Signed-off-by: Jef Driesen <jefdriesen@telenet.be>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 09:57:14 -08:00
Jef Driesen
60d85de292 Enable diagnostic logging from libdivecomputer.
Signed-off-by: Jef Driesen <jefdriesen@telenet.be>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 09:57:10 -08:00
Jef Driesen
badce21b24 Remove an unnecessary function call.
Signed-off-by: Jef Driesen <jefdriesen@telenet.be>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 09:57:04 -08:00
Miika Turkia
dbd14f8662 Include O2 percentage in DivingLog import
Seems there is a different way to state O2 percentage in DivingLog.
This patch includes that format along with the previously seen one.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 08:52:38 -08:00
Miika Turkia
b07af31ea5 Try to detect whether DivingLog's samples are m/f
Seems that we can detect the unit of samples from DivingLog import when
comparing the maximum dive depth to the maximum recorded sample depth.
If sample is bigger, it is recorded in imperial. Of course this relies
on the assumption that the max depth of dive is recorded in metric unit,
but that seems to be the case, at least in the sample received.

It really does not make any sense to have both units in use for one dive
without any info on the unit used. But since that is the case, let's try
to cope with it.

Fixes #316

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 08:20:06 -08:00
Dirk Hohndel
18f0489188 Make decimals optional in GPS coordinates
As an aside, our resolution is great and certainly high enough for the
real world, but it's easy to get into situations where we don't display
the exact same degrees / minutes / seconds as the user entered...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 08:12:12 -08:00
Tomaz Canabrava
09096f9af4 use qMakePair helper instead of QPair<int,int> and such.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:24:12 -08:00
Tomaz Canabrava
1a933e7e19 Don't use QList if sizeof(item) > void*.
QList is optimized for storing pointer-sized items, thus
a QVector is the better choice for everything else.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:24:11 -08:00
Tomaz Canabrava
5e446fd258 removed unused files.
Thise files dates back from the beginning of the Qt port and
were never used anyway...

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:24:11 -08:00
Tomaz Canabrava
8da5a8649b Don't check if pointer is valid before deleting it.
deleting a null pointer is valid, so we just delete it
instead of checking if it exists.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:24:11 -08:00
Tomaz Canabrava
2874070870 Code cleanup. Don't use if ( true ) set (false).
Code cleanup, don't use if ( thing() ) set false,
but set !thing() instead.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:24:11 -08:00
Tomaz Canabrava
231fd2e6e0 Fix subsurface on dark themes.
This patch fixes my last annoyances with dark themes
on subsurface. It changes the background color of the
edited info tab to a darker yellow if the theme is
dark, and a light yellow if the theme is light.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:23:10 -08:00
Tomaz Canabrava
10519bcc50 silly whitespace fix.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:23:10 -08:00
Tomaz Canabrava
6925d13aa4 Rework foreach for a faster iteration.
The old code used a QString instead of a const QString&, wich
mean that each foreach step the string was copied.
added a break on the if-found-true to stop the foreach, since
we already found it.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:23:10 -08:00
Miika Turkia
03a01efdcb We need to use include statement on XSLT nowadays
After change to include XSLT files in resources, the import quit
working (even though the files and templates were found properly). This
patch uses include statement instead as it seems to work in our case.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:16:30 -08:00
Willem Ferguson
d72be58395 Replace figure of main screen with one that shows the main menu. Previous fig did not show manin manu.
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:07:45 -08:00
Miika Turkia
e0bdf45539 Allow selecting all files on CSV import
This allows user to view any file on CSV import dialog, not only the
ones ending with .csv. Of course, the default still shows only the .csv
files and user needs to change the filter to view the rest.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 07:06:29 -08:00
Dirk Hohndel
a2bf4e76e4 Accept decimal point and comma in gps coordinates
The previous implementation only accepted a decimal point. We now support
both point and comma, regardless of locale.

This also removes a debug message left behind in the previous patch.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-23 15:18:53 -08:00
Dirk Hohndel
9405895285 Improve GPS string handling
This adds support for two more GPS coordinate formats and also fixes a
couple of issues with the previous implementation.

We used to only support full degrees and decimal minutes. We now also
support fully decimal and degrees, minutes and decimal seconds.

The previous implementation would color the input field red if either it
couldn't parse the string, or if it was able to parse it but it was the
same as the previous location. That's misleading.

The previous implementation also changed all gps coordinates to the new
coordinates in a multi-dive edit - instead of just changing the ones that
are the same as the master dive.

Fixes #387

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-23 14:59:38 -08:00
Willem Ferguson
ebffd75a79 User manual: updates
Correct error in manual
Add some short text in sections dealing with equipment.

[Dirk Hohndel: clean up whitespace & regenerate the html file]

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-23 09:40:11 -08:00
Cristian Ionescu-Idbohrn
5b8586405f Correct small typo.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-23 09:33:07 -08:00
Cristian Ionescu-Idbohrn
73a8996609 Make XML and PDF version of user manual build again
Removing the offending tags in Documentation/user-manual.txt makes it
build.

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-21 08:29:43 -08:00
Dirk Hohndel
17dfee415a Include the user-manual.html file in the git tree
This way when building Subsurface asciidoc is not necessary at all - except if
you want to work on the user manual and want to see the result of your work.

Previously the build wouldn't fail without asciidoc, but there would be no
working user manual when pressing F1 from within the application. This solves
the problem by shipping the HTML file with the sources.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 16:39:56 -08:00
Dirk Hohndel
5c3ed901b5 Remove pointless code
Why calculate the number of entries in the zip downloaded from Divelogs.De
if you don't do anything with that number?

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:06 -08:00
Dirk Hohndel
0421a161b4 Silence a few warnings
None of these are actual bugs. But none of the fixes are harmful, either.
And much as I hate adding the 'default' clauses, I'd rather not have the
build output cluttered by invalid warnings.

The exception is the fix in divelistview.cpp - while I don't think it is
possible for this function to be called with no dive selected,
initializing pd to NULL is cheap insurance in case that does happen for
some weird reason.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:06 -08:00
Dirk Hohndel
4ab58d6b47 Use M_OR_FT macro instead of switch statement
This is easier to read and also avoids an incorrect gcc warning.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:06 -08:00
Tomaz Canabrava
f0da41c937 Added Keyboard Navigation for the Star Widget
Keys up and down to increase / decrease stars
and also fixed focus policy for it.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Thiago Macieira
3e3fff262e Don't use an array where none are necessary
We don't need to keep the array of zip_source structs. We just need the
latest we created so we can add to the zip file.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Thiago Macieira
64f24234ab Move the variable initialisations closer to use and add blanks
Makes the code easier to read, IMHO.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Thiago Macieira
de47937dd1 Get more descriptive error messages when uploading to divelogs.de
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Thiago Macieira
d36e4555da Move the divelogs.de preparation function into the C++ class
This is so we can mark the error messages for translation.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Thiago Macieira
b654bcdd7a Generate the file name for the dive log upload in the caller
This is a cleaner approach, according to the discussion in the mailing
list. It is also better because we can use QTemporaryDir in Qt 5.
Finally, it avoids having to remember to free it at every point.s

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Thiago Macieira
8eb6dfdb02 Use QFile::{encode,decode}Name for file names
And make them use UTF-8 on Windows instead of the local 8 bit encoding.
This will also get us the proper NFD encoding on OS X.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Thiago Macieira
dbdf50d03c Fix compilation with libzip < 0.10
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Anton Lundin
c49f7133c3 Add preprocessor directives around debug functions
These adds some ifdef's around some debug functions to disable them when
not using them.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Anton Lundin
a84826090a Planner: don't abort when saving a dive
The fix for dereferencing a null pointer from me was a bad fix that
broke the possibility of saving a planned dive as a dive.

This is a better fix to not dereference a null pointer and be able to
save the plan again.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Tomaz Canabrava
029522880f When saving / canceling edition, focus back to the Dive List
When saving / canceling the edition, focus was still being kept on the
current selected widget. not good. :) this patch makes the DiveList
keep the focus after a edit.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Tomaz Canabrava
29a19e2e84 Fix the cursor problem on the TagWidget
The problem was the Focus Prevention system on the
EventFilter. Instead of that we can pass the setFocusPolicy (
strongFocus ) that ignores the mousewheel. simpler and cleaner.

Fixes #376

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:05 -08:00
Tomaz Canabrava
890d60ff9e Simplify the code by removing a few options from the if.
There was some options on the 'if' that didn't
really belonged there, so I create a if before those
to quit earlier if the condition is true.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:04 -08:00
Tomaz Canabrava
bffceb18e7 Do not New / Delete the item, use the Stack.
This should be somewhat faster, and the code is cleaner.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:04 -08:00
Tomaz Canabrava
2ead1ebe08 Removed obsolete code.
The QPainter::hightQualityAntiAliasing is ignored by Qt,
the docs says we should use QPainter::AntiAliasing.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:04 -08:00
Tomaz Canabrava
bdd1b3b546 Make it possible to use the Tag System in dark themes
The color used on the bright theme was cyan, and it's too bright when the
font is also white.

This patch uses the HSL information of the color to determine if the text
color is light or dark, and adjusting the background color for that.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:04 -08:00
Tomaz Canabrava
9e57dd4826 Code cleanup: QPair<int, int> -> qMakePair
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20 09:53:04 -08:00
Dirk Hohndel
a0b9daf63b Improve signing script, adjust flags for gcc-4.2
On one of my machines codesign doesn't find my signing key by hash, but
does find it by name. Go figure.
Also on that same system (32bit Mac Mini with running Snow Leopard / 10.6)
gcc 4.2 doesn't support the -unused-result warning. So let's only turn
that on for more modern versions of gcc

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-19 20:42:59 -08:00
Lubomir I. Ivanov
a351bbde24 Files: use the new opendir() wrapper
This is a separate patch because it required more changes
and branches due to how opendir() works on win32
with the separate struct type _WDIR and the according _w...
methods for it.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-19 07:28:27 -08:00
Lubomir I. Ivanov
86ed014339 Fix an unused variable warning
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-19 07:28:26 -08:00
Lubomir I. Ivanov
1bb7ab30c6 Files: prefer toUtf8() over toLocal8Bit()
We may want to use toUtf8() for win32 considerations.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-19 07:28:25 -08:00