Commit graph

2597 commits

Author SHA1 Message Date
Anton Lundin
fce83b953d Fix column order for OSTC3 diluent table
The fist column is the O2% value, and was handled like that in the data.
It was only the column header that was wrong.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:11:16 +02:00
Anton Lundin
882986dfdf Save columnwith of Ostc3 settings tables
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:09:15 +02:00
Anton Lundin
5a394aaff6 Make ConfigureDiveComputerDialog ui a class member
Almost all of our other classes have the ui class as a class member in
the controller code. This switches ConfigureDiveComputerDialog to that
model.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:08:18 +02:00
Anton Lundin
3785c76657 Enable/Disable Update Firmware button based on dc
Disable the Update Firmware button if you choose a device that we don't
support update firmware for.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:07:00 +02:00
Anton Lundin
40bc4b629a Don't allow writing before we got data
Don't allow creation of backup files or writes to the computer before we
know we got some data, either from a backup file or from the actual
device.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:06:34 +02:00
Anton Lundin
51ef56fbcb Set limits for Saturation/Desaturation on OSTC3
The default max value for a QSpinBox is 99. The default Saturation
factor for the OSTC3 is 110%. This code sets the max, min and default
values on those spinboxes.
The values comes from me reading the assembler code for the OSTC3.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:03:17 +02:00
Giuseppe Bilotta
3d11904f59 Remove double include
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-15 22:53:10 +02:00
Anton Lundin
0b85f59e87 255% as limit for Saturation/Desaturation on OSTC3
The default max value for a QSpinBox is 99. The default Saturation
factor for the OSTC3 is 110%. This code raises the max values to 255
which is as far as i've read the ostc3_interface.odt the max value.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-15 14:51:21 +02:00
Salvo 'LtWorf' Tomaselli
4cdb80c4cd Export to DiveShare
Adds the possibility of exporting dives to DiveShare.

Signed-off-by: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14 20:33:46 +02:00
Dirk Hohndel
64d1ccc550 Setup defaults for some of the OSTC3 settings
This is still missing lots of values which are now set to 0 with rather
unfortunate consequences (for example, setting Saturation and Desaturation
to 0 turns off the NDL / Deco calculations). So this code right now is
quite broken.

But at least this fixes the reported crash and gets some valid data
initialized.

Fixes #744

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14 20:32:15 +02:00
Anton Lundin
3b30009d7a Remove unused variables
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:34:40 -04:00
Anton Lundin
9c0e2fc823 Connect the Suunto Vyper Configuration ui
This code connects up the configuration ui with the backing
data structures thats gets read/written to/from the devices.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:32:21 -04:00
Anton Lundin
3836e64092 This adds a ui for Suunto Vyper settings
This builds up a ui to use for all the settings for the Suunto Vyper
family devices. Some of the fields are pure information, eg, max depth
and number of dives, so they are marked read-only.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:32:12 -04:00
Linus Torvalds
df4e26c875 Start sanitizing gaschange event information
Decode the gasmix data into a sane format when creating the event, and
add the (currently unused) ability to specify a gas change to a
particular cylinder rather than (or in addition to) the gasmix.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 07:45:37 -04:00
Linus Torvalds
a7e1e7fee1 Pass the whole 'device_data_t' to the uemis downloader
Not only does it make it look more like the libdivecomputer downloaders,
but the uemis downloader needs it in order to support all the flags we
have.  Notably "download into private trip".

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 07:34:46 -04:00
Robert C. Helling
2282035a4d Add export for depths of images taken
This adds an option to the export dialog to write an ascii file containing
filenames of image files a tab and the depth at the time of the image
taken.

[Dirk Hohndel: whitespace cleanup]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-10 08:03:45 -04:00
Anton Lundin
f3484d1148 Actually set the setpoints to the OSTC3
The setpoints filled in into the ui where never set on the devicedetails
object so they where never propagated to backup or write settings.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-10 02:43:42 -04:00
Joakim Bygdell
00c3b8dbaa Untangle the graphs at the bottom of the profile.
When multiple graphs are displayed at the same time they end up being printed on top of each other.
Scale the lowest graph to accommodate the tankbar.
Add an intermediate scaling step to the depth axis when pp graphs or the tissue graph are visible.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-10 02:41:26 -04:00
Tomaz Canabrava
e0b60167f2 Add possibility to filter by more than one criteria at a time
This new version of the TagFilterSortModel actually accepts
*any* new MultiFilterInterface.

So, how to use it to create a new filter:

Implement a class that inherits from MultiFilterInterface

Implement the filterRow method

TagFilterSortModel::instance->add( myClass );

and you are done.

[Dirk Hohndel: removed some debug code and did whitespace cleanup]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-02 07:35:23 -07:00
Tomaz Canabrava
84fdbefb58 Fix typo that broke settings.
A small typo broke the disabling of the graphs for the
newly added curves. ( btw, we need a designer to display
the graphs in a better way, just too much information. )

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-20 18:36:08 -07:00
Tomaz Canabrava
2b760bdd39 Fix crash when moving the mouse over the profile when no dive is shown
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-20 18:35:08 -07:00
Tomaz Canabrava
a2f2751792 Show everything when nothing is checked.
This patch fixes a bit of the logic used. Now we show every
dive if nothing is chedked.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-20 18:35:02 -07:00
Robert C. Helling
15a99f8789 Add tissue saturation plot to tooltip
This adds a graphical representation of tissue loadings at the current moment during the dive
to the tooltip box. The layout is inspired by the Sherwater Petrel.Add tissue saturation plot to tooltip

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-19 21:48:05 -07:00
Robert C. Helling
3fc9c1e005 Tissue saturation plot a la Sherwater Pretel
This adds a toolbox icon to turn on a tissue plot inspired by the bar
graph of the Sherwater Petrel,

It shows the inert gas partial pressures for individual compartments. If
they are below the ambient pressure (grey line) they are shown in units of
the ambient pressure, if they are above, the excess is shown as a
percentage of the allowed overpressure for plain Buehlmann. So it has the
same units as a gradient factor. Thus also the a gradient factor line (for
the current depth) is shown.

The different tissues get different colors, greener for the faster ones and bluer
for the slower ones.

Positioning and on/off icon action still need some tender loving care.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-19 21:46:30 -07:00
Anton Lundin
50adde828c Switch some columns to right alignment in divelist
Some columns in the dive list makes more sense to have right aligned
than left aligned. This switches the numeric columns to right alignment
so they is more easily compared visually.

But, we keep the NR-column left-aligned because we use its left
indentation as dive-in-a-trip marker.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:42:18 -07:00
Dirk Hohndel
37871e5f7d Slight change to info tab layout
This keeps max depth and average depth next to each other and instead
moves air pressure up one row.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:38:03 -07:00
Tim Wootton
42c9699870 Futher capitalisation standardisation
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:24:53 -07:00
Salvo Tomaselli
bff471f98d Typos
This fixes two typos found by lintian.
I guess a bunch of translations will need to be updated or something, I am not
sure how they work so I didn't touch them. I presume in the worst case they
will need to be re-translated at the next iteration

--
Salvo Tomaselli

"Io non mi sento obbligato a credere che lo stesso Dio che ci ha dotato di
senso, ragione ed intelletto intendesse che noi ne facessimo a meno."
                -- Galileo Galilei

http://ltworf.github.io/ltworf/
From a0e5f48349557fcccd82ba8c7555043de140835c Mon Sep 17 00:00:00 2001
From: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Signed-off-by: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Date: Fri, 12 Sep 2014 18:25:20 +0200
Subject: [PATCH] Fix typos reported by lintian

Fixes two typos reported by lintian.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:24:05 -07:00
Robert C. Helling
d6abb739d9 Helper function for partial pressure calculation
This patch introduces a new structure holding partial pressures (doubles in bar) for
all three gases and a helper function to compute them from gasmix (which holds fractions)
and ambient pressure. Currentlty this works for OC and CCR, to be extended later to PSCR.

Currently the dive_comp_type argument is unused.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:20:25 -07:00
Gaetan Bisson
ae6b0468b1 Report CNS in dive info tab
This adds a maxcnsText widget under infoTab and populates it.

Note that I manually edited maintab.ui to display CNS and OTU
next to each other and right after gas data.

Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:16:44 -07:00
Dirk Hohndel
434e7a6a71 Fix crash at startup
Not sure this is the right fix, but at least it doesn't crash any more.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:48:57 -07:00
Dirk Hohndel
0d1da0563b Random whitespace update
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:39:49 -07:00
Tomaz Canabrava
d6d82a5af8 Unused signature removed.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:32:22 -07:00
Tomaz Canabrava
db6126bc52 Show everything by default.
We should show all dives by default.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:32:15 -07:00
Tomaz Canabrava
06ebd0ea5e Better filtering of dives with no tags.
New rules for them, a new item on the model with the text
"Empty Tags" should be marked if the user wants it to be
displayed.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:32:05 -07:00
Tomaz Canabrava
bef8dc6f4b Implement trip-filtering.
Trips will be filtered if it doesn't find any tags for
dives.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:28:49 -07:00
Tomaz Canabrava
f1e7c12e8a Correctly filter dives. (trips are always shown)
This patch correctly filter dives based on tags, but it will
also keep showing all the empty trips.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:28:37 -07:00
Tomaz Canabrava
4e3689370d Create the sorting method.
This method should remove a row on the dive list model
visualization if none of the tags that it have are marked
as 'visible'.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:28:21 -07:00
Tomaz Canabrava
a6e9a1eab5 Implement the TagFilter model.
This model accepts check / unchedk. Now, I need to also
plug the result of the check / uncheck to the list model.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:28:04 -07:00
Tomaz Canabrava
7a90b9d764 Trigger the log->filter by tag to open the tag filter.
You can't really close it for now.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:27:50 -07:00
Tomaz Canabrava
abc5d5864c Add the Tag Widget on the MainWindow
Place the TagWidget on the correct place on the main  window.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:27:33 -07:00
Tomaz Canabrava
815f9d204f Remove unused method signature.
This was declared on a class definition, but never implemented.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:27:26 -07:00
Tomaz Canabrava
a59ac2199b Add skeleton to the Tag Filtering.
Just the ui file and a empty class to start playing with it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:27:21 -07:00
Tim Wootton
182343031b Use US spelling of colo(u)r in Config DC dialog
Application's default lang is US english, translation to
UK spelling should be done in transifex.

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-11 08:31:53 -07:00
Tim Wootton
78ba24b84c Makes new DC config dialog follow existing UI txt style
Sets text strings to follow the style of existing UI components in use of
capitalisation and use of :

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-11 08:31:35 -07:00
Dirk Hohndel
2be6165086 Undo unintentional string changes
Previous commits undid these by mistake

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-11 08:31:00 -07:00
Florian Klink
59038a2554 Fix typos
Reported-by: Davide DB <dbdavide@gmail.com>
Signed-off-by: Florian Klink <flokli@flokli.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-11 08:28:06 -07:00
Joseph W. Joshua
bf82810a30 Redesign Dive Computer configuration dialog
The dive computer configuration dialog was a bit cluttered. This
change adds a tabbed interface separating the basic settings from
the gas, dilutent and set point settings

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-02 11:33:55 -07:00
Dirk Hohndel
e6ce9a4df1 Revert hacks now that we use Qt5 on Mac
Commits a24eb8ac12 and 0b0860d24a introduced a nasty hack that was
needed back then to make tank and weight selection work on the Mac. But it
caused other unpleasant issues (as mentioned in the commit messages).

I re-tested this with the current Qt5.3 based builds on Mac and this hack
is no longer needed.

Fixes #638

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-29 09:53:57 -07:00
Gehad elrobey
3925aed5ea HTML: Changing the files extensions to js
These are actually javascript files containing js objects and not json
files.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-28 07:43:18 -07:00
Salvo 'LtWorf' Tomaselli
2a1a640227 Define PATH_MAX if it's not defined
Fixes FTBFS on Hurd.

[Dirk Hohndel: changed PATH_MAX to 4096 for consistency with Linux]

Signed-off-by: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27 15:55:03 -07:00
Dirk Hohndel
6bb6e43846 Preferences: only save settings that are changed
This continues the effort started earlier to only save things that aren't
the default.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27 15:46:50 -07:00
Dirk Hohndel
45ee3983b7 Use one consistent font size throughout the app
Let's see how much people notice it / hate it.

Fixes #712

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27 15:46:29 -07:00
Dirk Hohndel
ab4d232bc2 Don't set up fonts twice
Turns out that the mainwindow reads the settings and sets up things -
except that this has already happened in the constructor of the static
PreferencesDialog. So only keep those parts that aren't handled there.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27 15:46:06 -07:00
Dirk Hohndel
9aca309611 Default font: more fine tuning
In order to get rid of the old default font on Windows (Calibri) we are
going to near ridiculous length. The reason for this is that we in the
past always saved the default font in the settings (how stupid was that!)
and so now even with a new default font in place, since there is an
explicit font in the settings we take that instead of the default.

Instead of requiring our existing users to use a registry cleaner to get
the correct default font on Windows 7 and later (the VAST majority of our
Windows users at this stage), we simply explicitly ignore that old default
font.

There is one very nasty side effect. A user cannot set Calibri as their
font of choice on Windows 7 or later (because we always force them back
onto Segoe). Given how much nicer Segoe looks I think this is an
acceptable flaw - let's hope this doesn't come back to bite me in the
future.

At the same time this changes the default font size handling. We try to
get the default font size of the OS so the app looks "right". This seems
to not give me the expected result on Linux with KDE, but maybe I'm doing
it wrong? Looks good when testing on Windows.

See #712

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27 15:45:43 -07:00
Dirk Hohndel
dba3aa12a3 Small whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-26 21:30:54 -07:00
Dirk Hohndel
778d6ea103 TableWidgets: change default column width and don't save unchanged widths
Similar change to the dive list. The idea is to not save things that are
the default. This way Subsurface will do the right thing when defaults
change.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-26 21:30:54 -07:00
Dirk Hohndel
75650bd65f DiveList: don't save default column width
This is an elegant way around our problem with people who have the
horrible old "100px" column width in their settings. The first time they
run Subsurface after this fix things won't get better, but the offending
keys will be deleted at exit. And the second time they run, they'll get
the much more sensible new default widths.

Thanks to Thiago for this idea.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-26 14:17:15 -07:00
Dirk Hohndel
6195c139dc Fix planner gas consumption
We need to start out with valid SAC rates in the diveplan.

Thanks to Gaetan for finding this and suggesting a different fix - this
seems cleaner to me.

Reported-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-26 11:34:02 -07:00
Dirk Hohndel
47226912b6 Fix missing translations for webservice responses
The webservice backend sends responses in English. Let's do a better job
presenting those in the users preferred language.

Fixes #714

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-26 10:30:41 -07:00
Tomaz Canabrava
18da0b1911 Implement the modelDataChanged to repopulate the widget on Statistics
The modelDataChanged method will remove all items and recreate everything
*right* now we will never use it, because we are not triggering any
changes on the model, but simply deleting and recreating it everytime
we open the dialog. to be changed in the future.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-25 14:00:38 -07:00
Tomaz Canabrava
4a6a9a6706 Use scene()->clear() instead of manually clearing the scene.
When there's a rowsAboutToBeRemoevd, remove all items from
the scene() by calling scene()->clear(), instead of creating
a method just for that.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-25 14:00:24 -07:00
Tomaz Canabrava
3d5dde09ad Use aboutToBeRemoved instead of removed
If we used removed things from the interface we could hit a dangling
pointer, so first delete the items, then let the system delete the rows.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-25 13:59:45 -07:00
Tomaz Canabrava
b01ef9a0a5 Implement the resizeEvent to make the statistics always visible.
Always fit the whole scene in the view.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-25 13:59:17 -07:00
Tomaz Canabrava
1c56c9f626 Create stub methods and connects the model with the new statistics
Connects the YearlyStatistics model with the YearlyStatisticsWidget
nothing is shown right now, mostly because I need to do everything
but now it's easyer to add the things that are missing.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-25 13:58:38 -07:00
Tomaz Canabrava
750fc529b7 Add the old Statistics to have a reference view while programming
Added the old statistics panel at the botton of the new one to have
a reference view of the statistics while programming the new one.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-25 13:58:26 -07:00
Tomaz Canabrava
2fe1dfe83a Remove a lot of non-necessary boilerplate code.
We used to have a very sad way of controlling the statistics,
now we will create the model when there's a need for it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-25 13:57:28 -07:00
Tomaz Canabrava
537b42e3f7 Add initial skeleton for the Statistics Redesign
The statistics widget is a beast, one of the parts that I dislike most
on the current subsurface implementation. This is the initial work to
change that to something amazing. This first commit adds the first bunch
of files that I think are needed, and the correct setup for the qmake and
cmake buildsystems.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-25 13:55:23 -07:00
Anton Lundin
0e91352e96 Fix NO_USERMANUAL building for android
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-25 13:54:20 -07:00
Tomaz Canabrava
214bd0ed6e Re-enable the edition of the Date after editing a trip.
Since we can't edit the trip date, we need to remember to
re-enable it after we disable it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-23 08:10:47 -07:00
Tomaz Canabrava
9acf1caca3 A much better Toolbar for the profile.
Using QToolBar I was able to remove much of the dead code
from the mainwindow.ui xml file by transforming the QToolButtons
into actions and loading them dynamically in the .cpp code.
I couldn't use the designer for this ( as I wanted ) because
Qt has no notion of ToolBars outside of the areas where the
MainWindow should have one, and we use it in a very different
area.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-23 08:09:11 -07:00
Dirk Hohndel
fb371c0633 TankBar: don't risk dereferencing stale pointers
Basically we could end up in a situation where the plotInfo is no longer
valid, yet the model changes and triggers a redraw before the new data is
passed into the TankBar.

Instead of chasing that race condition it seemed much easier to just copy
the plot_data entries and the gas information in the dive.

Fixes #716

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-23 07:23:42 -07:00
Dirk Hohndel
438fe5dbde Divelist: Use more sensible default column widths
Having 100px wide columns was simplistic and stupid. It was never intended
to stay that way.

See #712

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-22 15:03:13 -07:00
Dirk Hohndel
2760f295d2 Divelist: switch to better column headers
And move the units there.
This is a long going back and forth. What we want is narrow columns. But
what we need is something that's easy to understand for our users.

I'm open to other suggestions, but I think this moves us in the right
direction.

See #712

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-22 15:02:50 -07:00
Dirk Hohndel
4a04fc2a1b Fix selection logic when manually adding a dive
This was an interesting bug. When adding a dive that would end up in the
middle of the dive list, the newest dive in the dive list would end up
marked in the dive structure as selected - even though it wasn't
visualized as selected by Qt. Bad things happen if the user then made
changes to that dive without selecting something else first, for example
by either editing the dive or doing things to it like removing it from or
adding it to a trip. The same operation would also be applied to the
newest dive in the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-21 17:58:15 -07:00
Robert C. Helling
b8823acef9 Planner: Control-Click removes divedatapoint and all following ones
In order to offer a simple way to remove a calculated deco, if Control is pressed
while clicking on the trash can in the dive plan, that point and all following are
removed. This way the user can Ctrl-click on the first calculated waypoint.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-21 16:16:38 -05:00
Karina Mochetti
66cbdea8a1 Crash clicking on the globe without a dive
When the user right clicks the globe, we should only present the menu action
if there's a current dive, if not, we disable it.

Signed-off-by: Karina Mochetti <karina.mochetti@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-21 14:31:15 -05:00
Dirk Hohndel
512c42e38a Dive list: seriously simplify the "add to trip" code
The existing code seemed way complicated, made way too many assumptions
and apparently was broken in certain cases.

This code seems very simple, looks correct and should fail gracefully
(i.e. simply do nothing) if things get confused.

Fixes #706

(I hope)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-21 14:20:03 -05:00
Joseph W. Joshua
b940f078b5 Show correct path after saving dive computer settings
When backing up dive computer settings to XML, the confirmation
dialog shows the default file path. This patch fixes that by
displaying the correct file if the user changes the backup location.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-21 13:31:34 -05:00
Dirk Hohndel
0b5e3389e2 Make sure tank bar button triggers tank bar
This worked flawlessly on Mac and Linux, but on Windows I needed to add
the explicit setVisible here - not quite sure why.

Fixes #710

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-21 07:52:14 -05:00
Dirk Hohndel
dd1dc11cb6 Planner: don't show CC Set Point when planning dives
So far we only plan OC dives, so let's not confuse things by showing the
set point for the tank.

Fixes #261

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 22:15:59 -05:00
Dirk Hohndel
1620f7ec0c Planner: make sure start time is reflected in diveplan and displayed_dive
Fixes #709

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 22:10:27 -05:00
Dirk Hohndel
642ad1e0fe Fix crash when calling the planner twice in a row
Turns out that the fix in commit f7119bdccf ("Planner: make sure no old
handles are around when entering Add/Plan") was incorrect. We ONLY want to
remove the existing handlers when we re-plan a dive, NOT when we call add
or plan.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:57:15 -05:00
Dirk Hohndel
1894bdd3cb Don't trigger creation of dive from invalid plan in planCreated()
This is subtle. The modifications to the selection cause a redraw of the
profile. So we need to make sure that we leave the plan state and return
to profile state BEFORE we do this, otherwise we'll call into
createTemporaryPlan() with invalid data.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:18:26 -05:00
Dirk Hohndel
5b0f4e79c4 Mark manually entered waypoints as such
With this information, when we re-plan a dive we can bring the user right
back to the point where they ended - they have the waypoints in the dive
pointes table and handles are shown on the right points in the profile -
and the rest of the dive is once again calculated by the planning
algorithm.

For now this state is lost when saving the dive file as we don't add this
flag in the sample to our saved files. So if we don't find any samples
marked as manually added we add ALL of the samples as way points on the
diveplan and the user has to manually remove the ones that were
calculated.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:18:26 -05:00
Dirk Hohndel
f7119bdccf Planner: make sure no old handles are around when entering Add/Plan
In some cases we don't appear to remove all of the old handles from the
scene and end up showing a handle from a previous instance of the planner
in the upper right corner of the profile.

This patch makes sure that we remove any stray handles that might still be
around before entereing plan or add mode.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:18:26 -05:00
Dirk Hohndel
d45a991460 Planner: after canceling a plan, redraw the profile
While planning we might have made changes to the displayed_dive. So we
need to make sure that the profile is redrawn after we cancel a plan (or a
re-plan).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:18:26 -05:00
Dirk Hohndel
d7630032e2 Planner: clear out model before re-planning a dive
Otherwise points from a previous run might be around.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:18:26 -05:00
Dirk Hohndel
a85a219df3 Add ability to replan a dive that we planned before
When doing this, all waypoints of the calculated ascent are now waypoints
in the plan - so the user has to remove the ascent part of the dive in
order to really replan the dive. That's a pain, but we don't keep the data
around that would tell us which waypoints are user input and which ones
were calculated.

Fixes #527

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 21:17:52 -05:00
Dirk Hohndel
76f3c0f028 Planner: don't calculate ascent while adding waypoints
It's silly to carefully calculate our ascent for each new waypoint that we
add to the plan. Let's get them all in and THEN calculate an ascent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 15:06:48 -05:00
Dirk Hohndel
77f9bf06fd Planner: correctly free divedatapoints
Simply setting the pointer to NULL leaks memory.
And that C++ recursive two function implementation... oh boy.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 15:06:39 -05:00
Dirk Hohndel
6ed189f32c Planner: bring sanity to the SAC rate handling
The old implementation was... let's call it creative.
This tries to actually get things right instead of using magic.
Don't pretend that double values are ints.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-19 11:36:54 -05:00
Dirk Hohndel
150676ce3d Merge branch 'joshua-gsoc' of git://github.com/thiagomacieira/subsurface into josh
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>

Conflicts:
	subsurface.pro
2014-08-18 20:25:06 -05:00
Dirk Hohndel
48fe5254dc Preferences: increment/decrement partial perssure values by .1
This defaulted to +/-1 which really isn't all that useful.

Fixes #703

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-18 14:21:11 -05:00
Dirk Hohndel
0f1381f160 Planner: assign a dive number if the right number seems obvious
Use the same logic as we do for newly added dives.
As a side effect this patch appears to fix the issues with getting the
newly planned dive selected.

Fixes #692

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-18 14:12:05 -05:00
Dirk Hohndel
88fe28636e TankBar: make outline zero-width
In some circumstances Qt will draw a really thick border around
rectangles. This explicitly makes the border of the tank bar thin.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-18 11:47:18 -05:00
Dirk Hohndel
29f50c6aee Cut'n'paste for dive data: implement paste side
This should correctly set all the values and puts us in edit mode.
Testing so far looks good for both single dive and multiple dives selected
(i.e., you can paste into multiple dives).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 11:58:11 -06:00
Dirk Hohndel
822eb7558d Selective copy: forgot tags in the UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 18:35:44 -06:00
Dirk Hohndel
4a7432e3d5 Don't always clear the dive before selectively copying
This will be needed when pasting the data back into a (set of) dive(s).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 18:34:27 -06:00
Dirk Hohndel
34fceb4a1b Cut'n'paste for dive data: implement copy side
Admittedly not very useful without working paste, but it's progress.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 10:07:06 -06:00
Dirk Hohndel
c58d136d33 Dive edit: allow the user to explicitly clear a GPS location
If the GPS coordinates for a dive were incorrect for some reason and the
user wanted to clear them in order to then re-download / apply GPS
information from the Subsurface webservice, prior to this patch we would
always match the location name and re-populate the GPS coordinates, making
it impossible to clear a GPS location without also changing the location
name.

This patch fixes this - but if you have multiple dives with the incorrect
name / GPS location pair, the next edit to a dive that had the GPS
coordinates cleared will re-populate the GPS coordinates (at that point
Subsurface can no longer tell that this was intentional).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16 07:09:11 -06:00
Dirk Hohndel
64c9fff850 Survey: rename "Save" button to "Send"
Fixes #701

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-15 21:41:41 -06:00
Dirk Hohndel
e8d430341c TankBar: hook into prefs and make ppGraphs resize accordingly
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-15 08:11:14 -06:00
Dirk Hohndel
e71119b40b TankBar: use the itemPos as intended
Which actually makes the code much clearer as now the object is at the
correct spot on the canvas and the positions inside are relative to that.
No more magic gradiants starting at "92"

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-15 07:30:31 -06:00
Linus Torvalds
5b14ed16ac Add "download into private trip" dialog checkmark
This adds a checkbox for the divecomputer download dialog that allows you
to tell the download to put the newly downloaded dives into a trip of
their own. That in turn will disable the dive merging with any existing
dives, which means that you will not mix up your newly downloaded dives
with any old dives.

That, in turn, is very convenient of you know that some of the dives were
done by other divers (or from testing that happened during servicing etc),
or the dive dates etc were wrong because the dive computer date had reset
due to battery changes etc.

Once you have all the dives in a private trip of their own, you can then
fix them up (delete dives you don't want to merge etc), and then after all
the data is ok you might want to merge the cleaned-up results with
previous trips etc, and then manually ask subsurface to merge the dives or
whatever.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 22:40:14 -06:00
Dirk Hohndel
87ca15c5c3 Add gas text to tank bars
Also restructures the code a bit to make it a little more sane and changes
the colors slightly.

With these changes I think we can claim that this
Fixes #557

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 22:39:47 -06:00
Dirk Hohndel
fa3c18d83b Add initial support for a visual tracker of gas used
This shows a color-coded bar at the bottom of the graph that corresponds
with the active gas.

Todo:
- text that explicitly states gas on the left edge of the bar
- better vertical positioning of the bar
- ability to turn this on and off

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 18:22:27 -06:00
Robert C. Helling
ecf0408aae Make SAC values in planner settings respect unit settings
So far, the fields for the two SAC rates did not show a unit and were implictly l/min.
Now they respect the settings for volume units. This was harder than I thought for two reasons:

1) Imperial units for SAC are cuft/min but a typical value would be .70. So I made the point
the field prefix and what is entered is actually hundreth of cuft per minute.

2) I had to get the rounding right in order not to get effects like 20l/min become .70 cuft/min (19800 ml/min
internally) which would then become 19l/min when switching back.

While being at it, I gave the gradient factors '%'-signs as units.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-13 21:11:07 -06:00
Joseph W. Joshua
4e99382c96 Improve on error reporting in the ConfigureDiveComputer class
This patch improves on the error reporting for the dive computer
configuration dialog to use config->lastError.

The previous code was using a different argument in each function,
which lacked uniformity.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:15 -07:00
Joseph W. Joshua
24cb0b0496 Hide status message when an error message is present
To avoid confusion, this code update makes the status text empty whenever
there is an error message. This makes the error message more prominent.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:15 -07:00
Joseph W. Joshua
a9b55d7f0d Change Dive Computer Configuration dialog
Changes the layout of the ConfigureDiveComputer dialog to use a
list of supported computers on the left, with a stacked widget
showing the configurable details.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:15 -07:00
Joseph W. Joshua
cc6c385f33 Start Work on Firmware Update
This patch implements the first step towards OSTC 3 firmware update.
Its not much, just file selection, but I will build up on it from there.

Implements a thread to initiate firmware updates. Currently, this is
for the OSTC 3.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:15 -07:00
Joseph W. Joshua
8aa7fddb22 Add read/write support for OSTC 3 SetPoint settings
Implements support for reading, writing and backup/restore of set point
settings for the OSTC 3.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:15 -07:00
Joseph W. Joshua
9c032f20c0 Add reading and writing of OSTC 3 Dil values
Implements reading, writing and backup/restore of OSTC 3 Dil Values
(setting 0x15 to 0x19)

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
a52beebbe9 Implement saving of OSTC3 Gas Settings
Implements writing OSTC3 gas settings to the device.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
8b39d2fc17 Read OSTC3 GasSetting Values
Implements the reading of OSTC3 Gas Settings. These are settings
0x10 to 0x14

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
4f37602836 Move non gui code from qt-ui
Moves non gui classes (configuredivecomputer, configuredivecomputerthreads
and devicedetails) from qt-ui to the top level folder.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
045a6fb6b1 Start working on GAS and DIL tables
Start work for gas1-5 and dil1-5.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
d76881cb01 THIS COMMIT NEEDS A COMMIT MESSAGE
I've moved the .pro file fixes to where it happened, so the rest of the
changes need explanation now. -Thiago

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
5292bcbf21 Add more OSTC 3 settings
I am adding more OSTC 3 settings as I go along. Here, I have
added dive mode and saturation.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
8ccf2e8f1d Change ConfigureDiveComputerDialog to use tabbed interface
Changes the dive computer configuration dialog to use a
tabbed interface. This will make it easier to add new
dive computer models to the interface.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
09ec8a44e5 Add Support for more OSTC 3 Settings
Adds support for more OSTC 3 Settings to the reading, writing,
backup and restore functions. These settings are: last deco,
units, sampling rate, salinity, dive mode colour and compass
gain.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
aad60ef6da Working XML Backup and Restore
The ConfigureDiveComputer class now has functions for complete
XML backup and restore. These dump the loaded settings on a
dive computer to an XML file, and there is an option to
restore them.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
e54d7d9178 Backup basic settings as XML
This patch enables XML backup. We can now save the settings
to an XML file. Currently this backs up just the basic stuff
such as custom text, language and brightness.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
3534e29ae2 Port writing of date and time to new classes
After splitting dive computer configuration classes, the date/time
setting had not been ported. This adds the same to the classes.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:14 -07:00
Joseph W. Joshua
20eb62a98a Polish up on classes
This patch polishes up on all classes added for dive computer
configuration to give a clean workflow. The classes can now
write and read data from the OSTC 3.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-13 10:48:11 -07:00
Anton Lundin
d453d5cb37 Rename dive gas function and defines for clarity
This renames the dive gas functions to not talk about just nitrox, and
to instead talk about gas.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:41:57 -07:00
Anton Lundin
619c1b3ec9 Rename the model column from NITROX to GAS
The column isn't just about NITROX, there might be air and trimix in
there too.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:41:36 -07:00
Anton Lundin
e07d23f806 Rename list column from O2% to Gas
In the dive list, calling the column O2% is kinda wrong, because in
at least my dive list there are both air and trimix showing up, so this
renames that column to Gas.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:40:18 -07:00
Gehad elrobey
3a46657f4c HTML: export Translated strings to JSON files.
First step towards multilingual export. Use the existing translation API
to translate and save words to JSON file.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:21:19 -07:00
Gehad elrobey
108fc892ca HTML: Don't export total statistics value if not chosen
Don't export total row in yearly statistics unless exporting the
statistics is checked

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:21:15 -07:00
Gehad elrobey
10e70336c6 HTML: Remember General Export Settings.
Set Default values and remember user selected general HTML export
settings.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:21:13 -07:00
Gehad elrobey
3ebb62f153 HTML: Add total row to yearly statistics table.
Add new row to the yearly statistics table containing the total. Total
values are calculated to some columns only, it doesn't make any sense to
add the total value to other columns (Temperature cols for example).

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:21:03 -07:00
Gehad elrobey
93a15d471c HTML: Make export statistics optional.
Make exporting statistics to the HTML page optional.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11 08:20:55 -07:00
Joseph W. Joshua
4fc16b1674 Move divecomputer configuration code to different files
This splits the code in configuredivecomputer.cpp into multiple files.
The read and write threads are moved to configuredivecomputerthreads.h/cpp,
and the device details class is moved to devicedetails.h/.cpp

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 12:06:42 -03:00
Joseph W. Joshua
2432350064 Add brightness setting
Adds a setting to control the device's brightness. Currently I
have only the OSTC 3. Will add more afterwards.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 12:01:56 -03:00
Joseph W. Joshua
a7a74ae9a6 Improve writing of device name to dive computers.
Improves the writing of device name to the dive computer. The
code has been updated to use a switch statement.

This will make it easier to add new devices in the future.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 12:01:56 -03:00
Joseph W. Joshua
ee2403d63c Improve writing of date and time to dive computer
Improves writing of date and time to the dive computer. This
has been tested using the Heinrichs Weikamp OSTC-3.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 12:01:56 -03:00
Joseph W. Joshua
a08d239af5 Change dive computer family detection
Following suggestions on the mailing list, this changes the
method used to detect the dive computer family. Detection is
now done using: dc_device_get_type.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 12:01:56 -03:00
Joseph W. Joshua
3e127a059f Create class to write settings to dive computer
Adds a class to write settings to dive computer, and modifies
the existing ones to integrate it.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 12:01:56 -03:00
Joseph W. Joshua
a7c9b25b05 Read basic details from dive computer
Added classes for reading data from dive computer. This is
at the basic level and I will expand it as I go along.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 12:01:54 -03:00
Joseph W. Joshua
791fbee260 Load vendor list and product list
Using code from 'downloadfromdivecomputer' class, this code
loads the vendors and products to the respective comboboxes.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 11:59:15 -03:00
Joseph W. Joshua
ec02737eda Create Dive Computer configuration dialog
Create a dialog for reading and writing settings to and
from dive computers, with a menu entry in MainWindow to
open the dialog.

I will build up on this dialog and change it as needed.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2014-08-09 11:50:14 -03:00
Dirk Hohndel
827d4740c3 Better User Agent for Subsurface
This one is less verbose and very easy to parse. It's guaranteed to have
five components, separated by ':' with no other ':' in the string:

Subsurface:<version>:<PrettyOSName>:<appCpuArch[/osCpuArch]>:<UILang>

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08 11:13:05 -07:00
Dirk Hohndel
a9f59c0cb3 Revert "Don't translate components of the version"
This reverts commit 6fdbf2069d.

That was actually the wrong thing to do, now that I think about it.
Instead we should show the translated version on screen and send a
compact, easy to parse variation of this as the User-Agent header.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08 10:44:06 -07:00
Dirk Hohndel
4a125384ac Fix possible crash attempting network connection
If we didn't get back a JSON encoded string (i.e., if the response
contained no '"') we would access a QList past its boundary.

I'm somewhat hopeful that this is a last second fix for an annoying bug
I've been trying to figure out for a while.

See #514

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08 10:39:46 -07:00
Dirk Hohndel
6fdbf2069d Don't translate components of the version
When transmitting the Subsurface version string we always want to use the
English terms, not the localized terms.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08 00:31:18 -07:00
Tomaz Canabrava
44f59b6022 Move the Trash bin to the topRight on the pictures
It was too easy to remove a picture by mistake, not anymore.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-07 13:12:32 -07:00
Dirk Hohndel
ee77398eb8 Reload the dive list after accepting changes
So far we only did it when we added a dive or modified a manually added
dive. But the reality is that an edit of any dive could cause changes that
require the dive list to be reloaded.

Fixes #698

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-07 10:23:08 -07:00
Tomaz Canabrava
68af9f0afb Delete pictures from the Widget by pressing delete
Select the picture, press delete, profit.

[Dirk Hohndel: removed the stray hunk that snuck into this patch]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06 18:32:28 -07:00