Fix the sentense 'collapse' to 'collapse others' and scroll to it.

This patch changes the string 'collapse' to a more meaningfull
'collapse others', it also scrolls the view to the first selec
ted index, since after collapsing the others, things could be
in the wrong position.,

Fixes #233

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Maintain opened the trips of the selected dive.

In various occasions the branches of selected dives
got collapsed because I'm dummy boy and didn't programmed
the logic correctly.

This one correctly works for the few cases that I'v tried,
I'm verifying if the current selected index is a trip or
a dive, and asking to expand it.

The expanded state is lost because we delete and recreate
the model ( and we do that because we can switch between
tree and table model ).

Now I think we correctly track the cornercases.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Get rid of the planner

This is nothing but an indefinite time sink. Let's focus on things that
the majority of our users actually need and use.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Turn planner back on
forget old filename on starting a new log.

Thist closes bug #253.
Don't create stop at time zero when re-editing manually added dive

To our addStop method time = 0 & depth = 0 are a magic flag. And since we
always start at the surface, that is assumed, anyway. So let's just not
add a stop for that when re-creating a plan from a dive.

Fixes #254

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Forget old filename on starting a new log.

Fixes #253.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't close the active file or start "add dive" while editing a dive

Seems rather obvious to me - the language in the warning doesn't sound
very smooth, though.

Fixes #246

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Include icons in the Windows installer

Also fix the dependency / ordering issue with running makensis

Fixes #252

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This moves the removal code to the model.

It's very important when programming via Model/View, in gtk or qt,
to not mess with the model data outside of the model. We were
deleting stuff that the model controlled outside of the model, so
it thought that there was still data there. This fixes the deletion
part, but there are also lots of other parts that I'll tackle in
the next commits.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Planner: Make cylinder and time/depth boxes scale

When moving the horisontal splitter the cylinder and time/depth boxes
didn't scale down but got "stuck" on a certain height. This makes them
scale down when pulling the horisontal splitter up.

I would prefer if we could scale them individually, but i didn't manage
to get that going, but i didn't manage to get that going.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix wrong handling of Dive Table, and revert some wrong changes.

This patch just reverts some wrong changes that I'v done on a
past commit ( sorry ) and correctly handles the selectDive,
by using a IDX instead of the dive pointer, as dirk told me
it's extremely error-prone since the pointer can change.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Do not break Dive Headings on trip mode when a delete dive is done.

When the dive is deleted, we force a recreation of the dive list,
this is done because we were broken by design on the first transition
to the Qt infrastructure - one thing to change for 4.1, but no time
for 4.0.

We forgot to ask the headers to 'please, span more than one row,
please' when we recreate the model. easy =)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Selects the dive before the deleted ones.

This patch makes a selection just after the dives that got deleted,
or nothing if the list is empty.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Expand the trip of the newly selected dive.

I hit this bug on deleting dives and the newly selected
one got inside a trip, that wasn't expanded. anyway, easy one.
:)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Small code cleanup.

This was bugging me for a while. :)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Removed duplicated method.

This patch removes a duplicated method: get_divenr and
get_index_for_dive. The two are exactly the same  ( if my
c is not broken, but I may be broken since I'm working like
crazy for almost 30h nonstop. ), so please take a good look
before applying this one.

[Dirk Hohndel: Tomaz took the slightly broken of the two implementations,
               so I switched that out for the correct one]

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix dive merging

This limits merging dives to dives that have at most half an hour of
surface time between them. That "half hour" is kind of a random thing
to pick, but it's not horribly horribly wrong.

It also changes the semantics of "merge selected dives" to something
that actually works pretty well: you can select a whole range of
dives, and it will merge only the ones that makes sense to merge. I
tested it, and it's reasonable. I could select all my dives from one
dive trip, and then do "Merge selected dives", and it did the right
thing (Dirk: I selected the florida trip, and it merged the aborted
"missed the trench" dive with the _actual_ "trench" dive).

I'm _slightly_ hesitant about this in the sense that maybe some crazy
person actually would want to merge dives with more than half an hour
of surface time between them, but it really doesn't seem to make much
sense.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix a crash with trying to show the tooltip on the profile.

Fixed a crash with trying to show the tooltip on the profile,
with an empty profile. Since the widgets are not created yet,
we got a crash trying to access the toolBarProxy.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix showing the tooltips on the profile.

We incorrectly mapped the profile's widget tooltip based on the
global screen coordinates.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>