Whitespace fixes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Break really long line.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Set visibility in a saner way

for some reason we did a if(true) setValue(true) else serValue(false)
now we just use the value to set the value. =p

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't plot pictures in Print mode

The pictures were being plotted in print mode, the main
reason for this was that when we entered print mode and
had already a picture plotted, the method would return
before removing them from the screen. This fixes it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Animation speed is a value, not a boolean

This breaks compatibility with old preferences, but it's a single
key and not that very important so I don't think it's a bigger issue
I've renamed prefs.animation to prefs.animation_speed to denote
that it's a value, and not a state.

Also, fixed the places that were treating it as a state (on/off)
to treat it like a correct value.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Code cleanup: HeartRate item was doing insane things

This simplifies so much of the code that we were using to control
the visibility of the HeartRate. now things are much saner.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only use HTML if the text has a <table>

The text we generate for the diveplan has a table inside, and
we must use HTML only for the dive plan. so I treat all text
as HTML, look for a table item, if it doesn't have, I treat
it as Simple text and set it on the notes. Works and makes
linus loves me again.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only repopulate the dive info once ( we were repopulating 4 times )

This makes the screen repopulate itself after a dive change only
one time instead of the old 4. we were repopulateing when we
removed the actual selection to reset the old selection previously
stored, sigh.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>