Commit graph

954 commits

Author SHA1 Message Date
Dirk Hohndel
44c9316f14 Honor "last stop at 6m" in dive planner
And recalculate the dive when it changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-10 06:08:42 +09:00
Dirk Hohndel
2a0f1fcf4e Remove left over qDebug() call
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09 20:41:28 +09:00
Dirk Hohndel
487efb1ee9 Merge branch 'addDiveGasFix' 2013-11-09 20:35:09 +09:00
Dirk Hohndel
6d5b2d7592 Adjust planner to work with the new semantic
Insert the dive data point at 0,0 manually at the beginning of the plan.
Now everything should work. We still can't edit a plan created like this,
but at least we can once again plan things.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09 20:33:33 +09:00
Dirk Hohndel
5dce73f62b Fix position of depth reading when entering dives
At 5% it would overlap the scale - now it's much easier to read.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09 20:10:49 +09:00
Dirk Hohndel
1646517d28 After done with the DC download dialog, ensure it's in its original state
So in case the OK button was relabeled to 'Retry', relabel it back to OK.
Also, 'Retry' should be capitalized.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09 15:58:57 +09:00
Tomaz Canabrava
e4ea41b7bc Forgot to remove this debug, sorry.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-11-09 15:36:25 +09:00
Tomaz Canabrava
8a970c64c2 Removed inconsistency when user tried to add dive while planning.
The user could add a dive, and in the middle click on the 'plan'
button. Since we didn't cared about that on the widget, a lot of
inconsistencies could occour. this fixes that by setting a flag
on the Planner, that has now three modes: nothing, plan and add.
(maybe in the future an edit mode will be valid too.)

If in 'NOTHING' mode, user can enter the addition, edition and
planning. If in any other mode, user can't do a thing. The mode
gets back to NOTHING when user accepts or cancels a plan / add
/ edition.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09 15:35:29 +09:00
Tomaz Canabrava
f850a0817c Fixes garbage left behind when canceling edit dive.
Garbage was left behind when canceling edit dive, and thus when the user
set his dive to be editted, after a first canceled edition, all points of
the first edition got messed up and showing on the second dive too. if the
user clicked 'ok', he got a really bad surprise.

Fixes #226

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-11-09 15:34:39 +09:00
Tomaz Canabrava
d3fe3494fe Save / Restore the Tree after organizing by other columns.
This patch saves and restores the state of the TreeView after the user
clicks on another columns that will make the tree disappear. All of the
branche states are saved, this way the expanded nodes will be restored
when the user gets back to tree mode.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09 15:33:55 +09:00
Tomaz Canabrava
38287a1c1e Save the status of the tree before trying to reset the display.
This is a try: when the user changes the orientation on the columns
by clicking on the title of them and organizing by something that's
not the number, we lost track of the opened branches. this commit
doesn't fix that, but it fixes a possible similar issue.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-11-09 15:33:34 +09:00
Tomaz Canabrava
7dbf76384f Moved the code that handles DiveList column sizes to its correct file.
I got a bit lost trying to find the code that handled DiveList columns
today, so I thought it was better to move it to its file, after all we
do have a divelistview.h :)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09 15:32:37 +09:00
Tomaz Canabrava
ba638cae05 Fixes breaking the sizes of the columns of the listView.
This just proves one point: I'm retarded.
I moved some code around and forgot to close the old group, so I created a
group inside 'MainWindow' that handled the ListWidget, wich was not the
right thing to do at all.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09 15:31:58 +09:00
Tomaz Canabrava
d84cdb655e Fix inconsistent position of screen splitters
I basically rewrote the way we handled the splitters. It now uses a state
to know what it's doing, and will only update the value of the
saved-to-disk splitter size if the state shows the splitters (currently
only VIEWALL), where all the other states should hide the splitters, and
the values of the splitters don't matter.

Fixes #225

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09 15:30:51 +09:00
Dirk Hohndel
8941e8677e Correctly track gases when manually adding and then editing dives
The code had quite a few odd special cases that may have been left-overs
from the old Gtk algorithm. With this the gas is actually in the dive plan
node where it's use starts. And we maintain the gas correctly between
multiple edit sessions.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-08 21:22:59 +09:00
Dirk Hohndel
1578c1edb2 Be consistent when passing around gas data in the planner
We need to make sure that the correct segment has the correct gas assigned
to it - and that those gases are correctly tracked when editing a manually
added dive as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-08 18:15:04 +09:00
Dirk Hohndel
bf0bd88226 Correctly identify air
Because of rounding issues we need to use our macro to test for air
(especially since the events store gas percentages and not gas permille).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-08 18:12:26 +09:00
Dirk Hohndel
460aa4c1bd Include the cylinder information in a dive added with "Add Dive"
We only copied the samples, but not the related cylinder data.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07 18:07:10 +09:00
Dirk Hohndel
f2035bcd79 Don't translate the fake DC models
Since the model name is written into the XML file it has to be a literal
string that isn't translated. Otherwise a datafile written in one locale
behaves differently when opened by Subsurface under a different locale.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07 16:52:39 +09:00
Dirk Hohndel
f11b2274ec Adjust default start time of added dive
It should be 'now' in the current timezone.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07 16:34:07 +09:00
Dirk Hohndel
4e9a29a0af Remove debug output left in the previous commit by mistake
Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07 16:32:23 +09:00
Dirk Hohndel
f262ed69cc Make the tag widget act more sanely when pressing Tab
When dealing with autocompletion, tag usually means "take this, move on".
In the tag widget the tab was added to the tag itself (and then stripped
when the input line was processed). Not exactly useful.

This feels a bit "hackish", but it seems to get the job done.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07 13:40:57 +09:00
Taiane Ramos
abd54cad61 Fix for equipment tab cancel button bug
On equipment tab, when editing a cell and then clicking on cancel button,
it would delete all the cylinders table. Now it performs the original
behaviour of recovering the original value of the cell and don't delete
the table.

Signed-off-by: exhora <exhora.tat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07 12:40:39 +09:00
Dirk Hohndel
1c3a1a9592 Hide temperature fields when displaying / editing trip data
And show them again when displaying a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-07 12:38:35 +09:00
Maximilian Güntner
6ee2d88896 Hide TadWidget and Label when editing a trip
Also hide ui.CoordinatedLabel when editing a trip,
since ui.coordinates is hidden.

Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-05 17:05:29 +09:00
Dirk Hohndel
0f66e7a025 Show a different message when editing more than one dive
I still wonder if we have all the semantics correct for multi dive
editing. This will need more testing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-05 15:57:24 +09:00
Dirk Hohndel
e90f5c28df Fix dive merging
When merging dives, the indices of the following dives change - so we need
to adjust the variable used in the for_each loop.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-05 15:44:16 +09:00
Dirk Hohndel
01d515b5d8 Remember the column we are sorting by
A call to DiveListView::reload always reset our sortcolumn to be 0.
Instead we are tracking the correct sort column and sort direction.

This also removes an obsolete private member that was unused.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-05 14:23:37 +09:00
Dirk Hohndel
eaa0d647b7 Don't force the DiveListView to be a tree when reloading
We should keep whatever view the user last used.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-05 13:56:20 +09:00
Maximilian Güntner
c4d8b6a4d5 Fix the inconsistent behaviour of QCompleter
The TagWidget behaves now similiar to a QLineEdit.
Pressing Enter/Return will now close the completion widget.

Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-11-02 17:10:34 +01:00
Maximilian Güntner
2967391ffe Correct tabstops in MainTab
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-11-02 17:10:34 +01:00
Maximilian Güntner
5d93242b34 Corrected indentation, added license/copyright
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-11-02 17:10:30 +01:00
Maximilian Güntner
04cdfce782 Added a custom widget for tagging dives
A custom tag widget has been added to MainTab.
Tags are seperated by a comma ",". The implementation
supports escaping a comma by using "\,".
While typing, the widget supports the user by suggesting
tags using a QCompleter.

Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-11-02 03:37:31 +01:00
Dirk Hohndel
9e63539237 Merge branch 'editMode' of github.com:tcanabrava/subsurface 2013-11-01 11:19:23 -07:00
Tomaz Canabrava
0e96c9f62e Enable undo for the Edit mode on Added Dives.
This enables undo for the edit mode on added dives, it uses the
premade backup to fill the old dive with data. :)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-11-01 14:06:03 -04:00
Tomaz Canabrava
23a193b0d1 Changed the backup implementation of the samples on EditDive.
Changed the backup implementation of the samples on EditDive,
it's way cleaner now what's happening, and it's also better for
the cancel edit.

Next: The Cancel Edit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-11-01 13:45:14 -04:00
Tomaz Canabrava
f7cd3e780c Enable editing a dive that was manually entered.
This patch enables editing a dive that was manually entered,
it doesn't cover dive plans yet because on the plan I need to
figure out what are the 'user-entered' points, and what are
the algorithm point. and I feel lazy. =p

One last thing that's missing is to revert the dive to the
previous condition if the user cancels the edition, currently
canceling and applying ok is the same thing.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-11-01 11:48:34 -04:00
Tomaz Canabrava
d9afcdc8cb Code cleanup - Stop calling the same 6 lines everywhere.
There's a method named refreshDisplay, fairly unused, let's
use it a bit mroe.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-11-01 09:43:41 -04:00
Tomaz Canabrava
69d4ccae6d Added a new option to edit the dives.
Added a new option to edit the dive in the profile view. The option
will only be visible if the dive was manually entered or if the dive
is a plan.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-11-01 09:33:39 -04:00
Tomaz Canabrava
a7b19b251d Removed Reference to dangling pointer.
We cannot use tr("").toLocal8bit().constData(); on a function
that expects a char* because the object will be deleted on the
next line, so a strdup is necessary.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-10-31 16:50:09 -04:00
Miika Turkia
1a4d098ef2 Add alt based shortcuts to access menus
This adds alt-f shortcut to access file menu as well as other similar
alt based shortcuts for other menu items.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-27 10:58:52 -07:00
Tomaz Canabrava
a4da3004da code cleanup: removed unused function from mainwindow.h
The setupSplitters method was created quite a while ago
to deal with the splitters when I didn't used a more sane
approach. I forgot to delete it back them, removing now.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24 23:04:34 -02:00
Tomaz Canabrava
7bea2e1be0 Minimum hooking-up done, divelogs.de shows on menu-activation.
This patch does the hooking up to show the dialog of the
divelogs.de window when the user selects it on the menu.:

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24 23:02:59 -02:00
Tomaz Canabrava
6cf875ed92 Reorganized the downlads menu for the inclusion of more webservices.
This patch moves around a few items on the menu to a new submenu
downloads/uploads. I think it's not the best way, but it already
fives a bit more of 'unverbosity', because the old menu had
'Download from Dive Computer', 'Download from Webservices', and
now we would introduce a new 'Download from Divelogs.de'
I tougth it was better to have a 'parent' named 'Download' and
put all children inside. this can grow quite big as soon as I implement
the plugin system for that.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24 22:57:43 -02:00
Tomaz Canabrava
216f9212b9 Added the skeleton for the Download / Upload from Divelogs.de
Added the skeleton code for the Download / Upload from Divelogs.
de webservice. Now I need to hoopup things from the .ui side and
do the actual implementation of the code.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24 22:52:11 -02:00
Tomaz Canabrava
06ba04ab78 fix the string of the subsurfice webservice on the settings.
The setting was 'webservice', but this is too wide, since we are
supporting more than one. changed it to 'subsurface_webservice_uid'

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24 22:39:21 -02:00
Tomaz Canabrava
d2b87e0eb5 Fixed a crash when the user canceled the download from webservice dialog.
Null references, ah, love them.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24 22:38:41 -02:00
Tomaz Canabrava
5eb2cc4594 Created a 'WebService' dialog that will handle download and upload.
Created a WebService dialog that will handle download and upload
from all child based webservices. Also, ported the currently - only
- one webservice to use the new dialog.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24 22:30:21 -02:00
Michael Andreen
695f64a23a Subject: [PATCH] No need to center on dive after editing coordinates.
This is done automatically now.

Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-24 16:58:05 +01:00
Miika Turkia
3e48511318 Export dives in UDDF format
Implement exporting in UDDF format as was done in Gtk version. File menu
exports all the dives, right click on selection exports the selected
ones.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-20 15:26:02 +02:00
Thiago Macieira
f22065874b Remove the "in C" part about Subsurface's description
It's not written purely in C anymore. There's quite a lot of C++ now,
not to mention Perl, XSLT, shell scripting, etc. :-)

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17 20:28:22 -07:00
Dirk Hohndel
75a004d44a Some adjustments to "save as"
The popup menu entries should be all lowercase.
Also we should handle this the same as regular save and open when it comes
to remembering the last path.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17 20:26:38 -07:00
Tomaz Canabrava
ed28628449 Added 'Save As' option on the dive list menu.
This adds the 'Save As' option on the dive list,
very straigth forward, just simple and beauty.
tested and working.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17 20:19:50 -07:00
Dirk Hohndel
8259b1a59a Implement hook up autogroup menu
This tracks the autogroup state remembered in data files. Toggling the
checkable menu item causes the divelist to be marked as changed. This
might actually be untrue - but that's really hard to track so this is the
"better safe than sorry" approach.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17 16:30:32 -07:00
Dirk Hohndel
8f623c2c72 Fix marble losting track of zoom level
Marble had a bug on the way it treats zoom level, there's
no way for it to find out if it's user-input or algorithm input
and when a user clicks on a dive, it spins and centers on it,
but if the user clicks on another dive when it's still spinning,
it will get the zoom in the actual state ( spinning, usually zoom
is far away from the first position ) and continue the spin to the
other position.

This patch works by saving the first location and triggering a
helper function with a timer that will only update the zoom level
if the timer is not active ( and thus, will not get the bugged
zoom state set by the animation. ).

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17 15:00:22 -07:00
Anton Lundin
579d1cb915 Show SAC in the mouseover.
This is really nice to have when looking at specific parts of a dive.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17 14:56:52 -07:00
Anton Lundin
437246d3ed Move sac-calculation to profile.c
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-17 14:54:11 -07:00
Lubomir I. Ivanov
861b524e7a Helpers: move some date related function to qt-gui.cpp
divelist.c:
get_dive_date_string()
get_short_dive_date_string()
get_trip_date_string()

MinGW support for *printf and parameter positions (e.g. %1$d)
is horribly broken. Instead of implementing *proper* support
for this feature Microsoft decide to ignore the standard (again)
and they implement new functions with the '_p' suffix,
such as 'sprintf_p', which seem to be available from a 2003 runtime.
To top that 'sprintf_p' is not really a 'sprintf' but rather
a 'snprintf'.

It seems that the MinGW people ignore the issue and do not provide
wrappers of any sort, or at least for the current recommended compiler
for Qt 4.8.5 on Windows - which is a 4.4.0. A note of warning;
inspecting how MinGW does certain things in headers such as stdio.h,
can ensue bad dreams or other negative effects on to the viewer.

This forces us to move the following functions from the 'back-end'
(divelist.c) to the 'front-end' (qt-gui.cpp) and use QString.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-16 15:04:44 -07:00
Miika Turkia
4c49670cdb GUI for CSV import
This patch implements GUI for importing CSV log files. One is able to
configure what columns contain time, depth and temperature fields.
Pre-configured log applications currently included are ADP log viewer
and XP5. (Both of these use actually tab as separator, so the field
separator currently hard-coded.)

[Dirk Hohndel: minor fixes]

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-16 12:44:07 -07:00
Patrick Valsecchi
4f23ff144f Prettier printing
Going through pixmaps for the profile was not needed and was making our prints
look very pixelated.

In Qt4, QWidget child classes are printed as bitmaps. So appart from
changing the code to print the tables to use a QGraphicsView instead,
there is nothing we can do, so the rest of the printing is still done as bitmaps.

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-16 07:02:06 -07:00
Dirk Hohndel
f96299ea94 Dependencies are too aggressive for version.h
Apparently qmake can't tell that #include "version.h" and #include
"libdivecomputer/version.h" are not the same thing. Instead of spending
another bunch of hours on fixing the buildsystem I decided to just cleanup
the spots where we actually use the version file and rename it to
ssrf-version.h.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 19:54:15 -07:00
Tomaz Canabrava
22afca58bf Fixed the moving around of the InfoPanel on non KDE enviroments.
This patch restores the ability to move the info-overlay panel on the
profile. For some reason the eventFilter wasn't working (and actually,
looking at the code, it really shouldn't, because I didn't see where I set
it to work, maybe someone (me) broke it a long time ago) well, it seems
fixed now at least. :)

Tested on XFCE, Gnome and KDE, with three different window managers.

[Dirk Hohndel: removed debug output]

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 19:40:16 -07:00
Robert Helling
c59d594e00 Printing adjustments
Add units to the SAC in the print-out, reduce max depth in metric to one
decimal place, and leave some more characters of the notes to be printed..

Signed-off-by: Robert C. Helling <helling@atdotde.de
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 10:34:40 -07:00
Dirk Hohndel
252caeea1c Fix stupid editing error
Don't do "obvious cleanups" at 4 in the morning when you can't sleep because
of emotionally draining issues outside of your control... and if you do,
at least compile test them.

This was introduced by me in commit 2f9f46cb0253 ("Random white space
cleanup").

Sorry.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 10:25:53 -07:00
Tomaz Canabrava
34f2a5ecc7 Fixed the Tab behavior on the QCombobox Delegate
This Patch fixes the tab behavior on the QComboBox
delegate. For a QComboBox, tab was being treated as
'cancel' action on edit, but since it will send a
editingFinished() signal, and the Qt::Key_Return
will also send a editingFinished() signal, I couldn't
use that method and had to do a little hack around it.

The code is mostly clean and works.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 09:49:12 -07:00
Dirk Hohndel
6ccb541f1d Random white space cleanup
Because I can.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:37:31 -07:00
Lubomir I. Ivanov
2ec6303f50 printlayout.cpp: Remove convertPixmapToGrayscale()
Function is redundant as we should only render the profile
with a custom color table.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:24:27 -07:00
Lubomir I. Ivanov
2b98d28980 printdialog: Remove the pre-set DPI and some comments
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:24:15 -07:00
Lubomir I. Ivanov
005f8ecf83 profilegraphics.cpp: Use text sizes in plot_text()
Make the active font (fnt) use the 'size' member of the received
text_render_options_t. This allows changing the size of
certain text elements.

For the moment most text elements are set to 12px.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:24:02 -07:00
Lubomir I. Ivanov
88b1e09dee printlayout.cpp: Increase the font size in tables bellow profile
Because of varying font (screen) DPI we use pixel sized fonts
when printing. Apparently 8px does not look that good on Windows
default fonts, but kinda OK on Linux. We compensate by
increasing the font size and table rows to 9px.

Also decrease the padding between the table and profile to 5px.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:23:56 -07:00
Lubomir I. Ivanov
f818ece074 graphicsview-common.cpp: Add more contrast to certain B/W colors
There was a report that the depth and time texts were small
and require more contrast on the B/W print. Use BLACK1 for these.

Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:23:43 -07:00
Lubomir I. Ivanov
7861103139 Print: remove profile border when printing
Custom widget frame styles such as 'Sunken' and 'Raised' which seem to
varry between OS will be captured as well:
http://harmattan-dev.nokia.com/docs/library/html/qt4/qframe.html#Shape-enum

So instead we temporarily set the profile frame to QFrame::NoFrame and
then restore it to the previous value.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14 13:15:58 -07:00
Miika Turkia
080b1bcc5a Enable file selection dialog for preferences
This enabled a file selection dialog for selecting default log file
under the preferences.

[Dirk Hohndel: added missing declaration to .h file]

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14 13:14:09 -07:00
Patrick Valsecchi
291ce1d9ac Fix the DC ceiling in the profile.
entry->ndl is computed and therefore should not be used for showing
the DC's ceiling. That made the DC ceiling jump to 0m when the computed
celing was at 0.

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14 12:30:32 -07:00
Lubomir I. Ivanov
a2a93ff04b Models: fix two potential crashes
CylinderModels::setDive() and WeightModel::setDive() have
potential to pass the 'last' argument to beginInsertRows() as
a negative number which triggers an assert that 'last' cannot
be smaller than 'first'.

Patch attempts to fix that by only calling beginInsertRows()
when there is at least one row to insert.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:31:25 -07:00
Tim Wootton
a014fb1099 Adds missing "EndPress" column header for cylinder table
The end pressure was appearing in the column headed "O2"

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:30:56 -07:00
Dirk Hohndel
f5fbbfddb2 Fix uninitialized variable
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:30:36 -07:00
Linus Torvalds
58b668c714 Fix dive planner sidebar depth units
The dive planner always showed the depth in our internal units, ie
millimeter, in the sidebar that showed the plan points.

That made little sense in metric mode, and none at all in imperial. The
_graph_ showed things in meter and feet.

So make the DivePlannerPointsModel always convert things to and from the
user units.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 20:26:28 -07:00
Anton Lundin
dd3b8210a9 Remove unused arg in plot_cylinder_pressure
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 10:18:07 -07:00
Tomaz Canabrava
beb40ae494 Finish clearing up the TableModels
There are other models ( Tree Models and Model Items
) that are not affected by this commits, this is
already a good cleanup but it can be extended
to also fix those two other possibilities.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 11:42:33 -03:00
Tomaz Canabrava
fac316865c Another Model Cleanup
Conversion of the WSInfoModel, that populates the list
of weigthsystems in the Equipment tab.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 11:13:16 -03:00
Tomaz Canabrava
a4efa8c444 Second model converted to be less boilerplated.
Second model converted to be less boilerplated,
there are right now 7 models that will need to
be ported. each model can remove around 30 to 40
LOC, so this is not such a bigger improvement,
but it's an 'keeping an eye on the future'.

Also fixed a bug where the returned value was dummy.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 11:04:27 -03:00
Tomaz Canabrava
26c87fafc2 Begin to Cleanup the Models, trying to reduce boilerplate.
The Model View system in Qt is *very* verbose, this is the
beginning of a series of patches that will concentrate
the boilerplate somewhere and reduce the amount of lines
and will also try to make the code cleaner and easyer to
understand,

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 10:50:40 -03:00
Tomaz Canabrava
1b9a4f2bf8 Good deal of whitespace fixes and code cleanup.
I just went thru all of subsurface code removing
some whitespaces issues and trying to make the
code prettyer, I also removed a few QString issues.d

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 10:21:04 -03:00
Patrick Valsecchi
1dccf84c67 Added salinity to the Dive Info tab.
Took the opportunity to remove some copy&paste.

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
2013-10-10 07:11:32 -07:00
Patrick Valsecchi
c5a15c6a45 Fixed mix of spaces and tabs in maintab.ui
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
2013-10-10 07:11:18 -07:00
Dirk Hohndel
c74b286e70 Fix potential uninitialized variable
Most of the "possibly unitialized" warnings are bogus, but this one is a
potential real bug.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-09 00:15:46 -07:00
Dirk Hohndel
8e8a631cbc Fix crash when cancelling 'Add Dive'
If selected_dive is -1 get_dive(selected_dive) will return NULL.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-08 23:24:44 -07:00
Thiago Macieira
00eba99039 Compile without depending on the global MAX macro
There's a C++ way for it. And, for some reason, it wasn't defined on my
MinGW build:

qt-ui/profilegraphics.cpp:1006:57: error: 'MAX' was not declared in this sscope

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-07 16:57:54 -07:00
Dirk Hohndel
054406b420 Remove even more code and declarations
There's lots more stuff that can go.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-07 13:43:17 -07:00
Dirk Hohndel
90b0f75d40 Remove info.c/info.h
The one remaining helper function in there was moved to maintab.cpp (which
was the one remaining user).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-07 11:48:14 -07:00
Lubomir I. Ivanov
edd2db6886 Print: allow optional table on top of profile
Patch enables the 'Profile on top' / 'Notes on top'
functionality in the print options dialog.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-07 09:29:40 -07:00
Benjamin
47ca630cc2 Maximum depth of a dive/a series of dives is not show correctly
After selecting a dive or a series of dives, the "Stats" tab shows the
minimum, average and maximum stats for the selected dives. The "Depth"
section does not display the correct value for the maximum depth.

Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-07 09:22:16 -07:00
Dirk Hohndel
b3490213f4 Merge branch 'glib-removal-hack'
Fix obvious merge issue in Rules.mk

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 10:57:16 -07:00
Dirk Hohndel
4d3e74a236 Trying to switch to Qt translation
This compiles and looks about right, but it doesn't appear to work, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 10:42:32 -07:00
Dirk Hohndel
2c4ccc04bd Parse GPS text in C++ and re-implement GPS changed check
This is SO MUCH easier then the convoluted and fragile C / glib code it
replaces.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 10:42:32 -07:00
Dirk Hohndel
4b12f28ca4 First steps towards removing glib dependencies
- remove the build flags and libraries from the Makefile / Configure.mk
- remove the glib types (gboolean, gchar, gint64, gint)
- comment out / hack around gettext
- replace the glib file helper functions
- replace g_ascii_strtod
- replace g_build_filename
- use environment variables instead of g_get_home_dir() & g_get_user_name()
- comment out GPS string parsing (uses glib utf8 macros)

This needs massive cleanup, but it's a snapshot of what I have right now, in
case people want to look at it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06 10:41:44 -07:00
Robert C. Helling
05eabae62a Modify the dialog text for the question to make more sense.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-05 19:48:39 -07:00
Benjamin
ae713763c7 Add a helper function to calculate weight display string
Add a helper function to unify the calculation of the
weight display string, instead of having the same calculation
in two places in the code.

Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04 11:57:28 -07:00
Dirk Hohndel
f63605e02e Merge branch 'bugfixes' of git://github.com/tcanabrava/subsurface 2013-10-04 11:12:11 -07:00
Tomaz Canabrava
834800a179 Fix display sane values on subsurface at first time opening.
This patch fixes some unsane values that was being retrieved
by the ui-files on first time opening. it creates a basic layout
of the application using the current desktop size.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-04 15:07:36 -03:00
Tomaz Canabrava
3c97cc5b6a Fix showing all columns by default on first run.
Some columns are a nice addition, but not a must have,
and thus are hidden-by-default, uncluttering the user interface.

This was discussed with a few designers before writting the code,
and also discussed with dirk on irc.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-04 14:28:49 -03:00
Patrick Valsecchi
36c28089db Added the .ssrf extension to the open dialog filter.
Fixes #205

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04 09:46:26 -07:00
Benjamin
fb5ae28865 Correct spelling of "weight" throughout the code.
"Weight" was misspelled "weigth" in several places in the code
and comments.

Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04 09:40:56 -07:00
Benjamin
9961cf13b1 Use the same conversion grams->lbs in dive and equipment list
Subsurface stores weight values in grams. When displaying lbs,
the dive list was not rounding the converted weights up, but
rather truncating the value at the decimal place. The equipment
list was rounding the converted weights up. This gave two
different displayed values for the same weight value.

Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04 09:40:05 -07:00
Tomaz Canabrava
30bee57b60 Code Cleanup - Uneeded preferences stored at the old prefs setting
Those preferences removed ( basically the ones about visibility of
the List View of the Table ) are now managed by the Qt Settings
system, and thus there's no need to have them there. wich gave us
a pretty good cleanup.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-04 13:17:37 -03:00
Patrick Valsecchi
c28fe00bfe Added configuration options for vertical speed units.
Some people (free divers) are loving ft/s or m/s units for vertical speeds.
Now they can choose between /min or /s in the configuration (only Qt UI).

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-04 09:16:39 -07:00
Tomaz Canabrava
a5b351ed72 Fixed First run of subsurface - Start on Fullscreen.
For a new installation, subsurface will now start on fullscreen,
this fixes the bug where subsurface would start using the interface
file ( mainwindow.ui ) configured size, and that silly monster
always changes when editing something.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-04 12:28:40 -03:00
Tomaz Canabrava
7bd43bfaaf Fix the first load of Subsurface - "File not found" error.
The first time the user loads subsurface, the default_filename
is not configured yet, but yet the software tries to load "",
sending an error message that this file doesn't exists.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Taiane Ramos <exhora.tat@gmail.com>
2013-10-04 12:12:46 -03:00
Thiago Macieira
b3b729e629 Partially revert 7a368ab06b
If we #include "qt-ui/ui_anything" from anywhere, the Makefile rules
will blow up.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 15:45:06 -07:00
Anton Lundin
d53d00db02 Lookup gas via the plot_data, not the event
When straight decoding the event, it failed to handle older
SAMPLE_EVENT_GASCHANGE(11), the ones without he-part correctly. This was
shown clearly when it printed the 21/35 in dives/test20.xml as air.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 13:49:06 -07:00
Thiago Macieira
ad52301ca7 Turn off Qt including the C++ Standard Library headers
We don't use any of the Standard Library features or classes in
Subsurface, except for three uses of std::sort, for which I added the
necessary #include.

It's always a good idea to include directly the headers you want,
without relying on indirect inclusion

On my machine, the build time dropped from 16.96s to 13.38s or a 12%
improvement.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 13:47:24 -07:00
Dirk Hohndel
7a368ab06b Better fix for the compile problems
Still don't like the order dependency - but at least this seems to work
and correctly build after make confclean.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 13:21:36 -07:00
Thiago Macieira
8e81d3f100 Make the classes generated by uic be real members of our classes
This means we don't have to new/delete them, which is a waste of
overhead.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 12:13:48 -07:00
Thiago Macieira
f0f76056ac Include the ui_*.h headers in the main headers.
This means we can also remove the forward declarations.

This is the first step in removing the memory allocation for the ui
sub-classes. Without the second step, this commit is just making the
compilation time increase for no good reason :-)

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 12:13:15 -07:00
Lubomir I. Ivanov
c79def40b1 Print: small adjustments to table printing
PrintLayout::printTable():
- hide the QTableView widget border using a stylesheet
- add a guard to fix the last column extending post the page width
due to rounding
- use 1 extra pixel instead of 2 when grabbing the page region

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 09:39:16 -07:00
Lubomir I. Ivanov
e727b899a6 Print: provide means to print profile tables
This patch adds a couple of classes and some other modifications
in PrintLayout that handle the printing of tables under a profile.

models.h : ProfilePrintModel
The class uses a 'struct *dive' to output all required data
for a certain dive at specific rows and columns. It also handles
font formatting and text alignment.

modeldelagatates.h : ProfilePrintDelegate
The class is used only for drawing a custom grid for profile tables.

PrintLayout::createProfileTable()
The function is used to create and setup the profile table object

PrintLayout::printProfileDives()
The function now has correct padding of dive profiles on a page
and also the printing of actual tables below them.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 09:38:37 -07:00
Lubomir I. Ivanov
374f3d0de6 Profile: use a 10px font when printing profile text
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 09:38:26 -07:00
Patrick Valsecchi
adefc8805a Added a spacer at the bottom of the dive info and stats grids
Fixes #204

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-01 09:50:43 -07:00
Patrick Valsecchi
f02b5e5d90 Fix weight adding in the Qt UI & fix the header height for tables
Fixes #203

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-01 09:49:41 -07:00
Patrick Valsecchi
413f649ad8 Make the renumbering of dives accept numbers up to 99999
Fixes #201

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-01 09:47:33 -07:00
Dirk Hohndel
ff0b2745a7 Merge branch 'toolbar-ruler-rb' of github.com:mguentner/subsurface 2013-09-27 10:03:13 -07:00
Maximilian Güntner
a3ce871e0a correct the placement of pressure markers
Adding +30 (seconds) to the position works fine for long dives but
when zoomed in on short dives, 30 seconds are a lot.
This commit sets the offset to +10 px regardless of the scaling.

Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-09-27 18:45:07 +02:00
Maximilian Güntner
88172571ca Added a toolbar to the profile
The toolbar adds two buttons to the profile.
The user can now toggle the scaling (zoomed to dive/round up to 30 mins)
and adding /removing ruler to/from the profile using this toolbar.

Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-09-27 18:45:04 +02:00
Maximilian Güntner
248f1b86d1 Added a ruler which can be dragged along the profile
This patch adds a ruler QGraphicsItem which can be dragged
along the profile. The ruler displays minimum, maximum and
average for depth and speed (ascent/descent rate). Also, all used
gas will be displayed.

This also adds a new attribute to struct plot_data to store the
speed (not just as velocity_t).

Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-09-27 18:42:19 +02:00
Maximilian Güntner
3312c9a3a4 implemented zoom action
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-09-27 18:37:53 +02:00
Maximilian Güntner
59736a9d96 plot seconds with a fixed width of 2
before: 0:50 1:0 1:10
after:  0:50 1:00 1:10

Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
2013-09-27 18:37:53 +02:00
Lubomir I. Ivanov
df8107830e Print: provide means for profile layouting
printlayout.cpp(h):

This patch cleans some test code and adds the function
printProfileDives() that accepts a number of dives
per rows and columns. It can technically fit any number
of dives on a page given the page size allows it. Both
landscape and portrait layouts are supported.

It now replaces the old methods:
printTwoDives()
printSixDives()

Space is reserved for data tables that will be placed
bellow profiles on a later stage.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-27 09:29:30 -07:00
Tomaz Canabrava
e81bbc1dab Hack to make the subsurface work on Gnome3 shell
The Gtk+ style on the Gnome shell is somewhat broken on Qt for
some reason. This hack pokes the system, checks if it's running
gnome-shell, and if the current style is gtk+ ( I couldn't just
check for gtk+ since it worked on XFCE and other Gtk based enviro
ments. so a double check is needed. ) then I changed the Pallete
of the affected widgets by hand.
not a pretty hack but worked.

[Dirk Hohndel: redid the patch to be simpler and more consistent]

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-27 09:22:19 -07:00
Tomaz Canabrava
d629321799 Fix the positioning of the add button when on Gtk style
Fix the positioning of the `add` button when on Gtk style,
in my XFCE install (and thus, may differ a bit from the
Gnome3 one ) the Plus button to add cylinders and weigths
got really strange placements, this seems to fix this,
I also tested on Oxygen and nothing broke there.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26 20:35:30 -03:00
Tomaz Canabrava
b036a318c6 Fix the edition of cylinders and weigths by keypress
This patch fixes the cylinders and weigth edition
by keypress. I don`t know when I broke this and linus found,
most probably when I added the code for showing the
cylinder size and working press while moving the mouse
around the list - sorry guys.

So, now this *seems* fixed, tested for a fairly good
amount of time and everything seemed ok.

I was unable to reproduce the behavior that linus got
on two value overlapped on each other, tougth.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26 19:59:58 -03:00
Tomaz Canabrava
098aa6343b Fixed the display of Subsurface in Smaller Screens
This patch fixes the display of subsurface in smaller
screens by creating ScrollArea containers that are
now englobbing each of the Tab-pages and the Planner
Widget. Some of those widgets were pretty big by the
amount of things on it and it was too big for small
( 14" and 15" ) screens.

This seems to fix it, and looks good both on Gtk+ and
Oxygen styles.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26 18:14:09 -03:00
Tomaz Canabrava
57ebed9dd0 Only set documentMode on tab if in Oxygen style.
This is much better looking in the Oxygen style, and
on the other styles it looks like crap - so let`s not
use that.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26 17:02:27 -03:00
Tomaz Canabrava
28dd4d144a More cleanup for the Gtk+ Style
This patch eliminates 18px offset from the MainWindow main
layout, making the window feel less spacy. Good on the Gtk+
style, but seems to also make a good work on the Oxygen one.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26 16:55:41 -03:00
Tomaz Canabrava
8f94b904dd Cleanup the prettyness of subsurface on Gtk+ style.
Fix some stuff concerning the pretyness of subsurface while running
on Gnome and XFCE enviroments. This is the kind of stuff that I
really didn`t want to put on the code but sometimes it`s for the
best. this makes the MainTab much more bearable. There are still
things to fix, like the size and positioning of some of the icons.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26 16:51:11 -03:00
Tomaz Canabrava
d6f2988bcf Code Cleanup, less magic indexes.
This patch removes the magic indexes used to control the mainwindow
display of the profile and planner by an enum. a bit more verbose
but hard to miss.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26 11:14:40 -03:00
Tomaz Canabrava
fd7a671a1d Set the Cylinder/Weigth even if it's the same old value.
Since the cylinders and weigths have other data attached
to it, like size and working pressure, one could mess the
other data and want it to revert to the cylinder / weigth
defaults, but for that the user had to choose another
item, then go back to the previous one, so the cache would
be clean.

This patch fixes that by reverting the values to the
it fixes linus bug n2, where he had invalid data
on the other fields and had to go back and forth for it
to be fixed.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-26 10:26:58 -03:00
Tomaz Canabrava
e6be14bf10 Make the Qt ComboBox behave in a Better Way
So, the ComboBox is a beast, and when used on a Delegate
it's very hard to get things right, wich is a pitty, because
I overly like qt. So:

1 - Combobox needs to show the popup when user press ↓ and ↑ keys
2 - Combobox needs to select when user press enter, not twice.
3 - Combobox neesds to select when user selects from the mouse, not
pressing enter after.
4 - Combobox needs to not mess with stuff when moving around.

Everything that I listed there works on a non-delegate combobox,
but for some reason, a delegate missed those, so I reimplemented
all. not nice, but now we have a code that will work, I hope.
*fingers crossed*

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25 12:48:24 -07:00
Tomaz Canabrava
bc837163f5 Hook 'Add' from cylinders and weigths to enable Edition
This code hooks the plus button on both cylinders and
weigthsystem tables to trigger the enableEdition() and
thus the work done when you click on + will be saved /
discarted when the user cancels the plan or accepts it.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25 12:48:24 -07:00
Tomaz Canabrava
2819ee6510 Code cleanup
Fixes a couple of whitespace issues.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25 12:48:17 -07:00
Tomaz Canabrava
d9067582a9 Set the Cylinders and Weigths to all selected dives after pressing 'Accept'
This bit of magic actually performs the save on the
dive list for the changed weigths and cylinders,
it will set the cylinders only if there's a change
on the cylinder model, and it will set the weight
only if there's a change in the weigth model.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25 14:57:41 -03:00
Tomaz Canabrava
8ce5d91dfe Code cleanup - create a method for cleaning the Palette.
Code cleanup, create a method for cleaning the palette,
less code is better in this case. :)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25 14:36:59 -03:00
Tomaz Canabrava
94c8f64316 Only mark dive list as changed if 'Accepted' was clicked.
The old code marked the dive list as changed on any
of the changes in the model, this was incorrect since
the user could just cancel the edition, wich means
that the divelist shouldn't be marked as changed at all.

when the user clicks on'accept', and the item is indeed
changed on the dive list, then we mark_divelist_changed
to TRUE

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25 14:30:03 -03:00
Tomaz Canabrava
2c14f3aa3b Added a 'changed' member on Cylinder/Weigth models to know when to Apply a change.
Added a 'changed' member on Cylinders and weigth models to mark when
one was changed or not. Only the changed data should be inserted on
the selected dives, so if the user changes the cylinders on a multi
edit, there's no need ( and it will actually break things if we did that )
set the weigths too.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25 14:23:51 -03:00
Tomaz Canabrava
c805e2c941 Enable Edition by clicking anywhere on the Cylinders and Weigths.
This patch enables edition on the selected dives as soon
the user press delete or any other column on the Cylinder
/ weigthsystem.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25 14:11:38 -03:00
Tomaz Canabrava
26cec576ee Revert to the old values of Cylinders and Weigthsystems on cancel
This patch enables canceling the edition of cylinders and weigth
systems, as soon as the user press cancel, the old values are
re-populated on all selected entries.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25 14:10:15 -03:00
Tomaz Canabrava
4f0112c420 Created a placeholder for the Equipment Edition.
This creates a placeholder for the equipment edition,
it will ease the 'revert' and 'apply' when editing
multi dives.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25 13:30:51 -03:00
Dirk Hohndel
72f0516f6d Disable info widget when canceling 'add dive' for a first dive
One more corner case that we cover correctly.

Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-24 12:32:18 -07:00
Dirk Hohndel
446ab45858 Only offer to merge dives if they are consecutive in the divelist
You cannot merge dives if there is another, unselected dive "between"
them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-24 03:42:40 -07:00
Dirk Hohndel
2d40172d78 Much easier way to detect if more than one dive is selected
Instead of getting data from Qt just use our internal notion of the number
of selected dive to decide if more than one dive is selected (and
therefore if we need to show the 'merge dives' option in the context
menu).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-24 03:02:02 -07:00
Dirk Hohndel
be418458db Add "merge selected dives" to dive list popup menu
This is fairly straight forward. What I dislike is the check for the magic
number of "14 indeces". I'm sure there's a better way to tell if more than
one dive is selected...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-23 21:57:28 -07:00
Dirk Hohndel
c6140c6e21 Call refreshDisplay() after editing a dive
We now can change the dive date and the order of dives could have changed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-23 21:14:40 -07:00
Anton Lundin
0c9e6f9acc Remove o2/he from plot_data and fix gas plot text
plot_data.o2 and plot_data.he was wrong for all dives, due to that
cylinderindex was set right first in populate_pressure_information, and
thus those two contained bogus information.
This makes the plot-text use cylinderindex-lookup as everything else.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-23 21:05:35 -07:00
Dirk Hohndel
dba16202c4 Correctly handle empty dive list after delete
Things need to be cleared out and disabled. But fixing this bug leaves
another issue - while the newly selected dive after a delete acts as if it
was selected, it doesn't show up as selected in the dive list.

Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 22:24:28 -07:00
Dirk Hohndel
6ce5704435 Support imperial measurements in dive planner / add dive
This was not as hard as I assumed it would be. I may still change the
horizontal dimension to be the more logical seconds instead of minutes,
but for now this achieves the main goal.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 12:37:49 -07:00
Dirk Hohndel
ff58fd7dca Whitespace fixes in dive planner
I know this may seem anal retentive... but it's driving me insane.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 12:34:50 -07:00
Dirk Hohndel
9ba7b12767 Prevent nodes in planner / dive add profile edit to run past each other
I always disliked the fact that when you moved the handlers around you
could just 'run over' the neighbors. This also (as a somewhat intended
side effect) prevents vertical descents and ascents).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 11:01:18 -07:00
Dirk Hohndel
799b56a1f3 Don't exit profile editor when hitting ESC in dive add mode
I'm sure there are more issues like this where we need to handle things
differently depending on whether we are planning a dive or adding a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 08:45:14 -07:00
Dirk Hohndel
9820ca5eda Fix tab order for dive info edit
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 08:37:54 -07:00
Dirk Hohndel
3335f083bf Disable the info widget when no dive is selected
This solves the odd case when closing the data file that clicking in the
info widget caused the input fields to respond and the little warning icon
to show up.

Also some minor whitespace cleanup for readability.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 08:20:03 -07:00
Dirk Hohndel
88fb82411e Hack to clear the date when no dive is displayed
This mostly happens with no XML file or when closing the current XML file.
Sadly the user still can click on the empty date field (even if nothing
else is active on the screen) and a date reappears.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 07:33:09 -07:00
Dirk Hohndel
765e5b76e6 Fix crash when closing the data file
Only dereference the dive pointer if there actually is a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 07:05:03 -07:00
Dirk Hohndel
21b7ebbaf0 Fix crash when adding dive to empty dive list
Only look up the dive number of a previous dive if there is a previous
dive.

Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 07:00:14 -07:00
Alexandre Dupas
5935f372ab Fix enabling info widget when closing a dive
If the close action is triggered while there is no current dive (empty
history), the info widget is enabled. To avoid this behavior, we only
enable the info widget during update if the dive index is valid.

Signed-off-by: Alexandre Dupas <alexandre.dupas@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22 06:54:34 -07:00
Dirk Hohndel
b1a3c1047a Simplify the default dive profile given in add dive
Suggested-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-21 08:56:19 -07:00
Dirk Hohndel
5e6ed53e40 In planner / add dive use 'ESC' to hide the gas selection popup
Not sure if there are other keys we should support.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-21 08:50:09 -07:00
Dirk Hohndel
a8888eaf26 Allow editing of date & time and air & water temperatures
Add two more rows to the widget - this is getting quite busy.
There still is some weirdness where the focus isn't returned where it
should be and a few other details, but overall getting there.

Added helper functions to parse a temperature and to deal with the
timezone offset - with that latter one I also fixed the time offset bug in
the planner.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-21 08:30:32 -07:00
Dirk Hohndel
acd3599548 Adding a dive changes the dive list
Duh.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-20 07:53:06 -05:00
Dirk Hohndel
5f4aec867e When manually adding a dive, start with a simple dive
This is much friendlier than just showing an empty profile. I picked a
nice and simple three level dive. 25 minutes at 18m, 15 minutes at 9m, and
a safety stop.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-20 07:38:15 -05:00
Dirk Hohndel
e04acd4189 Simplistic solution to add dive number to dive added
If this is the last dive and if the previous dive had a number, give this
dive the next number.

Of course there are a couple of issues with the current implementation. We
have no way of changing the date / time of the added dive, so we KNOW that
it will be the last one. But I put that check there so that once we add
the ability to change the date / time (and hopefully remember to then move
the dive to the correct spot in the dive_table), we only assign a number
if it is the last dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-20 07:17:35 -05:00
Dirk Hohndel
46c23c53a1 Merge branch 'addDive'
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19 23:05:17 -05:00
Dirk Hohndel
6881f52739 Hook up cancelling out of adding a dive
This was surprisingly easy - which of course has me worried that I'm
missing something that I should do when cancelling out of this dialog.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19 22:58:53 -05:00
Dirk Hohndel
46b125782e Hook up adding a dive
This gets things mostly right.

It creates a dive and uses the planner widget to create samples which are
copied into the dive. It fills in some reasonable defaults (DC model,
timestamp), but doesn't allow editing the timestamp (or the temperatures
and air pressure).

On accept the planner gets reset and the dive appears correctly in the
dive list.

Cancel still needs to be handled.

And I bet there are many subtle bugs lurking here and there. But it's a
start.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19 22:54:00 -05:00
Michael Andreen
583cea0e2c Fixes for gps coordinates handling.
Reset coordinates properly when clicking undo.

When auto-completing location, only copy coordinates if they have not
been manually edited.

Set the background to red if the gps coordinates won't change, e.g.
there is a parse error, the change is too small or only whitespace
changes.

Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19 11:56:12 -05:00
Robert Helling
fc3b68bc19 Continous update of planner
Make the planner update its display continuously upon moving points
including deco. This appears fast enough on typical PCs. If this ends up
being to slow on some systems we may have to make it configurable.

[Dirk Hohndel: cleaned up the two patches and turned into one commit]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19 09:13:53 -05:00
Dirk Hohndel
5a96389cd3 Fix updateDiveInfo to clear coordinates when called with invalid dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18 23:08:39 -05:00
Dirk Hohndel
64b014aefb Don't show the planner widget when adding a dive
This looks like it might work, but since we keep recreating the dive, the
info entered in the info pane is actually lost. But it's a step in the
right direction.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18 23:02:53 -05:00
Dirk Hohndel
56535e4b3b Only calculate deco stops in planner mode
In add dive mode simply bring the diver safely back to the surface
(currently with a fixed ascent rate of 30ft/min (or 9m/min)).

We should make that rate configurable (for the planner as well as the dive
add function). Also, the dive add function should offer to automatically
include a safety stop.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18 22:40:34 -05:00
Dirk Hohndel
4141c68450 Rename createDecostops to drawProfile
After all, that's what the function does.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18 22:19:49 -05:00
Dirk Hohndel
882b2c146b Use Planner dialog to add dive
Right now this is just calling the same code and setting a flag whether we
are planning or adding a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18 22:18:10 -05:00
Dirk Hohndel
40462d5008 Fix the annoying tab order issue in the notes tab
This had been driving me crazy for a while, finally figured out how to fix
it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18 22:15:09 -05:00
Tomaz Canabrava
df63bcd8b7 Added the Message and the Buttons on the Equipment Tab
Added the Message and the ok/cancel buttons on the Equipment
Tab, they don't control the Equipment edition yet, but already
does the same as the Notes one, Now I need to merge the other
part - the actuall Equipment Edition.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-18 23:23:04 -03:00
Tomaz Canabrava
506b133875 Add a Warning icon on the changed tabs, for edition of dives.
Adds a Warning icon on the changed tabs, this is important as
usability, for you could change something on the 'notes' tab,
change the tab and did't realized that something was changed
( by forgotting or something ), then clicking on the cancel
button. so now there's a friendly reminder that you actually
changed something.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-18 22:38:38 -03:00
Tomaz Canabrava
bcefa4baff Good deal of Code Cleanup for the maintab
Some cleanup was needed in the MainTab code for ages,
now the Edition / Cancel / Ok of the Notes tab is
way more intuitive on the code level.

This is needed to support multidive edition on the
Cylinders and Weigths too, since it's a bit more
complicated, I didn't want to start with a Spaguetti
Code.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-18 21:56:53 -03:00
Tomaz Canabrava
955c1c1fe5 Show DiveNotes when program starts.
Equipment tab was opened by default, it should be DiveNotes
as per the old GTK version. this fixes that.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-18 20:56:43 -03:00
Anton Lundin
7d9c1e9ee4 Show sample time in the mouseover.
This is really nice to have when looking at specific coutures of a dive
or events.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18 11:59:53 -05:00
Danilo Cesar Lemes de Paula
608209fff2 move process_dives to the mainthread
Avoids a race condition.

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-09-17 18:46:02 -03:00
Linus Torvalds
f8e33e171a Fix SIGSEGV after dive computer download
This fixes a crash in the current Qt subsurface code that can happen
after downloading dives from a dive computer, and the new dives merge
with old dives, causing the old dives to be re-allocated into the
merged one.

In that case, the list widgets don't get fully updated, and contain
stale pointers to old dives that no longer exists. Doing anything that
refreshes the display will hide this problem, and you do need to have
multiple dive computers on the same dive to trigger it in the first
place, so it's reasonably hard to hit, but very annoying when you do.

This patch just makes us reload all the dive UI tables, which may be
overkill. It also doesn't actually fix the fact that we seem to do
"process_dives()" within the context of the downloader thread, which
looks like a possible source of races. The "process_dives()" should
also be moved to the main thread, but needs the preferDownloaded()
information that is part of the download window, so it doesn't fit
here. Somebody else (Tomaz?) will hopefully fix that part.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17 17:21:41 -04:00
Michael Andreen
1d76ccb8b9 Improved handling of latitude and longitude.
Coordinates are copied when auto-completing location, they are also
displayed and editable in maintab.

Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17 16:48:36 -04:00
Anton Lundin
25a2d6e6f9 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

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17 07:31:55 -04:00
Dirk Hohndel
88b7ac3d08 Planner: start time is relative
This almost fixes it, but the offset from UTC isn't calculated correctly
it seems. Committing and hoping that a Qt expert can help.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-16 23:17:24 -04:00
Dirk Hohndel
f138006d1a Merge branch 'deviceProbe' of github.com:danilocesar/subsurface 2013-09-16 22:03:43 -04:00
Danilo Cesar Lemes de Paula
a8d33f80b0 implement device probe in C
It's an attempt to build auto-completion for the dive-computers
based on unpublished code inside libdivecomputer[1]

[1] -
http://git.libdivecomputer.org/?p=libdivecomputer.git;a=commitdiff;h=d44053a99435fb9fc1f408fb3f1629a54c938afc

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-09-16 22:40:47 -03:00
Dirk Hohndel
396d73705e Merge branch 'multiDiveEdition' of https://github.com/tcanabrava/subsurface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>

Conflicts:
	qt-ui/maintab.h
2013-09-16 20:52:01 -04:00
Tomaz Canabrava
242ef056f6 Plotted the Scale on the Ruler ( depth / time ) on the planner
Plotted the Scale on the Ruler in the planner.
There's a tiny bit issue - mostly noticiable while resizing,
but it's not a killer.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16 20:10:12 -03:00
Tomaz Canabrava
493f366765 Use the same line dimensions as the profile, on the planner.
The Planner should be 'almost' like the profile, with the possibility
to use the mouse and keyboard to input a new plan, so this is a bit
of 'getting there.' I don't like too much code duplication but since
the current Profile Graphics is a crude cut-and-paste from the old
Cairo backend, it's easyer to start from scratch and have it well
organized as Qt code.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16 19:21:13 -03:00
Tomaz Canabrava
f74799d581 Ok on the planner now correctly creates a Dive.
Ok on the planner now correctly creates a dive,
a few remarks, tougth:

1 - the number of the added dive is always 0
( but I may be testing it wrong )

2 - the information pane is working only when
the mouse is clicked, this is a regression and
it will be fixed. ;)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16 12:30:58 -03:00
Tomaz Canabrava
fad55b3047 Move the creation of the dive plan to the model
The dive plan was bein created on the Profile, this
While this worked out, it created a bit of spaggethi
code, so now the model will take control of *everything*
on the planner.

I tested it quite a bit and doesn't seems to have appeared
a regression, wich is good.

Now that a dive plan is bein created, I can just save it. :)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16 12:11:06 -03:00
Tomaz Canabrava
bfe1ea0cb2 Plug the Cancel action on the Dive Planner Table and start the 'ok' code.
Plug the cancel action on the dive planner ( before that, only by
hitting the 'ESC' button things worked, so now you can also click
on the Cancel box that's on the right of the planner profile window.

Also, the beginning of the 'ok' code is also at place.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16 11:38:41 -03:00
Tomaz Canabrava
4e06c52f68 Position the X and Y labels of the Rulers
Position the X and Y labels of the rulers, this way
it's a bit more clear the deepness and the length
of the trip. It's still not the best approach, but
I'm getting close.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16 11:09:54 -03:00