Commit graph

7482 commits

Author SHA1 Message Date
Marcos CARDINOT
d500f56d6f TableView - improving the column width calculation
Even that most (or all) tables have the remove button at the section 0, the method defaultColumnWidth should not assume that it will always be true.

This patch will consider the title width of each section, instead of using a static width (which cause problems when the language is not en).

Signed-off-by: Marcos Cardinot <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-19 15:33:16 -07:00
Marcos CARDINOT
b31e192da1 uemis-downloader - arguments in wrong order
method's signature: void uemis_set_divelocation(int divespot, char *text, double longitude, double latitude)

Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-19 13:48:21 -07:00
Marcos CARDINOT
ff860b3c04 uemis-downloader - resource leaks
Some resources are not being freed.

Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-19 13:46:37 -07:00
Salvador Cuñat
4571aa7ac6 Avoid duplicities on dive sites while importing
Instead of create an uuid for every imported dive, check if it exists. If not
create a new one.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-19 11:20:06 -07:00
Salvador Cuñat
f1ab6dd386 Add support for divemode if dive is SCR
Not necesary for OC as this is the default.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-19 11:19:40 -07:00
Torstein Husebø
6a5279b952 Fix a couple of typos
Signed-off-by: Torstein Husebø <torstein@huseboe.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-19 11:17:39 -07:00
Claudiu Olteanu
d3d3cd9e35 Update the documentation with dependencies for cross-building on Linux to Windows
Update the documentation with dependencies for cross-building on Linux
to Windows for OpenSuse platform and correct some building instructions.
Moreover fix the windows building script to use the architectural specific
binary.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-17 13:59:59 -07:00
Grace Karanja
8fe738bf64 Consistent variable names in UndoCommands class
Implements a uniform variable naming scheme in the undocommands
class.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-17 09:53:47 -07:00
Lubomir I. Ivanov
d2b8fb31eb simplewidgets.cpp: fix a -Wreorder warning
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-17 09:28:47 -07:00
Robert C. Helling
002cfa0663 Create picture cache directory if needed
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-17 09:23:55 -07:00
Robert C. Helling
e0490f3055 Use QUrl::fromUserInput for image files
... as suggested by Thiago.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16 12:42:37 -07:00
Robert C. Helling
6b3b50cc2f Load remote images
When loading an image by filename and by hash fails, try to interpret
the filename as URL and download the image.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16 12:42:36 -07:00
Robert C. Helling
869ddc915d Correct signature of helper function
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16 12:42:36 -07:00
Robert C. Helling
e5e2be92bc When loading an image with geodata create a divesite when the dive has none.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16 12:42:29 -07:00
Jan Darowski
d45c2da81d Fixed dive_set_geodata_from_picture segfault.
Segfault did appear when picture had some gps coordinates but
there was no dive site assigned to the dive.

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16 12:19:23 -07:00
Dirk Hohndel
f724b7ebf9 Don't overwrite the displayed dive in the middle of editing
Coming back from a dive site edit we must not call refreshDisplay() or
otherwise the edits on the displayed_dive are overwritten.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16 10:53:50 -07:00
Dirk Hohndel
35d6cf8000 Make sure the dive site edit widget is current when switching to it
Otherwise it will show outdated information. If the user edits the
location name and then clicks 'manage' we need to make sure that the
correct site is shown.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16 10:52:45 -07:00
Dirk Hohndel
84aab5ffed Correctly create a dive site with the name entered on the Notes tab
The char pointer was out of scope by the time we created the dive site.
Also remove the misleading comment above - it really makes sense to do
nothing in that function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16 10:51:41 -07:00
Jan Darowski
0d77b921eb Added warning when not all images can be added.
Added label in the ShiftImageTimesDialog which appears when
not all of the selected images have timestamp in the checked range.

Made cancel button in this widget actually work.

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-15 15:47:37 -07:00
Jan Darowski
7d37a3f5a6 Refactored image timestamp checking.
Seperated getting image timestamp from picture_load_exif_data() and
ShiftImageTimesDialog::syncCameraClicked() into picture_get_timestamp()
and seperated checking timestamp from dive_create_picture() to
dive_check_picture_time().

Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-15 15:47:23 -07:00
Miika Turkia
838b450066 CSV import: average depth name fix
Field name changes should change all the occurrences... We ended up with
field index of -1 for average depth due to mixing field names.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-15 15:43:47 -07:00
Claudiu Olteanu
b3da88478f Change the zoom level on globe if no coordinates are set
As flo269 suggested in bug #507, a full view of Earth would be better
when a dive has no coordinates.

Fixes #507

Reported-by: flo269
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-15 07:32:29 -07:00
Gehad Elrobey
ec202890b7 Make exporting photos with HTML optional
This adds the ability to choose either to export photos or not.
Patch is attached.

--
regards,
Gehad

From 6476e1227b72d8297f9aecc2e6cc6f70d07f87ae Mon Sep 17 00:00:00 2001
From: Gehad elrobey <gehadelrobey@gmail.com>
Date: Fri, 13 Mar 2015 15:31:24 +0200
Subject: [PATCH] Make exporting photos with HTML optional

Add the option to enable/disable exporting photos with the HTML.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 18:18:08 -07:00
Lubomir I. Ivanov
7e7cddde8a Profile: fix a couple of warnings
profilewidget2.cpp:1398:25: warning: the omitted middle operand in
?: will always be 'true', suggest explicit middle operand [-Wparentheses]

profilewidget2.cpp:1403:39: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 18:17:43 -07:00
Lubomir I. Ivanov
57374fb9f0 Profile: call clearHandlers() in setAddState()
Points (handles) from the last dive ADD operation remain on
the profile unless we clear them.

fixes #846

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 18:17:30 -07:00
Lubomir I. Ivanov
da2d5b5ee1 Profile: fix potential mem leak in pointsInserted()
The point graphics are allocated but doens't seem to be
deleted anywhere. We attempt to fix that in clearHandlers().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 18:17:26 -07:00
Lubomir I. Ivanov
3617928621 Revert 4f9705f3f5
It solves #784, but introduces #846.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 18:17:22 -07:00
Dirk Hohndel
b47d8d5992 Some simple test for file parsing
With no V2 question shown
- parsing fails when a V2 file is loaded
- parsing succeeds when a V3 file is loaded
- import of CSV file succeeds

With V2 question shown
- parsing succeeds when a V2 file is loaded

Finally compare the output of reading in the various files with reference
output included in the sources.

My guess is that this test might be a bit fragile, but hey, it's a start.

(reminder: the tests only get built when using cmake)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 18:15:08 -07:00
Dirk Hohndel
f4f791ffbd Add verbose debug output to parse_manual_file
This way it's easier to figure out which arguments to use when creating
tests.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 18:08:26 -07:00
Dirk Hohndel
bf9460e55e Add Subsurface resources to tests
This way we can use the resources from within the tests, for example to
load XSLT files.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 18:08:26 -07:00
Dirk Hohndel
c28acce938 Provide useful warning when we can't find an XSLT file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 18:08:26 -07:00
Dirk Hohndel
9b2c1df8e6 Temporary fix to allow importing of CSV files
In commit 0ed4356fc2 ("Display slowness warning before opening a V2
file") I changed the xml parser to abort if it detects an V2 XML file so
that the main application can show a warning message (and eventually, a
few choices for the user) before parsing and processing older XML files.

The input that gets pre-processed by XSLT files claims to be V2 XML and so
the parser aborts - yet the code to show a warning and restarting the
parse isn't present in this code path, so XSLT based imports always fail.

This hack works around this by temprarily setting the variable that claims
that the warning has been shown to the user.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14 16:24:24 -07:00
Dirk Hohndel
e9e9996766 Better testing if the first gas is explicit
Given that we might be adding a gas change event at t = 0 we need to check
for both that and t = time_or_first_sample.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 12:31:00 -07:00
Dirk Hohndel
0739da38c5 Don't allow two gas changes at the same time
t = 0 isn't really special here. We shouldn't allow two gas changes at the
same time, period.

We also can do away with the special handling to mark the dive list
changed and replot things if a gas change gets removed. That's done at the
end of this function either way.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:44:25 -07:00
Dirk Hohndel
e121b4b548 Make sure no gas changes with negative time can be added
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:43:17 -07:00
Dirk Hohndel
74638c5f65 Simplify the code that replaces a gas change event at t=0
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:42:57 -07:00
Dirk Hohndel
ddff93f096 Event name should be a const char *
This avoids a possible warning when calling this function with a string
literal as second argument.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:15:03 -07:00
Yousef Hamza
22eb8e0617 Removing gas change events @0:00 when new one is added
Remove the existing gas change events @0:00 when new
one is added @0:00.

Signed-off-by: Yousef Hamza <jo.adam.93@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:06:13 -07:00
Gehad elrobey
e70dbb568d HTML: don't show dive photos if photos are missing
some photos can be missing due to permission issues during exporting.

There are 3 cases:

-All photos are missing, the photo view must disapear.
-Some photos are missing, these photos must not be shown.
-No missing photos, all the photos must be viewed.

at loading try to get all the existing photos by GET. missing photos
must be marked for later removal. After all asynchronous GET requests
are received, remove all missing photos then finally show them all.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:02:28 -07:00
Gehad elrobey
9e09bc0f52 HTML: Report start cylinder pressure correctly.
Report start cylinder pressure from the samples with empty value.
Must search for the first nonzero value.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:02:21 -07:00
Gehad elrobey
d922dbbd99 HTML: fix the value of cylinder gas in trimix dives
Value of He must be showed in trimix dives, also fixes the format of the
dive events table. Gas change should be something like O2: 50 - He 0

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:02:16 -07:00
Lubomir I. Ivanov
1e81dff946 Planner: disable mouse interaction when zoomed in
When zoomed in, things like moving planner points is not possible,
but if the user attempts that, replan() -> plotDive() is called
and the zoomLevel should be reset to the default value (we don't
really want that), but instead it's lost for some reason
(as the user reports: "Somes times, it changes to 100% which is ok").

If moving points becomes possible eventually while zoomed in,
we need to figure a way to replot without resetting the zoom level
in plotDive().

Fixes #851

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 07:38:46 -07:00
Lubomir I. Ivanov
2a1a868db2 datatrak: some codings style fixes and fopen() usage
- subsurface_fopen() is needed
- translated one puts("") message
- sizeof(unsigned char | char) is always 1
- pointer symbol (*) location
- padding fixes
- braces fixes

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 07:38:22 -07:00
Miika Turkia
76ce2b095b Trim CSV lines on import
In practice this will sanitize Windows line terminations (discard the
carriage return);

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 14:27:43 -07:00
Joakim Bygdell
55582cf5d4 Allow removal of manually added unused cylinders
Fixes #832

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 11:41:52 -07:00
Dirk Hohndel
b81647bd8a Change the diveSiteMessage to show close or accept/reject
This gives us consistent behavior and allows closing the dive site
management screen without editing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 11:35:05 -07:00
Dirk Hohndel
ca64f8a782 Clean up the UI when finished editing
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 11:09:25 -07:00
Dirk Hohndel
043ae4af27 Turn the toolbar back on after editing a dive site
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 10:50:56 -07:00
Dirk Hohndel
4796ee0c39 Don't call enableEdition() every time a change is made
We only need to do this once.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 10:50:18 -07:00
Dirk Hohndel
2c2adacb90 Don't enter dive site edit mode whenever the coordinates are set in the UI
This function was missing the check if setting that field actually changes
what's already in the data structure.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 10:49:21 -07:00