Enable downloads from the UEMIS Zurich

This behaves somewhat differently from the Gtk version - still needs
more investigation. But at least now it's hooked in.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove the bogus time/depth, and fix the positioning of the Handler after updateTicks.

Remove the bogus time/depth that was duplicated in the
Handler - dirk didn't realized that I already created the
same data that he put on it later, but mine was double and
his his was int, I choosed his implementation since he knows
a bit more than I do about subsurface internals.

Besides that, I worked a bit on the logic that called update ticks,
because it was calling it for every mouseMoveEvent, it created
sooooo many ticks that it made the app unusable ( and slow. )

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Add the 'Import files' functionality

Similar to File->Open but for multiple files and without
calling on_actionClose_triggered().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add action to 'File->New'

File->New in the GTK version performed the same as File->Close.
Creating a new file may also ask the user if the current file has
to be saved.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Enable 'View->View Globe'

For viewing the Globe section (pane) we need to collapse
both the 'list' and the 'main' splitters.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Reorder the 'View->View ..' list

Use Ctrl+1 for 'View All', while all the singular views follow
with Ctrl+2..5.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update main window title depending of current file state

If a file has been opened from the command line or via the File
menu the main window title becomes "Subsurface: filename.ext".
Title also updates if 'File->Save As' is called. "Subsurface" only
is displayed when no active file is present or post 'File->New'
or 'File->Close'.

To make this work a new public method is added - MainWindow::setTitle()
and also an enum type MainWindowTitleFormat, which should allow
more complicated formatting, such as showing the selected dives
or the total number of dives (e.g. MWTF_FILENAME_N_DIVES).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fixes most of the issues with the dive planner.

Fixes most of the issues with the dive planner,
The lines are removed when the drag starts, and
it's repopulated after. The time ruler updates
itself with the biggest time in the dive (I'll
add later the code to keep a minimum of 60 minutes,
and increase by 15 to 15 minutes, but for now
this will work ), Removed the code to do
line manipulation while we are moving handlers
around ( because it could trigger ruler-expansion,
that woul'd move everything, and that's not nice.

This showed that something bogus is going on with
the decompression algorithm - I don't know if it's
on the data or on the algorithm itself, but it's
creating a ring with the lines on the canvas
I painted all decompression-algorithm based lines
red so it's easier to spot where the hell things
got wrong.

midnight, sleepy.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Merge branch 'divePlanner4' of github.com:tcanabrava/subsurface
Removes circle in plan

Remove circle in plan by starting the first line at the first point
rather than the last.

In addition marks all entered points as entered and not just the first and
sets line color accordingly.

Makes plan_add_segment return the added data point.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove incorrect logic for first line in planner

This greatly simplifies the code.
Similar to (but not based on) code submitted by Robert Helling.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove unused code

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Better positioning of the plus sign icons in the Equip. tab

There are a couple of problems with said icons:
- When the Equip. tab is first seen, no relative event is monitored
so that the correct position is updated and the icons are positioned.

To solve that we connect the signal MainTab::currentChanged(int)
and call MainTab::equipmentPlusUpdate().

- When the info-profile QSplitter resizes with a snap towards/from
the edges of the main window, no resize handler is called such as
MainTab::resizeEvent().

A solution is to monitor the resize of the info-profile splitter
with MainWindow::on_infoProfileSplitter_splitterMoved() and again
call MainTab::equipmentPlusUpdate()

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Coordinate some mark_divelist_changed() calls

1) Make a call mark_divelist_changed(TRUE) when the user adds new
cylinder or weight entries.

2) Call mark_divelist_changed(FALSE) in
MainWindow::on_actionClose_triggered() so that each time after
a file is closed or a new one is created it does not ask immediately
the user for a save confirmation for the blank file/divelist.

3) Call mark_divelist_changed(TRUE) once a dive's geo location
has changed in GlobeGPS::changeDiveGeoPosition().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show empty labels in the Stats tab

Remove a couple of TextLabel text entries from maintab.ui
which can be seen right after program start and if no dives
are present.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly prevent time travel in planner

Prior to this change the visual feedback (the handle that is drawn when
the user moves the mouse while pressing the left mouse button) would not
move to an illegal position (one that is impossible without time
travel), but it the user moved the mouse to such an illegal position and
then released the mouse button, we still added that illegal position to
the plan.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Somewhat saner behavior for rescaling the planner time axis

We always resize if the dive is longer than the current scale allows, but
we don't shrink it overly aggressively and we never shrink it below the
initial size.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Moved the DivePlanner to the MainWindow.

Now, activating the dive planner will hide the profile
and show the planner on the same place. we still need
a way to 'cancel' or 'accept' the profile created.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added the Ok / Cancel buttons on the dive planner canvas.

Added the ok / cancel buttons on the dive planner canvas.
I still need to hook the esc button to cancel it too, but
since I removed the 'floating dialog' option and merged it
into the mainwindow, it's necessary.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Removed memleak created by the diveplan calculations

Removed a small memleak created by the diveplan calculations.

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