Commit graph

3653 commits

Author SHA1 Message Date
Tomaz Canabrava
257f8063c4 Move ExtraDataModel to qt-models
Another attempt to make it easyer to create the mobile version.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:11:26 -07:00
Tomaz Canabrava
d84ffa8fc3 Move WeightModel to qt-models
One more step to make it easyer to port the app to Mobile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:11:12 -07:00
Tomaz Canabrava
a0f3c9992c Move WeigthSystem Info model to qt-models
This is another effort to make it easyer for the mobile
interface of Subsurface.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:10:50 -07:00
Tomaz Canabrava
32b0afa3e7 Move Tankinfomodel to its own file
Another change to make it easier to program the mobile ui. This was a
fairly easy patch: just moved the contents of the file and fixed the
includes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:10:30 -07:00
Tomaz Canabrava
f432b764e7 Move DivePlannerModel and CylinderModel to qt-models
Still trying to make it easier for the Mobile Port:
This patch is a bit bigger than I hopped, but it was the smallest that I
could get.

A lot of TODO items where added where I broke the code because the current
implementation would break the QML implementtion on the designer. I'll
most probably fix those myself when I finish the transition to the models
to the new folder.

I only moved both models at once because there's an interdependency
between them (seems inevitable, tough, but I'll take a better look at it
later).

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:09:13 -07:00
Tomaz Canabrava
338c0f22aa Move the models to its own folder
This is an attempt to help share code between the desktop version of
Subsurface and the mobile version.
More code will be moved around and the models will be split in a way that
will help recompile times and also creation of different interfaces for
different form-factors.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:07:54 -07:00
Salvador Cuñat
64ba7f8683 Correctly save dive rating after changing it
Corrects typo in ebaa7d1fd which impeded that changes in dive rating
were saved after editing.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 16:12:37 -07:00
Dirk Hohndel
61c0d0c73d Remote storage: collect email and PIN in preferences
This allows entering / storing the PIN (aka passphrase) for the ssh key.
The email isn't used, yet - this will be used by the automated backend to
create a unique git repository that will turn into the remote storage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 14:40:06 -07:00
Dirk Hohndel
c90635cef2 Remote storage: add preferences UI
This isn't hooked up at all right now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 14:39:53 -07:00
Dirk Hohndel
20d1d2c385 Remote storage: add preference for the passphrase
While we don't expose it as this to the user, we'll need an ssh key and
potentially a passphrase in order to communicate with the git server in
our infrastructure. This simply sets up a way to store the passphrase.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 14:38:59 -07:00
Anton Lundin
b76a0f0b97 Wire gui for diagnostic logs from dc configuration
This copies peaces from the downloadfromdivecomputer dialog into the
configuredivecomputerdialog and connects them to be able to create a
logfile form the configuration of the divecomputer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 15:37:50 -07:00
Dirk Hohndel
a8c013869b Strip the default suffix if saving to git branch
For some reason the file selection dialog box now always adds a default
suffix to the file name we pick - which results in our test for git
storage to fail.

So if the filename looks like "<path>[branch].ssrf" then remove the suffix
that was added.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 11:14:26 -07:00
Dirk Hohndel
17b7bdfd2e Fix crash when rejecting dive site changes
Emitting the stopFilterDiveSite signal caused us to clean up the UI which
reset currentDs to NULL if this was a new dive site...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 07:53:14 -07:00
Dirk Hohndel
d6e32b02f6 Start editing new site regardless what the user does first
It doesn't matter if we first enter coordinates, name, description or
notes. If there is no currentDs we need to handle that gracefully.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 06:36:19 -07:00
Dirk Hohndel
bfee0a13f0 Dive site management: make sure currentDs is valid
When double clicking on the globe on a dive with no dive site we did
almost the right thing - except that we didn't create a dive site.

Not 100% sure this is the right place to do this, but it seems to work and
prevents the crash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-27 06:31:34 -07:00
Tomaz Canabrava
c6783739c9 Expand trips that are filtered on dive_site_manage
While filtering we would have trips that were collapsed, but this doesn't
really make much sense while managing dive_sites.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:49:19 -07:00
Tomaz Canabrava
ffffccee93 Filter out the dives that are not at dive_site.
Untested code to filter out dives that are not at the active dive_site.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:48:45 -07:00
Tomaz Canabrava
ee7e511372 Create signals/slots for filtering the dive_site,
The dive site management requires that we filter all the dives that are on
the current dive_site, this is the preparatory work for that.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:48:22 -07:00
Tomaz Canabrava
785051c9dd Only repopulate model when needed.
The old way we set the location and *then* updated the model, so the very
first location that we tried to show was empty.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:47:55 -07:00
Tomaz Canabrava
b7ec57bdef Show the correct dive_site on the manage combobox
When triggering the dive_site management, we need to get the uuid that was
send to us and set it as the current dive_site on the combobox, the dialog
can fill all required info for us.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:47:21 -07:00
Tomaz Canabrava
609688b489 Do not create a new dive site when curr is invalid
We will however create a new dive site when the user clicks on the add
button - creating it here would led to strange behavior.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:47:02 -07:00
Tomaz Canabrava
562ee7410c Don't setLocationId when accept/reject changes
setLocationId will filter the dives, so ignore the visual changes when
accepting / rejecting, it will only be triggered again when we are showing
this dialog again.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:46:29 -07:00
Tomaz Canabrava
46aa97bfc4 Do not set the dive_site when changing dives
We should only set the dive_site on the dive site management widget when
we are going to use that information, this is because the dive_site
management widget will filter all dives on the dive list.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-26 21:45:54 -07:00
Dirk Hohndel
ed57442bf7 Layout issues: Fix rating/visibility vs suit
The suit field should take up all the remaining space and the stars should
be vertically centered with the text.

This looks much better

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:15 -07:00
Tomaz Canabrava
8f2f9164fc Layout issues: Fix the Profile/Toolbar
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:15 -07:00
Tomaz Canabrava
adb61b38ea Do not connect null to a signal
The parent here should have been the mainwindow, but we create this dialog
on the stack instead of the heap and because of that we don't set the
parent to prevent a double free.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:13 -07:00
Tomaz Canabrava
f17f4ec9a0 Layout issues: Fix planner layout
Layout was wrong.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:13 -07:00
Tomaz Canabrava
0f7061b93e Layout issues: Fix DownloadFromDiveComputer
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:13 -07:00
Tomaz Canabrava
4a52f44ae3 Layout issues: Fix DiveShare export dialog
One more.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:13 -07:00
Tomaz Canabrava
307ad174ae Layout issues: Fix the DiveImportDialog
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:45:11 -07:00
Tomaz Canabrava
42acaa40f5 Layout issues: Fix the export dialog
This patch makes the export dialog more consistent with the rest of
Subsurface.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:43:21 -07:00
Tomaz Canabrava
946615b8d7 Layout issues: Major rework on the MainTab
This seems almost perfect now.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:43:14 -07:00
Tomaz Canabrava
d5013a7883 Layout issues: Fix spacing for the filter dialog
This is the single filter dialog - the spacing is much better, but when
activated it seems cluttered, this is because the outer layout (the one
that encapsulates everything) has the wrong layouting - I need to find and
fix that. I'll actually change that to a splitter, it will provide a more
flexible resize of the widgets.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:43:08 -07:00
Tomaz Canabrava
a46cc691dc Layout issues: Fix issues in other places of the MainTab
Also, added tooltips to the Tab Texts.
I need to fix the layout issues of the Equipments, but that's not inside
the UI. Things are much more sane now.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:42:55 -07:00
Tomaz Canabrava
d801bd622a Layout issues: Fix the layout ugliness on Mac & Linux
I seem to have found a sane way to create layouts:
If it's the 'outer' layout, the one that encapsulates everything:
- Horizontal Spacing: 5
- Vertical Spacing: 5

If it's a vertical inner layout that is grouping items like label +
control:
- Spacing: 0
This way the label will be 'touching' the item, without empty space, so
you know that the label refers to that widget.

If it's an horizontal inner layout:
- Spacing: 5
Different from the Vertical Layout, we don't want to make horizontal items
touch each other, a bit of space is fundamental to the eyes.

If it's a Grid Layout:
- Vertical Space: 0
- Horizontal Space: 5

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:42:49 -07:00
Tomaz Canabrava
7d1df992fa Layout issues: Remove auto layout management from mainwindow.cpp
While this worked for a bit, it was very error prone as it relied in
layout having specific names, and layouts in the .ui files are treated as
substandard items. Every time a 'break layout' command is issues (and it's
issued quite a lot when trying to reorganize the items on the widget) all
layout items are removed and new ones are added later, without any of the
names.

Since the new layout can be different the old names are not usefull
anymore - and a clean compilation won't trigger a single warning either:
the name resolution is done at runtime and not at compile time, so it
would just fail silently.

Instead of brute-forcing each layout to have 0,0 or 5,5 margins, we should
put the correct values on the .ui files.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:42:35 -07:00
Tomaz Canabrava
dbed94f12c Remove support for Qt4 (part 6)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-24 09:37:23 -07:00
Tomaz Canabrava
4eeecf7315 Remove support for Qt4 (part 5)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-24 09:37:23 -07:00
Tomaz Canabrava
f88fb74b5b Remove support for Qt4 (part 4)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-24 09:37:23 -07:00
Tomaz Canabrava
bd73156e2b Remove support for Qt4 (part 1)
I`m now clearing the code for all use of Qt < 5, since Qt 5 was released
for quite a while and making two versions of Qt to work together is a bit
painfull.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-24 09:37:18 -07:00
Dirk Hohndel
e201f0f2b1 Location management: reflect changes to a location's name
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-22 12:29:47 -07:00
Dirk Hohndel
d4b5854f82 Location management: reflect changes to the coordinates on the map
This is a bit aggressive as it changes the globe with every single
character that's entered, but it's better than what we had before.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-22 12:29:39 -07:00
Dirk Hohndel
b342730ec9 Location management: actually parse the GPS coordinates
We still don't respond correctly to a user changing them (i.e., the map
doesn't change), but at least once they change the dive to a different
dive and back to this one things get done correctly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-22 11:56:03 -07:00
Paul-Erik Törrönen
cfa5403192 Fix typo
Loockup -> Lookup

Signed-off-by: Paul-Erik Törrönen <poltsi@777-team.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-21 16:05:09 -07:00
Dirk Hohndel
00b1469658 Merge branch 'v4.4-branch' into newmaster
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-21 13:45:25 -07:00
Robert C. Helling
187f7dab9f Add option to display GPS coordinates as decimals
This adds a field to the units preferences to have GPS coordinates
show as decimals (as for example Google maps does it).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-20 10:34:10 -07:00
Robert C. Helling
6730405624 Ask user about merging dives more than 30m apart
...and remember the answer.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-18 13:53:18 -07:00
Robert C. Helling
043bd3afb7 Make gaschange from contex menu act as a gaschange
so it affect no longer the previous leg but all the following ones
with the same gas (i.e. until the next gaschange).

This makes the add dive/planner behaviour more consistent
with the rest of the program regarding gas changes.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 15:07:06 -07:00
Tomaz Canabrava
253d9ff300 Use the QtWaitingSpinner instead of blocking the MainTab
We shouldn't allow the user to change the location when we are probing
the web for the correct places if we are updating an old file from
Subsurface. This makes use of a pleasant spinner that works beautifully.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 15:02:57 -07:00
Tomaz Canabrava
c2f77353ee Better name for the disable/enable geolocation edit
'enable' and 'disable' is too generic, and we are only
blocking the geolocation edit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 15:00:45 -07:00
Tomaz Canabrava
b59084dc1f Add a new class, QtWaitingSpinner, MIT Licensed.
from https://github.com/snowwlex/QtWaitingSpinner

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 15:00:25 -07:00
Dirk Hohndel
c11bbe4f38 Fix easily reproduced crash
Open dive file. Click Location-manage. Pick a site. Click close. Click
Location-manage again. BOOM.
This seems to make sense, but since not a lot of the code is hooked up
yet, I'm not sure this is what we want in the end. But for now it prevents
an easily reproduced crash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 14:05:24 -07:00
Tomaz Canabrava
10a0a252c8 Update the dive location when showing the dialog
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:54:08 -07:00
Tomaz Canabrava
0c33d585ea Implement the row count for location information
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:52:23 -07:00
Tomaz Canabrava
3235dd842e Implement the data method for location information
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:52:23 -07:00
Tomaz Canabrava
8115855428 Start the model for location information.
And implement the reset method.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:52:19 -07:00
Tomaz Canabrava
5eb572b9c6 Move Locationinformation to its own file.
The SimpleWidgets file was getting too big, and location information will
also need a new model - a good way to do not mix everything is to put
things in a new file.

[Dirk Hohndel: added missing include of stdint.h]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:51:13 -07:00
Tomaz Canabrava
d9ad829173 Change the Locationinformation to handle location editing
Add a few interface items to handle location editiing, a combobox to show
everything, and three buttons: add, edit, delete.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:45:46 -07:00
Tomaz Canabrava
c95998e4bd Fix the layout of the geo management
The layout was just plain ugly; this fixes that and also adds the
possibility to insert new controls that will be userfull for managing the
Locations.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:45:12 -07:00
Tomaz Canabrava
e61e127715 Remove extra ; at the end of lines.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:44:51 -07:00
Tomaz Canabrava
96850b9931 Don't enable the widgets before finishing the thread
The maintab should be disabled when the geolocation thread is
running - but if you changed the dive, it would reenabled it.
(actually this should be only on the location widget, I'll send
another path later)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:42:53 -07:00
Tomaz Canabrava
2b99ae5781 Fix signal connections
I don't know what happened to me, I connected to some signals that didn't
exist at all.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:42:09 -07:00
Robert C. Helling
05552c7339 Show seconds in duration for free dives
For free dives (corresponding to dive mode or duration shorter than
15min), the display format for duration is changed to display minutes
and seconds.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:40:11 -07:00
Dirk Hohndel
2dd5781afe Make sure that the save file dialog actually is marked as such
While this worked on Linux, on the Mac we didn't have an input field to
enter the file name. With this we explicitly declare that this is a file
save dialog and that the user can specify a non-existing file name.

Fixes #872

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-11 15:26:56 -07:00
Dirk Hohndel
ebaa7d1fd0 Multi dive edit: treat buddy and divemaster as tag lists
So just like tags do "differential editing". Figure out what (or in this
case, who) was added / removed from the displayed dive and do the same for
all other selected dives.

This does seem a bit over top for divemaster, but this is more consistent
and therefore should make more sense to the user - assuming we ever have
one who runs into this.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-11 10:40:20 -07:00
Robert C. Helling
698b2b133f Only add disclaimer and runtime table if we added deco to replanne dive
As a side effect this changes the signature of plan(): Before it
returned an int that was supposed to be possibly an error but
we never bothered to check it. So now it's bool indicating if the
planner did add stops.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-11 07:57:09 -07:00
Linus Torvalds
3edec7c97d Fix initial scrolling problem
The initial selection change signal seems to potentially be sent
before the listview is even visible when we do the first "scrollTo()"
to the currently selected dive.

That, in turn, seems to result in that when the listview is actually
shown, it will be scroll the trip description off the visible area,
and force the current dive to be shown at the very top of the
divelist. Which is not very nice: we do want to scroll to the current
dive, but we don't want to hide the current trip in the process.

Ignoring the selection change if the listview isn't even visible seems
to fix things for me.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-11 07:33:31 -07:00
Tomaz Canabrava
9523132b6d Only show Collapse all when its needed
This makes Collapse All only visible when its needed, and it
also fixes a crash when invocking collapse all when there was
nothing to collapse.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-11 07:30:52 -07:00
Tomaz Canabrava
d6f45ec74d Only show expand all and collapse all options if there`s a need
This patch unclutter the menu by hidding collapse all
when all dives are collapsed, and expand all when all
dives are expanded.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-11 07:27:55 -07:00
Tomaz Canabrava
627de38c01 Get the location information in a separate thread
This makes Subsurface usable faster for those without a good internet
connection when they are opening an older data file.

While parsing, we are only feeding an vector of locations, after the
parsing is done, we traverse the vector searching for the information on
the web.

I need to also add a way to stop if there`s no internet connection - but
this will be another patch.

Also, fixed two small memory leaks from the old imp.

[Dirk Hohndel: cleaned up the whitespace mess]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-10 11:14:20 -07:00
Robert C. Helling
412844c02b Keep old notes when saving as new dive in replan
... but discard an old disclaimer and runtime table if present.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-09 06:54:03 -07:00
Robert C. Helling
e538347424 Change menu entry for "replan"
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-09 06:53:43 -07:00
Robert C. Helling
70c64eaa66 Only print gasname for a segment in planner if it differs from the previous one
This is to avoid visual clutter when replanning logged dives.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-08 10:04:22 -07:00
Robert C. Helling
9d8eb10421 Only warn when trying to replan a logged dive
If there are more than 100 samples, average some of them so we end up with no more than 100.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-08 10:02:45 -07:00
Dirk Hohndel
02ed0ccabb Improve multi dive tag list edits
The old behavior was kind of crude. Just smack the tags that were on the
displayed dive on all selected dives.

This seems to make more sense. We figure out which tags were added to the
displayed dive and add them to all selected dives. And we remove all tags
that were removed from the displayed dive from all selected dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-02 17:02:21 -07:00
Dirk Hohndel
4c588c1f00 Improve multi dive tag list edits
The old behavior was kind of crude. Just smack the tags that were on the
displayed dive on all selected dives.

This seems to make more sense. We figure out which tags were added to the
displayed dive and add them to all selected dives. And we remove all tags
that were removed from the displayed dive from all selected dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-02 12:18:12 -07:00
Dirk Hohndel
5810aedeac Uemis downloader: clean up the path for Windows mount point
Oops, we left the (UEMISSDA) in the path. This can never have worked
without the user manually correcting it to just show the drive letter.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-30 16:35:46 -07:00
Dirk Hohndel
8bbb3dfe42 Uemis downloader: allow continuing download by clicking Retry
When we run out of space in the Uemis filesystem we return an error. The
user could reasonably unplug the SDA, insert it again and then retry to
continue the download (that's what we tell them to do). In that case we
need to make sure we start at the correct dive otherwise the same dives
keep getting downloaded over and over again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-30 07:42:42 -07:00
Dirk Hohndel
e9ba8f0ff6 Download dialog: we can accept a partial download after an error
The dialog didn't accept "OK" and store the dives downloaded / selected so
far if there had been an error. Especially with partial downloads from the
Uemis SDA this is something that is quite reasonable to want to do, so
allow exiting the dialog with OK even after an error.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-30 07:41:41 -07:00
Robert C. Helling
a4c35f1d63 Rename menu entry for image hashing
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-29 14:01:24 -07:00
Robert C. Helling
66ac97d7ad Display a notification while image hashing is ongoing.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-29 14:01:14 -07:00
Dirk Hohndel
5fe8919424 Small design fix to make labels on Info tab look aligned
By wrapping the Location label in a layout as well they now all look
aligned again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-29 12:43:11 -07:00
Dirk Hohndel
3a715c2299 Simplify creation of the upload file for Divelogs.de
Instead of writing each dive out to a file and reading that file back in,
let's just use the internal helper function that places the dive as XML
into a membuffer.

So much simpler, so much faster.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-28 11:28:53 -07:00
Dirk Hohndel
3043114446 Show error if creation of the Divelogs.de upload file fails
Previously we simply failed silently without showing the user any
indication that something went wrong. That seems wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-28 10:42:54 -07:00
Robert C. Helling
e19d38193d Disable planner UI elements without function
This disables planner UI elements in recreational mode that have no function
in that mode.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-26 16:54:29 -07:00
willem ferguson
a8656759bb Modify wording of dive list context menu
Dive context menu:
After the addition of the item "Add image(s) from web" the item
immediately above is "Add images". It is proper to specify now:
"Add image(s) from file(s)" to make the distinction clear. I also
change "Shift times" to "Shift dive times".

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-26 10:31:52 -07:00
Robert C. Helling
757c4aab20 Allow images to be added via the web
This adds a new divelist context menu entry which asks for a URL. The file
is retrieved and if it is an image it is added to the cache and the url
is associated to dives as with local files.

NB this currently only works with URLs pointing directly to images. But it
should not be too hard to add the possibility to add a direction via an html
file and its image tags.

To test: open dives/test43.xml and delete the image and then add the URL
http://euve10195.vserver.de/~robert/wreck.jpg

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24 09:36:21 -07:00
Robert C. Helling
a0a3c6ec15 Cleaning up variable names in image loading
Use more explicit variabel names and make the get timestamp function actually
return the timestamp rather than getting a pointer argument

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24 09:35:35 -07:00
Miika Turkia
c80d1879b7 Add suit field for CSV import
Fixes #853

[Dirk Hohndel: fixed test compile]

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24 06:50:50 -07:00
Dirk Hohndel
415abeea66 When deleting a cylinder, adapt gas changes
When we delete a cylinder the gas changes in that dive may have to be
adjusted. We didn't do this at all in the past. With this commit we should
be doing this right for a single dive that is being edited.

This does NOT handle multiple dives being edited at the same time (or more
specifically - if you have multiple dives selected and delete a cylinder,
the dives that had the same set of cylinders (other than the displayed
dive) will get that particular cylinder deleted, but won't have their gas
change events (and sensor data in the samples) adapted.

Possibly we should simply prohibit deleting cylinders when more than one
dive are selected.

See #834

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-23 15:27:21 -07:00
Dirk Hohndel
bbfa2b655b Profile context menu: trigger editing of manually added dive
Right now the way to edit the profile of a manually added dive is really
counterintuitive: you have to first make some random change to the dive
information, then the profile switches in to editing mode.

This commit adds a simple context menu entry on the profile that is only
shown when the a manually added dive is displayed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-23 13:56:24 -07:00
Dirk Hohndel
6f7e3d04cb Handle XSLT based imports correctly
XSLT conversions create V2 XML files, but we shouldn't abort when we parse
those without having the user informed about the potential slowness - all
XSLT based imports are slow, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-22 13:20:27 -07:00
Dirk Hohndel
ab24c1df87 When editing the location, make sure it gets applied to the dives
Oops, that was embarrassing. Just setting it on displayed_dive doesn't
gain us anything if it isn't transferred to the selected dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-22 09:35:58 -07:00
Dirk Hohndel
429fcdb344 When remembering the selection, don't try to be too smart with trips
We assumed that a trip was selected when all of its dives were selected
instead of just remembering if the trip itself was selected. I'm sure
there was a reason for that but I cannot think of any. But a side effect
is that if you have a trip with only one dive in it and have that one dive
selected and edit it, after saving your changes you end up on the trip
(which is now also selected) and are no longer on the dive. And that seems
quite wrong.

The new code simply remembers that the trip was selected. And selects it
again if it was.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-22 08:42:28 -07:00
Dirk Hohndel
79f15e913b Uemis downloader: allow continuing download by clicking Retry
When we run out of space in the Uemis filesystem we return an error. The
user could reasonably unplug the SDA, insert it again and then retry to
continue the download (that's what we tell them to do). In that case we
need to make sure we start at the correct dive otherwise the same dives
keep getting downloaded over and over again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-20 23:28:04 -07:00
Dirk Hohndel
4bccee238c Download dialog: we can accept a partial download after an error
The dialog didn't accept "OK" and store the dives downloaded / selected so
far if there had been an error. Especially with partial downloads from the
Uemis SDA this is something that is quite reasonable to want to do, so
allow exiting the dialog with OK even after an error.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-20 22:11:43 -07:00
Grace Karanja
193edd9f13 Add ability to undo removing of dives from trips
Add the functionality to undo/redo removing of dives from trips. The
code calling remove_dive_from_trip has moved to the UndoCommands class.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-14 10:29:15 -07:00
Gehad elrobey
54453abe49 Show error messages for incorrect edit invocation
Planned dives must be replanned while manually added dives must be edited.
Show error messages to handle wrong user input.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-14 10:12:32 -07:00
Joakim Bygdell
afea30fd8a Recmode: Allow the user to specify gas reserve.
Since most regulators have an intermediate pressure of 10bar
the minimum value is 10 while the max is 99.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-09 14:36:17 -07:00
Joakim Bygdell
f8a808bcaf Shorten the first leg of the planner.
With the addition of gas reserves in recreational mode
we need to make sure that the first leg is short enough
that we have more gas left than the specified reserve
even when using small cylinders like LP72.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 07:40:33 -07:00
Salvador Cuñat
3ca4e14d5c OSTCTools-Add support to import .dive files
OSTCTools is a windows based software by Robert Angeymar which performs
configuration upgrade, memory analysis and download tasks for H&W OSTC
devices.

Downloaded dives are stored in files (one archive each) with the raw
binary data heavily padded at the begining of the file, and some other
data not included in H&W dive header protocol as the device's serial
number.

The import function simply takes the raw data part of the file and lets
libdivecomputer do the parseing.

Then adds some additional info as OSTC reported dive number and serial
device number.

Please note that OSTCTools is *not* a real logging software, it simply
gets the DC raw data, so there isn't any information about dive site,
equipment and so.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 10:33:49 -07:00
Robert C. Helling
cc8d601422 Checkbox and preference for safety stop
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-02 09:46:10 -07:00
Robert C. Helling
8571dcf967 Introduce recreational planner mode
This adopts the planner to the needs of the recreational diver. Rather than immediately
starting to ascent doing deco stops this mode, this mode stays at the last manually
entered depth for the maximal time before mandantory stops appear (NDL). It does not
change gas but keeps using the last used cylinder.

TODO: * Grey out unused UI elements of the planner in this mode
      * Start ascent before gas runs out (or into reserve)
      * Do a 3min @ 5m safety stop.

Fixes #840

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-02 09:45:50 -07:00
Robert C. Helling
ec0de54450 Make the image hashing non-blocking again
...it had become blocking with 1e3700c1

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-30 13:04:01 -07:00
Lubomir I. Ivanov
bc44dd8db1 maintab.cpp: fix editing dive profiles from trips
Once a manually added dive is part of a trip and this trip
is edited, applying the modifications leaves the dive profile
in edit mode (e.g. points can be dragged and gas swapping can
be applied).

The issue can be viewed from another angle. Why enable
profile edits of a manually added dive which is in a trip,
while the trip is being edited in the first place?

If there are more than one manually added dives in said trip
we are enabled to edit one of the dive but probably
it's not intended to modify all manually added dives after the
changes are applied for the trip.

This patch disables the functionality in question and it also...

Fixes #864

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-30 12:54:36 -07:00
Gehad elrobey
4122387208 Manual added dives edit button is missing
once the manual added dive is added it can't be edited directly, This
can be fixed by adding an edit button to the log menu, this will be
consistent with the plan/replan buttons.

Fixes #847

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-30 12:53:09 -07:00
Gaetan Bisson
5bf23381e0 Save more planner settings into prefs
This adds to the prefs struct the variables last_stop, verbatim_plan,
display_runtime, display_duration, and display_transitions from the
planner so their values are saved from one session to the next.

The widgets for some of those settings had default values in
plannerSettings.ui; remove them since the new code in
subsurfacestartup.c takes care of initializing them.

Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-25 09:45:46 -07:00
Marcos CARDINOT
605d2f7386 MultiFilterInterface - initilize member + remove extra ;
initialize member 'anyChecked' in the constructor

Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-25 02:28:22 -07:00
Marcos CARDINOT
135e834019 DivePlannerPointsModel::recalc - initilizes member
Non-static class member recalc is not initialized in the constructor

Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-25 02:28:02 -07:00
Marcos CARDINOT
0bf61844e7 DivelogsDeWebServices::multipart - initializes member
Non-static class member multipart is not initialized in the constructor

Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-25 02:27:53 -07:00
Miika Turkia
86ac7fdf47 Import support for new Seabear format
This add support for Seabear's new import format that is used by H3 and
T1. In the future also the Hudc  should switch to the new format. The
main difference to the old one is that time stamps are no longer
recorded in the samples, but intervali is specified in the header.

The header contains other useful information as well that we should
build support for. E.g. surface pressure, gas mixes, GF, and mode might
be useful additions later on.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-23 05:44:06 -07:00
Claudiu Olteanu
1982bdb9fc Implement handler for cancel button of Save As dialog
When an user opened the "Save as" dialog and pressed the
cancel button a null string was returned. Therefore the
file_save_as function returned an error which was lately
shown when the file_save function was called.
Now the function checks if the cancel/exit button was
pressed and returns.

Fixes #844

Reported-by: longjohnsilver
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-21 11:20:46 -07:00
Joakim Bygdell
90905601c5 GUI fix for OSX. Reduce the padding of the divelist header so that we don't obscure the first dive in the list.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-21 11:12:13 -07:00
Marcos CARDINOT
056b4baf11 Prevent crash when clicking re-plan without selected dive
test case:
1 - make sure that you DO NOT have anything selected on the 'Dive list;
2 - in the menu bar, click on 'Log'->'Re-plan dive';
3 - crash!

Fixes #858

Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-20 09:57:53 -07:00
Marcos CARDINOT
70b4c9f2d3 RulerItem2::settingsChanged() - NULL pointer dereference
The current code is dereferencing the null pointer 'profWidget'.
It can cause a segmentation fault.

Signed-off-by: Marcos Cardinot <mcardinot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-19 15:34:10 -07:00
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
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
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
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
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
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
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
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
Dirk Hohndel
1e3700c11f Don't call UI functions from helper code
This may seem much more complicated but actually is much cleaner. Add each
thread we start to the list of future results and add a new UI function
that updates the UI once all of the threads have finished.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 10:22:34 -07:00
Salvador Cuñat
44b55bd1a2 Import Datatrak/WLog files
Sequentially parses a file, expected to be a Datatrak/WLog divelog, and
converts the dive info into Subsurface's dive structure.

As my first DC, back in 90s, was an Aladin Air X, the obvious choice of log
software was DTrak (Win version). After using it for some time we moved to WLog
(shareware software more user friendly than Dtrak, printing capable, and still
better, it runs under wine, which, as linux user, was definitive for me). Then,
some years later, my last Aladin died and I moved to an OSTC, forcing me to
look for a software that support this DC.
I found JDivelog which was capable of import Dtrak logs and used it for some
time until discovered Subsurface existence and devoted to it.

The fact was that importing Dtrak dives in JDivelog and then re-importing them
in Subsurface caused a significant data loss (mainly in the profile events and
alarms) and weird location of some other info in the dive notes (mostly tag
items in the original Dtrak software). This situation can't actually be solved
with tools like divelogs.de which causes similar if no greater data loss.

Although this won't be a core feature for Subsurface, I expect it can be useful
for some other divers as has been for me.

Comments and issues:

Datatrak/Wlog files include a lot of diving data which are not directly
supported in Subsurface, in these cases we choose mostly to use "tags".

The lack of some important info in Datatrak archives (e.g. tank's initial
pressure) forces us to do some arbitrary assumptions (e.g. initial pressure =
200 bar).

There might be archives coming directly from old DOS days, as first versions
of Datatrak run on that OS; they were coded CP437 or CP850, while dive logs
coming from Win versions seems to be coded CP1252. Finally, Wlog seems to use a
mixed confusing style. Program directly converts some of the old encoded chars
to iso8859 but is expected there be some issues with non alphabetic chars, e.g.
"ª".

There are two text fields: "Other activities" and "Dive notes", both limited to
256 char size. We have merged them in Subsurface's "Dive Notes" although the
first one could be "tagged", but we're unsure that the user had filled it in
a tag friendly way.

WLog adds some information to the dive and lets the user to write more than
256 chars notes. This is achieved, while keeping compatibility with DTrak
divelogs, by adding a complementary file named equally as the .log file and
with .add extension where all this info is stored.  We have, still, not worked
with this complementary files.

This work is based on the paper referenced in butracker #194 which has some
errors (e.g. beginning of log and beginning of dive are changed) and a lot of
bytes of unknown meaning. Example.log shows, at least, one more byte than those
referred in the paper for the O2 Aladin computer, this could be a byte referred
to the use of SCR but the lack of an OC dive with O2 computer makes impossible
for us to compare.

The only way we have figured out to distinguish a priori between SCR and non
SCR dives with O2 computers is that the dives are tagged with a "rebreather"
tag. Obviously this is not a very trusty way of doing things. In SCR dives,
the O2% in mix means, probably, the maximum O2% in the circuit, not the O2%
of the EAN mix in the tanks, which would be unknown in this case.

The list of DCs related in bug #194 paper seems incomplete, we have added
one or two from WLog and discarded those which are known to exist but whose
model is unknown, grouping them under the imaginative name of "unknown". The
list can easily be increased in the future if we ever know the models
identifiers.
BTW, in Example.log, 0x00 identifier is used for some DC dives and from my own
divelogs is inferred that 0x00 is used for manually entered dives, this could
easily be an error in Example.log coming from a preproduction DC model.

Example.log which is shipped in datatrak package is included in dives
directory for testing pourposes.

[Dirk Hohndel: some small cleanups, merged with latest master, support
               divesites, remove the pointless memset() before free() calls
	       add to cmake build]

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 10:03:08 -07:00
Tomaz Canabrava
500c4c2772 Clear after accepting / rejecting the LocationEdit
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:47:30 -07:00
Tomaz Canabrava
986b6c509a Change color / mark widget as changed correctly on LocationEdit
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:47:21 -07:00
Tomaz Canabrava
30c5a027ca Clone a bit of code to mark the Location Widget changed
This code is the same that is used on the MainTab, but
since they are different objects, I can't just call it.
so I'm duplicating them for the time being.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:47:05 -07:00
Tomaz Canabrava
6fbf5b33cc Remove redundant code
Another snippet that shouldn't exist.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:47:00 -07:00
Tomaz Canabrava
a5448ef729 Remove dead code.
This code used to trigger the edit mode a long time ago
since now I'm re-reading the code to implement the
same stuff on the Location edit mode, I realized that
this is not needed anymore.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:46:50 -07:00
Tomaz Canabrava
53d20f5b8a Do not show the Edit mode message when entering location management screen
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10 07:46:30 -07:00
Joakim Bygdell
20a82e2b21 Improve gas accounting in the panner
When using gasmixes where the difference is less than 2% the planner can't
caclulate casconsumptions correctly. This sets the minimum gasdifference
to 1%.

Fixes #795

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-09 10:39:50 -07:00
Anton Lundin
237043d6ba Fix building with NO_PRINTING for Android
Back in 4867ee8ad8 ("Move the Profile out
of the mainwindow.ui") the way to access the PlannerDetails object
changed.

This does the corresponding change to the NO_PRINTING block, making it
build on Android again.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-09 09:44:00 -07:00
Miika Turkia
724772ef68 Include upper case extensions on import dialog
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-08 12:55:47 -07:00
Grace Karanja
182fe790c9 Add ability to undo renumbering of dives
Expand the undo feature by storing a list of renumbered dives' ids
and numbers so that the original numbers can be restored if needed.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-28 12:44:14 +01:00
Gehad elrobey
100f4ee1a4 Show notification message while logs are converted from v2
This is another long operation that needs showing a notification about
importing the old format log files

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-28 12:42:50 +01:00
Gehad elrobey
90d68ead31 Show translated String.
Translated notifications are always better.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27 06:31:12 +01:00
Gehad elrobey
f61b59d961 Change the references to ShowError to the new notification object.
Showing an Error message is better called from the Notification Object,
So for consistency old references to showError is replaced by calling
the notification object.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27 06:31:10 +01:00
Gehad elrobey
59ab849854 Creating a Notification widget in the Main Window.
The main error message bar can be used to show exporting information and
other notification.

So a new Notification handler object is created in the main window
<NotificationWidget> that inherits <KMessageWidget> that shows different
type of notifications, ex. (Warning, Error and information)

Also this class contains a QFutureWatcher object that is set to handle
the QFuture variable returned from the exporting thread. this will allow
the UI to be updated when the thread finishes execution.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27 06:31:06 +01:00
Robert C. Helling
e6482bbdc8 UI to learn hashes of local image files
This addes a menu entry for the user to select a directory that is recursively
traversed to look for image files and compute the hashes of those images (for
those images to be available to be displayed in dives according to their hash values).

This traversal and hash computation happens in and independend thread and so far
the only feedback to the user is that upon completion the dispayed images are updated.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27 06:30:49 +01:00
Robert C. Helling
b02bf002a6 Add hashes to images
Upon successfull reading an image file, this computes a SHA1 hash of the
image and saves it with the picture tag in the log file. When a file is
not successfully loaded (for example because the log was created on a
different computer) we look up the hash in a dictionary that maps hashes
to local file names.

That dictionary (actually two for both directions), is loaded on startup
and saved upon destruction of the main window.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27 06:29:44 +01:00
Dirk Hohndel
0ed4356fc2 Display slowness warning before opening a V2 file
This is somewhat invasive as aborting the XML file read requires us to
report things up the recursive parsing chain.

What we really need to do here is to ask the user how they want to use the
data from reverse geo lookup. But for now we only warn about the fact that
this can take a while.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-25 10:05:37 +01:00
Dirk Hohndel
ddc01e39e7 Move helper functions around
We had a ton of helper functions in qt-gui.cpp which really didn't make
much sense. So I moved them all into qthelper.cpp.

Also moved the UserAgent helper that didn't belong in the UpdateHandler to
begin with - that's a generic helper used in many places...

With this we can successfully build using cmake again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-23 09:31:08 -08:00
Dirk Hohndel
2866a604b4 Revert "Update Qt4 patch"
This reverts commit 762315e7ee.

Oops, this was supposed to update the patch, not update and apply it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-22 08:30:34 -08:00
Dirk Hohndel
762315e7ee Update Qt4 patch
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-19 21:52:41 -08:00
Lubomir I. Ivanov
aa7f2eeb8a subsurfacewebservices.cpp: add QDebug include
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 14:08:44 -08:00
Lubomir I. Ivanov
8053a61442 simplewidgets.cpp: QLineEdit::setClearButtonEnabled() is from Qt5.2
This could cause problems if the user tries to compile with
Qt versions between 5.0 and 5.2.

Reported-by: Michele Fabi <fabiemme@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 14:08:36 -08:00
Gehad elrobey
98d1dbef11 HTML: Fix Null values in yearly statistics export.
Null values should be handeled nicely instead of showing NULL or Nan.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 08:52:21 -08:00
Gehad elrobey
043ab5b02c HTML: Fix exporting themes in multilingual environment
Don't compare to static english string, must translate first.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 08:52:16 -08:00
Miika Turkia
9e92d27bd0 Add ssrf as dive log extension on import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 08:52:11 -08:00
Robert C. Helling
b60a3d71d3 Use unused cylinders in planner if they are displayed
This makes prefs.display_unused_tanks also relevant for the planner.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 08:51:05 -08:00
Lubomir I. Ivanov
d6d0fb09f9 subsurfacewebservices.cpp: add QDebug include
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 08:49:34 -08:00
Lubomir I. Ivanov
0cf2f90507 simplewidgets.cpp: QLineEdit::setClearButtonEnabled() is from Qt5.2
This could cause problems if the user tries to compile with
Qt versions between 5.0 and 5.2.

Reported-by: Michele Fabi <fabiemme@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17 08:49:26 -08:00
Tomaz Canabrava
2e6fcfc969 Fix profile toolbar
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-16 20:37:52 -08:00
Lubomir I. Ivanov
071b9ff50c downloadfromdivecomputer.cpp: fix initializer list order warning
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-15 13:29:49 -08:00
Lubomir I. Ivanov
c45768a09f add and use a version.c / version.h pair
version.c is now object code which is recompiled each time
ssrf-version.h changes, while the interface file version.h
remains that same at all times and files which include it
will not need to be recompiled.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-15 13:26:51 -08:00
Thiago Macieira
39ffb0fced Fix Subsurface build with Qt 5.4.1 and later
The intention had been all along to use the 5.4 QSysInfo API, but due to
a silly mistake in the QT_VERSION check, it never got enabled for 5.4.0.
On 5.4.1 it does get enabled and, unfortunately, causes compilation
errors because the API changed between the time we backported to
Subsurface and the final version.

This commit backports the final QSysInfo API from Qt 5.4 into
Subsurface, which includes the renaming of a few functions. Since the
prettyOsName function no longer exists in the Qt API in that form, I've
reimplemented it using the API that does exist.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-15 06:00:52 -08:00
Robert C. Helling
ea143e9668 Use unused cylinders in planner if they are displayed
This makes prefs.display_unused_tanks also relevant for the planner.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-15 06:00:06 -08:00
Gehad elrobey
9470be0a77 HTML: Fix Null values in yearly statistics export.
Null values should be handeled nicely instead of showing NULL or Nan.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-15 05:56:01 -08:00
Gehad elrobey
d2990aea6f HTML: Fix exporting themes in multilingual environment
Don't compare to static english string, must translate first.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-15 05:55:42 -08:00
Miika Turkia
2bd019817c Add ssrf as dive log extension on import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-14 22:38:17 -08:00
Grace Karanja
87ee8e8aef Add ability to undo shifting of dive time
Adds the ability to undo shifting of dive times. The change is captured
at simplewidgets.cpp and an undo command is created.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-14 15:46:37 -08:00
Dirk Hohndel
cf07e3a79b When cleaning up the empty screen, also clean up dive sites
Otherwise we are using stale pointers in the displayed_dive_site global.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-14 11:56:33 -08:00
Henrik Brautaset Aronsen
961bac9233 Rename the tab "Dive info" to "Info", and "Dive notes" to "Notes"
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-14 11:18:53 -08:00
Lubomir I. Ivanov
cbff3f89c9 mainwindow.cpp: don't close a file if a dive site is being edited
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-14 11:18:32 -08:00
Dirk Hohndel
f81e2c111d When updating the dive site name, show this on the maintab
If we accept a change on the dive site management screen, it needs to be
reflected on the Dive notes tab right away.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 23:50:31 -08:00
Dirk Hohndel
ca72ab5749 When closing a dive, delete all the dive sites
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 23:11:36 -08:00
Dirk Hohndel
3ea2e15bd2 Don't add empty dive sites
It makes no sense to keep them around, it makes no sense to have dives
refer to them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 23:08:33 -08:00
Dirk Hohndel
cd77e2e700 Make sure there is a dive site if you try to edit it
If the user clicks on manage (or double clicks on the globe) and the
displayed_dive doesn't actually have a dive site associated with it (e.g.
because we are adding a dive or because it was imported or downloaded
without dive site information, then we need to make sure that there is an
empty dive site that we can make changes to.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 22:45:31 -08:00
Dirk Hohndel
e32459d313 When adding / planning a dive, reset the dive site manage screen
Otherwise old data is still shown if the user clicks manage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 22:42:57 -08:00
Dirk Hohndel
b60b4ef69d Fix crash when adding a dive
If a dive has no dive_site_uuid we would dereference a NULL pointer and
crash. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 22:08:08 -08:00
Dirk Hohndel
2607fea2de Fix compile time warning
No idea why designer sometimes adds these zorder items.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 14:45:31 -08:00
Dirk Hohndel
32ad046f56 Allow editing of dive sites
And hook things up when double clicking the globe.

The user experience isn't consistent with what we do on the main tab
(i.e., no coloring of fields that are changed), but it seems to work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 14:27:35 -08:00
Dirk Hohndel
6708e06872 Adapt GPS coordinate download from our companion app to dive sites
This is a bit awkward now. We are downloading what looks like fake dives
in the v2 format. So we create a dive site for every single fix.

After we merge those new dive sites into the existing dives we need to
throw away all the dive sites that weren't used.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 14:27:34 -08:00
Dirk Hohndel
be1b6c67c1 maintab change for get_dive_site_uuid_by_name
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13 14:27:34 -08:00
Dirk Hohndel
b2f0d21d43 Get location for Facebook from dive site
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 22:45:47 -08:00
Dirk Hohndel
253a137cc7 Get location from dive site for printing
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 22:45:47 -08:00
Dirk Hohndel
4e95beabc2 Remove coordinates from main tab
It seems to make sense to only have them on the dive site screen. For the
main UI they were redundant (we have the map) and not all that useful. The
only time people would want them is if they wanted to manually add GPS
coordinates for a dive, but that should now be done via the dive site UI.

There are a couple of FIXMEs in the code and a few code blocks that have
been commented out as they will be needed in one form or another once this
GPS handling is done on the dive site UI, which right now it is NOT.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 22:45:47 -08:00
Dirk Hohndel
616cb18b29 Make filters work with dive sites
This simply tracks the names - if we have multiple dives sites with the
same name but different other data (e.g. different GPS), we could easily
get this right (well, somewhat easily, it's a UI question), but for that
we'd have to filter for dive site uuid instead of for dive location name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 22:45:47 -08:00
Dirk Hohndel
32da12664d Switch components for cut/paste dive to dive site logic
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 21:11:51 -08:00
Dirk Hohndel
8bea7cbdc7 Show dive site name in dive list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 12:54:20 -08:00
Dirk Hohndel
0e6345f65b Correctly connect the maintab to dive site management
We now have a working uuid - use it. And populate the fields accordingly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-12 11:19:27 -08:00
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
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
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
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
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
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
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
Tomaz Canabrava
e44deed734 Fix a regression on selection caused by the new interface code
In the designer we set the selection type to extendedSelection
but since I removed the widget from the designer, I also had
to set it in the code.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 13:45:06 -08:00
Tomaz Canabrava
81ba72b219 Add a new button on the MainTab to handle management of geo locations
Just a button on the UI.
This moves the layouts around, in an attempt to make them less
obtuse.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 12:49:03 -08:00
Tomaz Canabrava
bb9398d08f Fix build without marble
If we have an null widget, we hide the stack.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 12:47:55 -08:00
Tomaz Canabrava
d53723fade Remove unused enums
Thuis is garbage from the old code.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:47 -08:00
Dirk Hohndel
3296089953 Change the order of the quadrants
At least to me it seems more natural to enumerate them row by row instead
of column by column, so now we do

1 2     instead of    1 3
3 4                   2 4

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:47 -08:00
Dirk Hohndel
ca154a65da Rename the widget to better reflect what it does
This widget defines what's in each quadrant of the main window.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:47 -08:00
Tomaz Canabrava
9b62d36757 Fix broken connection
The old way of creating the mainwindow made things a bit
dependent of the order of initialization, and we don't
assume that anymore.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
9b547e6c71 Remove the flicker issue and the resize issue.
The flicker was caused by removing all widgets (and thus setting
the size of the splitter to zero) and then re-adding them.
I've added four QStackedWdigets that have a consistent size and
the only thing I do now is to set the corresponding widget to visible
without removing / readding anything, and thus, not messing with
the sizes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
7b46a8fddf Don't set the state if it's the same
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
3912adfe5b Save the size of the widgets to restore it later.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
194dd8bd97 Finish the cleanup of mainwindow.ui
This is the last patch in the series of clearing up the
mainwindo.ui. Now to bugfixing.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
4867ee8ad8 Move the Profile out of the mainwindow.ui
And place it in mainwindow.cpp

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
6b038c2a9a Remove the ProfileWidget from mainwindow.ui
It is now in mainwindo.cpp

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
2992d78f83 Remove the PlannerWidget from mainwindow.ui
Now it uses the states on the mainwindow.cpp and it's finally
starting to be worth the hassle of reworking the UI.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
238c0573da Remove information panel from mainwindow.ui
Now it's created in the mainwindow.cpp as part of the new
way to configure the interface.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
c30aee1ae5 Remove the Globe from the mainwindow.ui
Now it's started from mainwindo.cpp and it's part of the
new states

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
cf4d55c470 Remove the DiveList from the mainwindow.ui
It's now set up from the mainwindow.cpp file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
c69aab04f4 Correctly set up the Planner state
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
57e938d040 Create the method that changes the state of the application
Not used yet. The idea is to call 'setApplicationState("plan");'
and all widgegts for plan will be magically setup because we
added the plan state with registerApplicationState.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
93198a8098 Change splitter names to something more meaningfull
listGlobe and infoProfileSplitters weren't good names as
now we will be able to create more types of widgets there

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
486226be18 Add the PlannerDetails class
This is the last of the current dialogs to be ported to the
new widgets system. now we need to clean the mainwindow of the
old code.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
5098e8672e Add a new file, plannerDetails.ui
This new file is the interface for the Details of the planned dive
removed from the mainwindow.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
727e397aa5 Add the modes for ADD and PLAN
The Plan mode still misses a widget that was done directly inside
the mainwindow. I'll extract it from there and create a proper
class in the next commit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
7d48c1fc26 Add the first call to registerApplicationState
This will be used to set the 'default' state. The other
two possible states right now are plan and add; those will
be created right next.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:44 -08:00
Tomaz Canabrava
9e3bff6b7c Simplify a bit of code
two #ifdef NO_PRINTING one over the other, merged them together.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:44 -08:00
Tomaz Canabrava
38aab70555 Implement the registerApplicationState function
This function registers the different widget layouts
that we will have in subsurface. Currently we have three layouts
(default, plan, add) and a few more are comming (for instance
location) and the code is scattered around. It was making me
unconfortable.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:44 -08:00
Tomaz Canabrava
aa56797b0b Add a new struct that will hold the widgets for each corner
The combination of the map / struct will change based on the
state of the application. Currently a lot of different
widgets change what is shown on the main window, and it's very
messy.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:44 -08:00
Dirk Hohndel
585d6a004b 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 06:31:37 -08:00
Grace Karanja
d60a620193 Add ability to undo deleted dives
Before the dive is deleted, a copy is made and passed to the
undo buffer. When edit->undo is clicked, this dive is restored
to the dive list.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-09 21:02:19 -08:00
Grace Karanja
8d1e4557a9 Add UndoCommand class
Add a class to handle all undo/redo events. Whenever a user
action affects a dive, an undo command will be created. A list of
these commands will be stored in the UndoBuffer, to allow for
moving forwards/backwards in the list.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-09 21:02:16 -08:00
Grace Karanja
c5138b2090 Add menu entries for undo/redo
Add an edit menu with undo and redo submenus, and connect them to
the UndoBuffer class. The submenus are only enabled when needed.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-09 21:02:13 -08:00
Grace Karanja
853dfa6673 Create UndoBuffer class
Add an empty UndoBuffer class. This will be built up on to
implement a working undo/redo mechanism.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-09 21:02:07 -08:00
Miika Turkia
0e26487208 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-07 08:56:27 -08:00
Miika Turkia
936fc2dae7 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-07 08:56:23 -08:00
Dirk Hohndel
bd994c1722 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-07 08:52:05 -08:00
Dirk Hohndel
d276f9cb08 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-07 08:51:54 -08:00
Grace Karanja
88fa627258 Delete dives using delete key
Allow users to delete dives using the delete key.

[Dirk Hohndel: small whitespace fix; removed an unnecessary
               include file]

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-06 07:22:50 -08:00
willem ferguson
802bf1d7c8 CCR gas composition and gas pressure labels on dive profile: revisited
This patch cleans up code for achieving the above with respect to
CCR dives. The code is simplified and shortened. The display of
gas lables on the profile is made consistent with the cylinder
pressure closest to the graph and the gas composition above/below
the cylinder pressure. The patch significantly improves the
maintainability of this code.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-05 07:31:52 -08:00
Tomaz Canabrava
cc9c24d46a Do not set default bg to white on the models
The user may have a different theme, as i did, and it
looked very wrong.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-03 15:14:09 -08:00
Tomaz Canabrava
3671c991e8 Don't allow the Cylinder option be edited in PLAN / ADD mode
This sets the combobox to disabled if the profile is in
any mode besides PROFILE.

Fixes #824

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-03 15:13:05 -08:00
Miika Turkia
4f9705f3f5 Fix crash when removing an out-of-profile divepoints
We can end up having a divepoint that is outside the dive profile. In
this case, we used to crash, but this hack prevents the index out of
range issue.

Fixes #784

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-03 11:27:41 -08:00
Miika Turkia
6f795a0059 Fix crash when moving divepoints rigorously
I have no idea how the index ends up outside the range, but at least
this prevents a crash in this case.

See #784

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-03 11:27:35 -08:00
Dirk Hohndel
d34965135a Disable dive component copy/paste shortcuts when no profile show
Instead of inventing another way to do this (and inevitably forgetting a
path where this should be re-enabled) I renamed the DcShortcup related
function and made them enable/disable the copy and paste shortcuts as
well.

Of course there now is one exception (isn't there always?): in "ADD" state
we don't want to be able to switch DCs, but we do want to be able to
paste.

Fixes #825

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-03 07:36:09 -08:00
Dirk Hohndel
baa4b4d7c5 Don't show the plot_info table in every debug build
Instead add a new define SHOW_PLOT_INFO_TABLE that triggers if this
debugging aid is shown.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-02 13:14:04 -08:00
Patrick Valsecchi
7e0ff8c1e4 Fixed CMakeLists.txt to work with Qt5
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-02 08:00:49 -08:00
Miika Turkia
414b9807e6 Do not go to edit mode if nothing changed
Fixes #804

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-02 07:06:56 -08:00
Miika Turkia
e1db5f21b1 Fix Ubuntu glitch with completer popup
On Ubuntu, the completer often prevents applying/discarding the changes
on the dive info pane and disrupts editing of other fields as well. This
patch prevents the completer popup from appearing when not in edit mode
(apply or discard is pressed) or when the string is still empty.

Fixes #818

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01 13:50:35 -08:00
Dirk Hohndel
62bc751bd9 Facebook integration: recognize when user didn't allow us to post
Why someone would log in but then not allow us to post I don't know... but
it seems useful to at least handle it...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01 10:52:28 -08:00
Dirk Hohndel
f30ff4fde7 Facebook integration: only set the URL once
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01 10:47:31 -08:00
Dirk Hohndel
1e4a13d3ba Clean up all the debug messages from Facebook integration
Even for a beta this was a bit too verbose for my liking.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01 07:24:48 -08:00
Dirk Hohndel
5343b909fa Get ready for Beta 3
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01 07:08:11 -08:00
Miika Turkia
2dc1a42b29 Fix crash if one selects incorrectly Seabear CSV
Fixes #814

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01 07:06:12 -08:00
Robert C. Helling
1e45858ee6 Update ceiling when changing dive mode
Without this patch, the user effectively cannot change the dive mode as
any change is overwritten by replot copying current_dive over
displayed_dive. The way out is not to call replot but only update the deco
ceiling directly.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 14:09:50 -08:00
Robert C. Helling
c70ba77199 Don't call replot when exiting cylinder combo box
Commit b72c32da7 turned off replotting while the cylinder
combo box was active to speed up editing. After leaving
the combo box, replotting was enabled again and a replot
was called.

This replot is too agressive, as it overwrites the displayed
dive with the current dive and thereby resets the cyinder
change. This eliminates the replot call.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 14:07:52 -08:00
Dirk Hohndel
eeb0c6a756 Don't store the Facebook credentials between multiple runs of Subsurface
They stay valid while Subsurface is running, but once you quit, the
credentials are gone.

This way no one can steal them from our settings.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 12:01:36 -08:00
Dirk Hohndel
646fa22c01 Correctly quote a double quote in the message
Otherwise the message on Facebook will end at the first double quote.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 10:57:15 -08:00
Dirk Hohndel
fd33d6aa3f Hide tooltip when posting a profile to Facebook
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 10:32:02 -08:00
Gehad elrobey
ad60ca84ee Export the XSLT based exports in a new thread.
The XSLT based exports can consume long time while applying the xml format.
This time can make the GUI unresponsive. Simply call the export functions
in a new Thread.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 10:15:12 -08:00
Miika Turkia
b01f14efab Fix maximum depth on CSV import
Commit d329420d55 changed the name of the
header from "Max depth" to "Max. depth", so we need to use that in the
code as well. (The dive profile is not drawn if we do not have max
depth.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 10:14:48 -08:00
Lubomir I. Ivanov
8eb25f6700 DiveMeanDepthItem: fix bad translated depth units
probably just a typo; taking the value of a (char *) will return
the first char (or byte).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-31 10:13:36 -08:00
Miika Turkia
bc6569f10f Include iPhone companion app to user survey
We should mention the iPhone companion app either alongside the Android
app or at its own line if more precise information is wanted. I suppose
this text change should be enough as we should get more precise
statistics of usage of these apps from the server logs.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 22:48:08 -08:00
Dirk Hohndel
39e68c795c Try to make the Facebook interaction be more pleasant
Show either the login screen or the disconnect button, plus some text that
explains what the user is expected to do.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 22:36:49 -08:00
Dirk Hohndel
13e2be5889 Use the 'popup' style Facebook login window
This fits much better in the preferences dialog.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 22:09:50 -08:00
Dirk Hohndel
cb6bda4e0c Compile Facebook support when building with Qt5
Now that Facebook approved our use of the API, we can build this by
default.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 22:08:50 -08:00
Dirk Hohndel
d8e5e1922f Minor whitespace change - this line was getting long
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 22:07:36 -08:00
Dirk Hohndel
86c25b7157 Fix update message popping up when there is no new version
I was just missing one key phrase to check for. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 17:23:59 -08:00
Gehad elrobey
f16f4e2f6e Don't go to edit mode if the dive notes field didn't change.
The maintab view should be consistent; some fields just go to edit mode
whenever they acquire focus and most of them wait till their values are
changed.

Change the dive notes field to be consistent with the other fields and
only enter edit mode if its value is changed.

[Dirk Hohndel: changed to use same_string()]

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 17:03:03 -08:00
Anton Lundin
e9558d848c Prevent crash on shutdown
We always call reply->deleteLater(), so we where actually calling delete
on a stale pointer, that caused subsurface to crash on shutdown.

Reported-by: Sergey Starosek <sergey-starosek@yandex.ru>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 07:16:12 -08:00
Dirk Hohndel
07e94c67e0 Make sure the index is valid
There are reports that the replace calls can cause the application to
crash. This doesn't seem to make sense, looking at the code - this change
shouldn't make any difference. But it makes it even more clear that there
shouldn't be any possible scenario in which we call replace with an index
that's out of range.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-29 15:26:24 -08:00
Dirk Hohndel
cd992bd14a Don't reimplement the clear() method
Much easier and clearer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-29 14:00:19 -08:00
Dirk Hohndel
4e40872fc0 Prevent potential access to uninitialized variable
If we have a dive with no data (e.g. from a failed import), we might never
assign a value otherwise.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-29 13:37:32 -08:00
Tomaz Canabrava
5649086d61 Make search and close shortcut for user manual work on Mac
When the help dialog appears, remove the shortcuts for filter and close from
the main window so that the identical keys for the help window work. This is
not necessary on other platforms, but on Mac it appears to be required.

[Dirk Hohndel: Tomaz had a slightly different approach of removing the actions,
               instead I changed this to just modify the shortcuts]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28 14:30:19 -08:00
Dirk Hohndel
eaec0bc842 Small changes to the mean depth text
Add a tiny bit of white space to the left and display the unit as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28 13:35:49 -08:00
Tomaz Canabrava
7f1373ea6d Implement the mean depth text
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28 13:35:43 -08:00
Tomaz Canabrava
343b82708e Remove dead code
We changed this MeanDepthLine to the MeanDepthCurve (or something),
no need to keep old code around.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28 12:29:47 -08:00
Tomaz Canabrava
ee4f9494f2 Hide ruler when in ADD or PLAN mode.
This ruler shouldn't appear in ADD or PLAN mode, it's a bug
and may crash things.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28 12:29:33 -08:00
Anton Lundin
991531d847 Let notes expand to full with fbsupport off
This hides the whole QWidget with the share-to-fb button in it. This
lets the Notes field expand to the full width.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-28 07:36:34 -08:00
willem ferguson
bc7d233365 User manual: Tying up loose ends
As the heading above says.
1) Place user manual option in main menu at the bottom of the Help submenu.
   It is more easily seen in that position.
2) Replace two images. I forgot one of the images that had been changed to F20 format.
3) A few small changes, including in the systematic description of the main menu.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27 22:58:38 -08:00
Dirk Hohndel
6a161b532e Fix UI issues and warning
Commit e219bc70f8 ("Refactor dctype -> divemode") introduced a few issues.
For one thing it causes a warning about incorrect use of zorder - I don't see
why this would be needed here, so I simply removed it.

Secondly, it adds a new, automatically named layout element that therefore gets
handled by our "consistent margin" code which creates a messy layout for the
Dive Notes tab. This patch gives that horizontal layout a useful name and adds
it to the list of "zero margin" layouts.  Signed-off-by: Dirk Hohndel
<dirk@hohndel.org>

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27 20:19:21 -08:00
Lubomir I. Ivanov
66fdb2b89d diveplotdatamodel.cpp: use space before sensor index
the manual uses "Sensor 1:", not sure if it breaks anything.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27 07:21:49 -08:00
Lubomir I. Ivanov
dee91a96aa divelogimportdialog.cpp: remove extra line at EOF
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27 07:21:27 -08:00
Lubomir I. Ivanov
96575b2366 divelogimportdialog.cpp: more capitalization of acronyms
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-27 07:21:17 -08:00
Miika Turkia
6edc458e83 Fix crash when no dives were selected for downloading
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 21:33:09 -08:00
Miika Turkia
d5d42982b8 Fix (un)selecting of downloaded dives
Last index was not included in the selecting or unselecting the
downloaded dives.

Fixes #819

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 21:33:05 -08:00
Anton Lundin
7825495620 Remove progress bar resets
The reset call hides the progress bar text, and that way it hides our
error messages we try to show with the progress bar.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 14:58:34 -08:00
Anton Lundin
277d090f55 Remove confusing leftover comment
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 14:58:23 -08:00
Tim Wootton
c38eaf68e9 Change mean depth/s to mean depth @ s
Mean depth/s sounds too much like a rate of change but this
referers to instantaneus mean depth at a time.

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 07:28:03 -08:00
Tim Wootton
04749d6863 Heartrate sounds better than heart beat
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 07:25:46 -08:00
Tim Wootton
d329420d55 Typos, punctuation and capitalisation.
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26 07:25:37 -08:00
Dirk Hohndel
73ffbdebe4 Changing the way we tell Linux users about new versions
We no longer encourage people to check with their OS vendor. We want them
to check our download page.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 22:19:05 -08:00
Dirk Hohndel
5336c4fe81 Improve user survey dialog with larger fonts
On HiDPI systems or for any users using larger than average fonts the
survey dialog looked terrible.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 13:40:18 -08:00
Dirk Hohndel
8b92f43715 Also don't show the beta response when auto-checking for updates
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 12:19:16 -08:00
Dirk Hohndel
44e7670f85 Better infrastructure for translating beta names
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 12:19:05 -08:00
Dirk Hohndel
0f967063c0 Add unique but random UUID to server queries
With this we can easily eliminate duplicates from our user statistics. The
UUID is completely random and there is no way to link it back to a
specific user. By deleting the settings a user can force a new UUID.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 12:02:13 -08:00
Anton Lundin
ed9a060d76 More descriptive variable in calls to get_dive_gas
In a previous patch, 37830bdb ("Always show deco gas as dive gas") the
semantic of the last variable was changed. This updates other calls to
this function.

This is nothing but documenting changes.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 09:56:37 -08:00
Dirk Hohndel
a8376bf437 Clean up the update checking logic
If update checking is allowed we want to do so but we want to be careful,
which messages we show - specifically we don't want to show "your version
is newer" unless it's a manual check.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 08:26:31 -08:00
Lubomir I. Ivanov
656d23fa93 Typos: capitalize TTS, CNS, NDL in diveloginportdialog.cpp
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:36:08 -08:00
Lubomir I. Ivanov
5c3d95770c Typos: fix capitalization after colon in preferences.ui
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:35:28 -08:00
Lubomir I. Ivanov
0ca87f3a02 Typos: use subscript for pO2 in divelogimportdialog.cpp
[Dirk Hohndel: also fixed the "detph" typo]

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:32:26 -08:00
Miika Turkia
6b3e361e90 Write depth unit for current dive not previous
The unit was stored to the variable after it was used, thus we need to
delay the print of the unit slightly. (In practice the depth unit for
first picture was null before this fix.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:18:35 -08:00
Miika Turkia
f70a83667b Fix segmentation fault on exporting picture depths
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:18:11 -08:00
Lubomir I. Ivanov
66c9559aef Typos: mid-sentence capitalization in usersurvey.cpp
some common nouns, even if the S in OS is capitalized but
that's when it's in acronym form.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:16:41 -08:00
Lubomir I. Ivanov
9e5c6a6c49 Typos: usermanual.cpp capitalization
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:14:52 -08:00
Lubomir I. Ivanov
04c55f4afe Typos: a couple of capitalization fixes in socialnetworks.cpp
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-25 07:14:27 -08:00
Miika Turkia
14f96fc4de Match ₂ to 2 and cylinder to cyl. on CSV import
This improves the column name matching so our own columns are properly
supported.

See #814

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:51:14 -08:00
Miika Turkia
fb367b22b0 Switch Subsurface CSV import to use tab separator
As changing the export to use tabs, we need to switch the import to do
that as well. However, we also need to support comma separation as older
exports use that.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:50:51 -08:00
Miika Turkia
b8d02b4b27 Block the signals properly
It seems that at least in this occasion, the signal blocking requires
the UI element to be given.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:50:36 -08:00
Miika Turkia
6fb0465654 Limit the row count properly when displaying CSV file
The import dialog now displays only a maximum of 10 lines of the CSV
file to be imported.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:50:02 -08:00
Miika Turkia
6bb1fee9a6 Enable importing of dive profile from CSV files
This assumes that we have either dive details or dive profile, not
combined log files. Before the change in the import UI, user selected
the import type by the tab on import dialog, now we make an educated
guess based on whether sample time field is available.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:49:28 -08:00
Miika Turkia
afae2af13f Fix the support of APD Log Viewer CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:49:04 -08:00
Miika Turkia
b29a1bfb7b CSV import, fix known import handling with tab separator
When we have the separator as tab, we need to use the proper tab
character instead of the string for known imports.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:48:45 -08:00
Dirk Hohndel
d9fd4cb69b Fix crash with empty dive list
Don't access current_dc unless there is a valid current_dive.

Fixes #817

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:42:25 -08:00
Dirk Hohndel
f912c05ea6 Make the beta show a nicer version in the about screen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 14:52:26 +12:00
willem ferguson
724a07b7e0 Avoid overprinting of cylinder presssure labels for CCR dives
This patch takes the cylinder pressures of CCR dives and prints them
in a non-overlapping way.

Remaining issue: When the dive profile is made taller by dragging the
window or the appropriate slider far down the screen, the labels move
further apart; similarly, when the profle is made flat/shallow by dragging
the window edge or appropriate slider up, the labels get close to each
other and start to overlap.

There are quite a few lines of additional code going into the patch. This
is primarily because separate provisions for when po2 > p(diluent) or vice
versa. In addition, I could not determine the size of the text characters
which would allow much more precise placement of text. This is because the
.scale member of the text is private and not available in the methods
involved in printing the labels. However, the height of the vertical scale
of the cylinder pressure graph can be determined [e.g. vAxis->maximum()].
This helped a lot to get the positioning of the text more or less correct.

While the results of the patch is not perfect, It contributes
significantly to make the profiles of Poseidon dives more readable.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 09:48:12 +12:00
Miika Turkia
b772beda71 Known import fix for XP5
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 07:09:29 +12:00
Miika Turkia
d501445bea Fix segm fault on known CSV imports
If the header line is not set up properly, the known imports assignments
will index out of the array.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 07:09:22 +12:00
Dirk Hohndel
c3614424f9 Correcly look at all relevant dive computer structures
When calculating maxima for a dive, we need to take data from all existing
dive computer structures plus potentially also a fake dive computer
structure that is just passed in in order to create a meaningful profile.

Commit 86c961614b ("Actually walk all dive computers, don't just claim
to do so") missed that second case and no longer took the fake_dc into
account, breaking the display of dives that don't have samples.

Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 07:07:02 +12:00
Dirk Hohndel
6aee901f6f Don't show previous dive computer text
There were situations when the last text was still shown. E.g. when the
current file was closed and then a new dive was imported from CSV.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-24 06:54:16 +12:00
willem ferguson
4487e13e15 Code cleanup: CCR setpoint and o2 sensor visualisation
This patch does some cleaning up of the code that provides visualisation
of CCR o2 sensor and o2 setpoint data. It reduces the number of
conditional evalauations that are required and it improves the readability
of these parts of the code.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-23 21:41:28 +12:00