Commit graph

153 commits

Author SHA1 Message Date
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
Dirk Hohndel
8d19a6ae16 Silence warnings in downloadfromdivecomputer.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
234a659498 Silence warnings in diveshareexportdialog.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
7eb787ee5d Remove unused member function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
83fb735a3e Silence warnings in divelistview.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
de572815bd Silence warnings in subsurfacewebservices.h
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
4e13322fa0 Clean up signedness confusion in statisticswidget.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Tomaz Canabrava
5bf0e48700 Remove unused variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:17:16 -08:00
Lubomir I. Ivanov
b275e604c1 templatelayout.cpp: fix potential issue in preprocessTemplate()
The function preprocessTemplate(), did not account well
for indexes in Grantlee variables, such as:
dive.weight# (where # is the index)
dive.cylinder#

To solve the issue the list (QList<QPair<QString, QString> >)
for variables to be replaced is populated will all possible
indexes:
0 - MAX_WEIGHTSYSTEM for weights
0 - MAX_CYLINDERS for cylinders

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29 15:42:33 -08:00
Lubomir I. Ivanov
0aa8ef918d templatelayout.cpp: add a HTML preprocessor stage
The current Grantlee template loading scheme does not
allow a preprocessing layer. With the recent DiveObjectHelper
changes the layer is required if we don't want to add a set
of dummy methods and Q_PROPERTIES which will only inflate
the DiveObjectHelper class.

Use the already present helper readTemplate() to load the
raw HTML template and pass it to a static function which
does some variable replacement to accomudate DiveObjectHelper.

This change is done for the sake of not breaking the Grantlee
HTML variables on the user side!

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29 07:32:57 -08:00
Miika Turkia
ae22b7cae0 Divelogs.de import: encode + character on password
Upload seems to work as is...

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-23 14:07:49 +01:00
Jan Mulder
ce373db951 Update copyright for 2016
Trival string update.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02 09:28:56 -08:00
Miika Turkia
d6af28cc90 Attempt to detect time format on CSV import
This attempts to detect the time format when initially importing a CSV
file. Well, only the minutes:seconds notation is detected currently.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31 11:22:47 -08:00
Miika Turkia
d9072cdefd Attempt to detect date format on CSV import
This tries to detect the date format when initially reading a CSV file
for importing.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31 11:21:04 -08:00
Dirk Hohndel
6a8768ee26 Fix build breakage
Introduced in commit 31462f150dff ("We already have a QNetworkAcessManager
global, use it").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 09:51:58 -08:00
Tomaz Canabrava
8b7427c56d Move CloudStorage out of the widgets
Cloud Storage is a non-gui based class, we currently use
two different approaches for cloud storage, one on the desktop
target and other on the mobile target, we should use only one.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 09:50:32 -08:00
Tomaz Canabrava
2c5fad73e8 Start to use the QSettings ObjectWrapper
start of the QSettinsg Object Wrapper usage on the code
this first patch removes two macros that generated around
200 lines in runtime for something like a quarter of it
Basically, whenever we changed anything we called the
PreferencesDialog::settingsChanged and connected everythign
to that signal, now each setting has it's own changed signal
and we can call it directly.

The best thing about this approach is that we don't trigger
repaints for things that are not directly profile related. (
actually we still do, but the plan is to remove them in due time)

this commit breaks correct atualization of the profile (because
everything was connected to PreferencesDialog::settingsChanged)
and now I need to hunt a bit for the correct connections

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25 13:04:01 -08:00
Anton Lundin
451293f1a0 configure OSTC/OSTC3: Add safety stop parameters
This adds the configure parameters for safety stops on the hwOS(OSTC3)
and OSTC computers.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22 06:50:22 -08:00
Anton Lundin
91a72f45d4 configure OSTC3: Add temperature sensor offset
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22 06:50:18 -08:00
krisalpha
b42dd941c1 Fix UI issue with location management
The index in the fixpopup function was incorrect which caused the user to
need TWO cursor down presses to move to the second element. I changed the
index value so the user now needs only one key press to traverse up/dowm.

Fixes #954

Signed-off-by: krishan Chopra <choprakrishan61@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19 13:06:38 -08:00
Miika Turkia
b9000208fe Hide the time from trip tab
This hides the start time when viewing trip details.

See #964

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 10:45:40 -08:00
Miika Turkia
394ddba013 Mark date field readonly on trip edit
The date comes from the first dive in trip, thus no need to allow
editing (especially since the edited date seems to be discarded in any
case).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 10:45:29 -08:00
krisalpha
7e9648c5cb Be more precise in our language: call it "mean depth"
As pointed by jwhferguson, I changed "show average depth" to "show
mean depth".

I modified file preferences_graph.ui and changed the text. This bug was
reported on fedora 22. i use ubuntu.layout and justification is nicely
displayed.

The patch also removes a no longer necessary include.

See #922

Signed-off-by: krisalpha <choprakrishan61@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-12 10:35:28 -08:00
Tomaz Canabrava
04d4da50c4 Fix memory leak on the printing system
We forgot to delete the Grantlee object before creating a new one

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08 10:03:12 -08:00
Tomaz Canabrava
f07a9fa09f Simplify Finding the Templates
We don't need a list of QFileInfo if we are not using it
much better to have a list of the files directly

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08 10:03:06 -08:00