ifdef out includes when we build without gtk

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use maxx from graphics context for time calculation.

Fixes #128.

Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Makes the 'auto' edition behave in a better way.

This patch makes the auto editon behave in a better way,
now you can scroll the notes widget without marking it as
editable, and also adds a bit of code cleanup, and a better
logic for editing the other widgets.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fixes showing the labels of divemaster and buddy after a trip selection

This patches fixes showing back the labels 'Dive master' and 'Buddy'
after a trip selection  was done, then back to single dive selection.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added classes to handle the Completion of Dive Editions.

Added classes to handle the completion of dive editions, the
classes are BuddyCompletionModel, DiveMasterCompletionModel,
SuitCompletionModel and LocationCompletionModel, thanks to
plain old C macros, code got really small. and I hope the
logic is better than the Gtk version. :)
Now next step is to integrate it to the Ui. shouldn't be hard.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added completion for buddy, divemaster, location and suit.

Added completion for buddy, divemaster, location and suit.
The completions uses some models that I created in the last
commit - everytime that a divelog file is loaded, it creates
a list of completion items.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fixed a bug where the auto-completion would not work via commandline.

Fixed a bug where the auto-completion would not work via command
line, I fixed it by reloading the information of dives when a
dive file is open via command line or via UI.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Compile fix

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix for double-rendering, double selection and other annoyances.

This patch fixes a thing that I run into when trying to implement
the multi-edition system. Whenever a dive was selected, via mouse
or keyboard, it had two stages: first, it would select the previous
and the current ( and thus, render the profile of the current) and
then whould release the previous and select the current again ( and
thus, rerendering the profile again, plus a few other things. )
With the multi-edition system this caused a more severe bug, since
the edition of the dives is directly applied as soon as the text fields
changes, as soon as we selected any dive on the list, the 'before' dive
would be modified by the 'current'. This patch fixes this - but since it's
just a 'code removal' patch, this can led to bad things in the future,
I tested it quite a bit, but didn't found anything, no regression.
*fingers crossed.*

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Enable Multi Dive Editing.

This patch enables multi dive editing on the selected
dives. It's a bit of big patch where I reworked how it
worked since it was written just for a single dive.
this means that this can introduce bugs - I'v tested it
quite a bit but a thing could slip thru my fingers. :)

How this is supposed to work:

Select a few dives that you want ( one or more ) then
click on the field that you wanna edit / multi edit, and
press 'accept'. *only* the edited field will be modified
thru all dives.

Next patch - I'll change the bg color of the edited fields.A

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Change bg of edited parts of the dive on the interface

Change the background color of edited parts of the dive
on the interface. Specially util if you are editing multi
dives in a single step, and went to eat something or did
anything else for five minutes, then come back and don't
quite remember what did you changed. now it's in a cute
yellowish background.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Good deal of code cleanup.

This is a bit of code cleanup that I'm not sure that will
pass, since it's all macro-based, but I don't have a thing
against macros at all. Sometimes they helps us keep a better
and cleaner code base. I think I managed to remove around 120
lines of code, wich isn't much, but I replaced it by 14. and the
code is now easyer to maintain, so hooray.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Bugfix plot of ceiling violation

Due to a bug in how the entry-list was handled, a point on the polygon
was introduced at 0,0 that made a weird pink triangle across the whole
profile. This was quite clearly seen in dives/test15.xml
Fix compilation on hipp
Show sample time in the mouseover.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
WIP: plot points for missed deco stops.
Only calculate with he when he is present in event

Old gasswitch events only contains O2, so don't look at he part when
there is no he in the event.
WTF: FIXME?