Show temperature units in the label when editing dive

Currently when user wants to add a new dive information,
the ways to know what unit system is being used are

 - Through preferences panel.
 - Save the dive information, which displays units in
   the text field.

This patch provides an option to the user to show current
unit system by displaying the unit on the side of the label
when the user is editing the fields.

This feature can be enabled or disabled by using the new
checkbox option i.e. `Show units in text labels` included
in `preferences->units` section.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
MainWindow: close all windows once we close the main one

This is useful if we have more non-modal windows and we want
them simply to close with the main one without explicitly
creating class member variables to point to such instances.

A practical example would be the debug window created in
ProfileWidget2() (diveDepthTableView) which holds
the depth profile values.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Profile2: provide means to disable the tool buttons

Once the poster is displayed when there are no dives in the list,
we may also want to disable the QToolButtons (PO2, SAC, etc..),
until a new dive is loaded and the profile is redrawn.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Support Animation Speed via Settings.

This is very userfull for a ( yet to be implemented )
preference dialog about the animation speed, so the
user can enable / disable the animations or make it a bit
faster for it's taste.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Support save / load for the Animation Speed on the Preferences

User can now fine-tune the animation speed on the preferences,
a value of zero disables it completely.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Defer mainwindow->show()

The mainwindow->show(); was being called before we parsed
the dives, so in the case of a large dive file, we got a
very quick, but spottable, gray background on the profile.

The mainwindow->show(); now is called just before the
Qt main-loop starts.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only anim if not first dive when openning subsurface with a divelog.

The animation appeared when the user started subsurface with a default
file, wich was a little annoying since it didn't had a 'from' position
to go and it was also increasing it's size on some window managers
that do subtle windows animations when a program starts. This patch
treats the first dive opened when the program loads with a divelog pa
rameter differently as the following ones storing the velocity value
on a temporary, and reassigning it later.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
git-load: Add trips to the trip list on loading

We don't actually much use the trip list any more, and it's possible we
should simply get rid of it.  I hadn't added the trips to the trip list
when loading them, and everything worked fine.

Well, *almost* everything worked fine.

There is one use of the list of trips, and that's the "clear the trip
index for each trip before saving them".  That literally seems to be the
only non-debug use of this list, but when we didn't add the trips to the
list, the trip index never got cleared before saving trips.

And even that is unnoticeable for the *first* save event, because the
trip index will have been clear before that.

But on the *second* save event, if the trip index doesn't get cleared
before saving, the saving code will look at the index, say "Hey, I
already saved this" and skip the trip.

So if you loaded the trips from a git repository, and then saved things,
everything worked fine.  But it you saved things a *second* time,
nothing would get saved at all, because all the trips were marked as
saved already.

Anyway, I think the real solution is to get rid of the pointless trip
list, and just use "for_each_dive()" to find all the trips, since that
list clearly is just more pain than gain.  But in the meantime, this
makes the git loading add the trips properly to the list.

Signed-off-by: Linus "oops" Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
git-save: don't save the subsurface version string in the object tree

I didn't think that one through: the version string is already saved in
the commit message, and so saving it in the tree object is redundant.

Now a little redundancy doesn't hurt, but having the tree object depend
on th esubsurface version _does_ end up being annoying: it means that as
you update the subsurface version, doing a data save will result in a
different tree SHA1 even if none of the data changed.

Which doesn't actually matter right now, since we always create a new
commit anyway, but my plan was to skip the commit creation if nothing
changed in the tree.  And saving the version string defeats that if you
are a subsurface developer and the subsurface version keeps changing.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
git-save: don't create a redundant new commits with no changes

If the newly created save tree is identical to the parent commit tree,
don't bother creating a new commit.  We are already fully up-to-date.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>