Commit graph

277 commits

Author SHA1 Message Date
Tomaz Canabrava
37e3e7e69a Deco mode for plannining is not deco mode for showing
We had (in the wrong place, imo) a new feature that
should differentiate the different deco_modes, you could
plan your dive in buelhman and see it in vpm-b, for instance
but both of them accessed the same pref.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:41:17 -07:00
Tomaz Canabrava
c110b4a238 More preference handling fixes
Remove a few uneeded lines and add more loading code for
the preferences.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:40:43 -07:00
Tomaz Canabrava
f33f2812cf Use default values if value doesn't exist
By using the default value argument we can reduce
this code size to a half.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:39:58 -07:00
Tomaz Canabrava
df2dfa4706 Fix bug where the Font setting was ignored
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:37:52 -07:00
Willem Ferguson
d3e775e690 Updates to Preferences -> Graph
This reorganises the Preferences->Graph tab.
All leading spaces have been removed for labels and text fields.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:35:24 -07:00
Willem Ferguson
22c6568b46 Reorganise Preferences/Graph tab
1) Reorganise existing items in Graph tab so that all gass pressure
items are together and all profile-related items are together.
2) Provide units (mostly bar) for all settings having units.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01 09:34:47 -07:00
Robert C. Helling
c47c3555f6 Warn user about wrong characters in date/time format strings
fixes #1098

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-28 07:30:22 -07:00
Rick Walsh
3566ebd544 Preferences ui: at tabstops to graph ui
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-27 20:36:25 -07:00
Rick Walsh
46f3b0f238 Planner: connect emitDataChanged slot to ascent/descent rate editingFinished
Call the emitDataChanged slot when ascent and descent rate spinboxes lose
focus.  Without this connection, rates are not updated immediately after
editing the value with keyboard numbers and hitting tab or enter.

It is necessary to keep the valueChanged(int) connections, because
editingFinished() is not triggered by changing the value with the arrows.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-27 20:36:02 -07:00
Robert C. Helling
02389c95cb Add country information to TeX export
This is a bit ugly since it does a regexp match on
divesite.notes but what can I do...

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-20 21:19:17 -07:00
Martin Gysel
0ea0272806 TeX export: check site pointer, before accessing it
Print empty string rather than 'null'

Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-20 21:18:59 -07:00
Robert C. Helling
9b8a04089d Export to TeX file initialized
This does the basic export as a TeX file including a template.

It still lacks proper location parsing.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-11 22:00:08 -07:00
Robert C. Helling
0d20344c90 Add preference to change deco model
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-11 21:58:41 -07:00
Miika Turkia
abc42cc78d Read all files on TXT import
We need to read the file given as parameter, not the first in list.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-03 07:59:16 -07:00
Robert C. Helling
e388b5ab94 Add icon for heat-map
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-27 21:32:50 -07:00
Dirk Hohndel
f76f3775bb Print out Beta version numbers on About screen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24 08:45:47 -07:00
Rick Walsh
7e09a6c7bc Separate VPM-B conservatism preference for planner and profile
Separate the VPM-B conservatism preference into diveplan.vpmb_conservatism for
planning dives and prefs.vpmb_conservatism for profile ceiling display of
saved dives.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24 08:30:11 -07:00
Rick Walsh
7b891904e7 Rename conservatism_level to vpmb_conservatism
Make the variable purpose less ambiguous

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24 08:29:56 -07:00
Miika Turkia
2b14a9c95d Support for comma as field separator for ADP
This adds support for comma as field separator for ADP import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24 08:29:34 -07:00
Dirk Hohndel
131c5a2abe Fix building of Facebook support
No idea when this got broken. Fix seems like a hack as that variable
should get set in the plugin CMakeLists.txt. But it seems to work, so
"whatever".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-22 17:12:00 -07:00
Dirk Hohndel
b972bdb97d Language preference: store the locale name in the settings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-20 12:48:30 -07:00
Dirk Hohndel
67a226c00a Language preference: search for the locale instead of the language string
And make sure that you use the language / country delimiter that we use in the
file system

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-20 12:48:30 -07:00
Anton Lundin
f9cd09b000 Workaround abuse of the now missing DC_TRANSPORT_BLUETOOTH
The DC_TRANSPORT_BLUETOOTH is quite abused here, and I removed it in our
custom serial code. This works around the issue so subsurface still
compiles.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-18 07:11:34 -07:00
Rick Walsh
6f43c16ea9 Preferences UI: graph tabstop order should match display order
When 'tabbing' through data fields, the order should be the same as the order
displayed on the screen. Getting the order right in the .ui file fixes the
tabstop order without needing to define it explicitly.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17 13:38:12 -07:00
Tomaz Canabrava
0a6f6b4382 Settings update: Fix missing groups and Language initialization
There's one function named uiLanguage() that should return
the current uiLanguage() that subsurface is running, but
it actually sets a whole lot of preferences, I think
that the general idea of that function is okay, but it seems
broken for me.

still, I used it to load the correct language from the preferences
since it's what this function is currently doing right now.

Also, a lot of missing groups where added.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 22:37:15 -07:00
Dirk Hohndel
1bf76dd3db Settings update: Fix broken UpdateManger logic
In commit b76c1846bb ("Settings update: Simplify Update Manager")
the logic for when to show the UpdateManger question to the user got
broken. Unintuitively, a boolean setting actually has three possible
values. True, False, and Unset. This patch fixes things to work as
designed again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 12:29:08 -07:00
Tomaz Canabrava
9b2404fcb4 Settings update: Move loadPreferences out of qt-helper.cpp
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
8f178301d8 Settings update: Use the Settings to store the plannersettings
Instead of settings things manually in the code. (btw,
if we use lambdas the code can be quite smaller)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
ad7524fda1 Organize the connect calls per object.
Just to make it easy on the eyes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
f8f87b7294 Settings update: Move preferences sync / initialization
Move Preferences sync / initialization out of the planner
widget prerferences to the ObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
12eccda523 Settings update: Fix Facebook Widget to use the SettingsObjectWrapper
Fix facebook widget to use the SettingsObjectWrapper instead
of figthing our complementary Settings each call.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
83236f7e9e Settings update: Some code cleanup
The only block of code that I removed here is because the
QSettings preferences that is being read is the exact one
that we populate on the prefs.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
a1b22797ca Settings update: Remove uneeded includes
and comment out questionable code.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
db8e8957ab Settings update: Add "Dive Computer" settings to SettingsObjectWrapper
For some reason, the dive computer settings weren't in the
settings prefs. This moves it, makes the boilerplate on Settings
ObjectWrapper and make things compile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:44 -07:00
Tomaz Canabrava
b76c1846bb Settings update: Simplify Update Manager
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:44 -07:00
Tomaz Canabrava
4f2057cd30 Settings update: Fix "Units"
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
b5e98ec993 Settings update: Fix "Network" and "CloudStorage"
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
81d5d82b7b Settings update: Clean up save user id local
So, prefs.save_userid_local is being set outside of
a preferences set (it's set to true and false while
loading the files via xml or git) and because of that
I had to bypass a few method calls.

When something triggers a preferences change, the
application will be notified that the preferences
changed, thing that I couldn't do while reading the
xml or git because that should be local-only.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
048379cc2b Settings update: Fix "Language" settings
Save the language settings using the SettingsObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
bc95138f96 Settings update: Use internal prefs structure to read preferences
Don't use a QSettings to read properties, it's really
easy to mispell something. Just use the internal prefs structure.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
906d62ac7a Settings update: Fix settings in PreferencesGraph class
Use the SettingsObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:36 -07:00
Tomaz Canabrava
93c19b18a7 Settings update: Fix "geocoding"
Use the SettingsObjectWrapper to access "geocoding"

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:46:38 -07:00
Tomaz Canabrava
8f05afcda3 Settings update: Fix "General Settings", "Display", and "Animation"
First commit in the series that will unify the way to use,
save, and update settings in the core. This fixes the usage of
"General Settings", "Display", and "Animation" to use the
SettingsObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:46:32 -07:00
Robert C. Helling
2c715542fd Unify handling of QDateTime time zone information
Subsurface uses "local time" which in particular means we never
display time zone information to the user. The user (and our file
format) only sees times like 5pm or 17:00. A better name than
local time (which could mean "local at the dive spot) would
be "watch time", the time displayed by the diver's watch when
she entered the water.

Internally, we store times as time_t, seconds since Jan 1 1970 0:00
UTC. Our convention for conversion between 5pm and time_t as always
been to treat 5pm as if it were UTC.

Then confusion arose since Qt's QDateTime (which is tied to UI elements
like QTimeEdit and similar) is time zone aware and by default assumes
the system time zone. So when we set a QDateTime to 5pm and then later
convert it to time_t we have to take care about the difference between
UTC and the system time zone.

This patch unifies our solution to this problem: With it, we set all
QDateTime's time zone to UTC. This means we don't have to correct for
a time zone anymore when converting to time_t (note, however, the
signedness issue: Qt's idea of time_t is broken since it assumes it
to be unsigned thus not allowing for dates before 1970. Better use the
millisecont variants).

We only need to be careful about time zones when using the current time.
With this convention, when assigning the current time to a QDateTime, we
need to shift for the time zone since its value in UTC should actually be
the watch time of the user who is most likely used to the system time zone.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-10 15:04:39 -07:00
Dirk Hohndel
430f5b77c5 Add menu entry to remove the offline state
If an attempt to contact the cloud storage fails, Subsurface switches into
offline mode. This allows us to go back online again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-30 13:29:06 -07:00
Miika Turkia
e80b03699d Shrink the minimum size for preferences window
Let's have the preferences window as small as possible with the current
data in it. This should allow people with vertical resolution of 600 to
use the preferences window.

Fixes #1083

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-28 04:54:51 -07:00
Miika Turkia
49cbb8308e Shrink the size of export dialog
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-28 04:54:10 -07:00
Dirk Hohndel
8f4e649c68 If cloud storage is offline, show that in title bar
Not sure if "local cache" is the best text, but it's accurate.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-17 12:27:01 +09:00
Rick Walsh
bb31517951 Planner: update cylinder mixes and MND and MOD when prefs are changed
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09 12:08:48 -07:00
Rick Walsh
9fbd11744f Add function to calculate gas maximum narcotic depth
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09 12:08:06 -07:00
Rick Walsh
1ba61d7ad5 Update gas deco MOD when deco pO2 is changed
This fix is reasonably straightforward when the divedatapoint structure stores
the cylinder rather than gasmix.

Fixes #970

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09 12:08:01 -07:00
Rick Walsh
b1ed04a7f4 Have divedatapoint store cylinder id instead of gasmix
Determining the correct cylinder index from a known gas mix can be
complicated, but it is trivial to look up the gasmix from the cylinder_t
structure.

It makes sense to remember which cylinder is being used. This simplifies
handling changing a cylinder's gas mix, either directly by the user, or
indirectly in the planner. It also permits tracking of multiple cylinders of
the same mix, e.g. independent twins / sidemount.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09 12:07:25 -07:00
Robert C. Helling
783844eb3d Set date and time when replanning a dive
Otherwise we pretend the dive is now.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13 22:17:49 -07:00
Linus Torvalds
710d47a2da Make sure dive computer model is proper malloc'ed allocation
Reported-and-tested-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-11 10:29:31 -07:00
Rick Walsh
1e607ae98d fixup: Don't confuse EAD and END
The previous patch (Planner: add best mix EAD preference) used the term EAD
(equivalent air depth) in variable names and strings, when it should have been
END (equivalent narcotic depth).
They're not the same thing and shouldn't be confused.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 07:03:55 -07:00
Rick Walsh
9b29173363 Planner: add best mix EAD preference
Add best mix EAD preference and UI, along with a tooltip describing what it
does

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 07:03:38 -07:00
Miika Turkia
30976c05a4 Parse txt formatted log files
This parses .txt log files produced by Dataplus and Oceanlog software.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:28:07 -07:00
Miika Turkia
98741c864c Use encoded file name on import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:28:00 -07:00
Miika Turkia
74065ad8aa Allow parsing of .txt files on import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:27:31 -07:00
Miika Turkia
1902d527d5 Parse date and time from on APD import
This will parse the date and time information on CSV import if the file
name matches the one used by APD log viewer (date and time are available
in the file name). Hard coding the year to 20?? is a bit unfortunate,
but as there is only 2 digits in the year, we have to invent something.
And it would be quite optimistic to assume this will bite us back any
time soon :D

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-03 09:50:32 -07:00
Miika Turkia
304af311f0 CSV import: import dive number if defined
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:25:10 -07:00
Miika Turkia
7ec83ef02a CSV import: import time field if available
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:25:07 -07:00
Miika Turkia
a83c674139 CSV import: support for user specified date format
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:25:03 -07:00
Miika Turkia
a480d28afd CSV import: use date field on profile import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:24:52 -07:00
Linus Torvalds
56ed3f1c61 Fix Qt date interfaces for times before 1970
This seems to work around the crazy QDateTime::fromTime_t() problem in Qt.

It is *very* lightly tested. In fact, the only test is that "test0.xml"
change that is part of this patch.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-29 09:07:41 -07:00
Miika Turkia
d3867a09f3 DL7: parse temperature and cylinder pressure
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:17:52 -07:00
Miika Turkia
24edaf4be1 Parse date and time in DL7 import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:16:32 -07:00
Miika Turkia
1fec953a13 Special handling for DL7
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:45 -07:00
Miika Turkia
e31df43cde Detect DL7 depth units
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:34 -07:00
Miika Turkia
74f0192711 Basic GUI part for DL7 import
This sets the basic properties properly but is still missing the parsing
of meta-data, especially used units.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:25 -07:00
Miika Turkia
8a4f2f998a Fix file extension regesp
The original negative lookahead failed in case the file name contains
more than 1 dot as it looks for dot that is not followed by the given
extensions. And such a match exists in the file name. The new version
should look properly if the file ends with any of the given extensions.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:11 -07:00
Miika Turkia
4955f858bf Add CSV parsing trigger for zxu and zxl files
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:01 -07:00
Miika Turkia
46074ebf21 Add DAN DL7 file extensions for import UI
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:07:53 -07:00
Miika Turkia
375f698c78 Detect pipe as field separator in CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:07:34 -07:00
Linus Torvalds
effad4b2c8 Fix seabear import sample overrun bug
The Seabear import fixed up the NDL and TTS in the samples from minutes
(in the import) to seconds (our internal format for all time).  But it
did it with a loop that overran the end of the samples array by one:

	for(int s_nr = 0 ; s_nr <= dive->dc.samples ; s_nr++) {

Fix it to use the proper "<" instead of "<=".

Reported-by: Stuart Vernon <stuartv@force2.net>
Tested-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-11 12:23:05 -07:00
Dirk Hohndel
6725d54db2 Desktop UI: make sure that git progress is actually shown
This updates the got progress indicator to the changed interface where we don't
pass in an explicit percentage.

It also finally fixes an old problem: If we don't allow the Qt main loop to
process the events, we'll never see a decent progress indicator...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05 23:43:17 -07:00
Tomaz Canabrava
21e8b1e363 Fix compilation with the new folder architecture
A few more fixes for things that broke in commit 7be962bfc2 ("Move
subsurface-core to core and qt-mobile to mobile-widgets").

[Dirk Hohndel: slightly edited and overlap with Linus' patch removed]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05 12:32:36 -07:00
Linus Torvalds
ad2ac58ea2 Fix include paths
As expected, commit 7be962bfc2 ("Move subsurface-core to core and qt-mobile
to mobile-widgets") caused some breakage.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05 09:40:58 -07:00
Linus Torvalds
e0824ef9f3 Make gas change events always have a cylinder index
In commit df4e26c875 ("Start sanitizing gaschange event information")
back about a year and a half ago, I started sanitizing the gas switch
event data, allowing gas switches to be associated with a particular
cylinder index rather than just the gas mix that is switched to.

But that initial step only _allowed_ a gas switch event to be associated
with a particular cylinder, the primary model was still to just specify
the mix.

This finally takes the next step, and *always* associates a gas switch
event with a particular cylinder.  Instead of then looking up the
cylinder by trying to match gas mixes at runtime, subsurface now looks
it up when loading the dive initially as part of the dive fixup code.

The switch event still has an a separate gas mix associated with it, but
this patch also starts preparing for entirely relying on the gas mix in
the cylinder itself, by starting to pass in not just the event but also
the dive pointer to the routines that look up gas mix details.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 22:37:18 -07:00
Dirk Hohndel
7be962bfc2 Move subsurface-core to core and qt-mobile to mobile-widgets
Having subsurface-core as a directory name really messes with
autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an
autocomplete conflict and also was inconsistent with the desktop-widget
name for the directory containing the "other" UI.

And while cleaning up the resulting change in the path name for include
files, I decided to clean up those even more to make them consistent
overall.

This could have been handled in more commits, but since this requires a
make clean before the build, it seemed more sensible to do it all in one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 22:33:58 -07:00
Linus Torvalds
2d760a7bff Don't write back dive data that hasn't changed in git
This caches the git ID for the dive on load, and avoids building the
dive directory and hashing it on save as long as nothing has invalidated
the git ID cache.

That should make it much faster to write back data to the git
repository, since the dive tree structure and the divecomputer blobs in
particular are the bulk of it (due to all the sample data).  It's not
actually the git operations that are all that expensive, it's literally
generating the big blob with all the snprintf() calls for the data.

The git save used to be a fairly expensive with large data sets,
especially noticeable on mobile with much weaker CPU's.  This should
speed things up by at least a factor of two.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 17:27:10 -07:00
Dirk Hohndel
eea1ff6a83 Change the git progress update callback signature
This way we can include additional text. This will be used in later
patches.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 14:17:45 -07:00
Werner Macho
23ea947b5a typo fix
small typo fix for GUI

Signed-off-by: Werner Macho <werner.macho@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 12:16:56 -07:00
Robert C. Helling
e93c99c8bc When changing units from psi to bar first change value, then max
otherwise the max interferes with the value. Furthermore this increases
the max values a bit.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 09:34:49 -07:00
Dirk Hohndel
abb3b03511 Don't start Add or Plan while accessing cloud storage
This avoids a race condition where we get confused about our internal
state.

Fixes #1031

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 17:41:15 -07:00
Robert C. Helling
48007ebc30 Make the reserve gas units aware
In the planner, for recreational mode, there is a setting indicating
the pressure at which the diver should be back at the surface. This
pressure was hardcoded to bar.

Fixes #1027

[Dirk Hohndel: small modifications, more reasonable step for psi,
               more reasonable maxima]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 16:16:38 -07:00
Anton Lundin
77e1c2afa9 configure OSTC/OSTC3: Bugfix depth parameter unit
The unit for the depth parameters ain't meters, its 0.1 meters. This
caused the values stored to be out of range.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 08:46:40 -07:00
Dirk Hohndel
47ba8b38d4 Preferences: fix missing slot problem when creating new account
This is still a left over from the damage done when creating the
preferences objectification.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-19 07:52:33 -07:00
Dirk Hohndel
44d715759c Silence warnings in facebook_integration.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:37 -08:00
Dirk Hohndel
09532d0463 Silence warnings in printdialog.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:37 -08:00
Dirk Hohndel
54757fb694 Silence warnings in locationinformation.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:37 -08:00
Dirk Hohndel
eb09b79dc5 Silence warnings in configuredivecomputerdialog.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:36 -08:00
Dirk Hohndel
ac7540b164 Silence warnings in divelogexportdialog.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:36 -08:00
Dirk Hohndel
60ee897b29 Remove unused member function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:36 -08:00
Dirk Hohndel
b8fbf72182 Silence warnings in divelogimportdialog.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:34 -08:00
Dirk Hohndel
b4bb1321bf Silence warnings in subsurfacewebservices.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:27 -08:00
Dirk Hohndel
b973d988dc Silence warnings in starwidget.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:27 -08:00
Dirk Hohndel
a670181ed2 Silence warnings in simplewidgets.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:27 -08:00
Dirk Hohndel
ee7b9dcd09 Silence warnings in modeldelegates.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
071e6dbd6f Silence warnings in mainwindow.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00