Commit graph

2906 commits

Author SHA1 Message Date
Anton Lundin
ac207ee5ff Emit the successful message the right way
The successful message was emitted in a some what older way then the
other messages so it was always emitted, even on error.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:38:50 -08:00
Anton Lundin
8b371cf8c6 Copy all cylinders when (re)planning a dive
This changes the code so we include all the cylinders from a previous
dive when we re-plain a dive.

Otherwise we would have a hole in the cylinders table when we plan a
dive based on a dive where we have unused cylinders, and it makes more
sense to copy all of them rather than not.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-04 16:27:46 -06:00
Robert C. Helling
aa22e0610c Don't interpolate pressure while dragging waypoints
A profiler session in the planner shows that for deep long dives
a significant amount of CPU time is spent in populate_pressure_information()
which interpolates the cylinder pressure graphs.

This patch introduces a "fast" flag for the replot of the profile
which is active while the mouse button is still pressed and that
suppresses this calculation.

In the future, this flag could be used for other responsiveness tunings
of the plot.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-04 16:26:47 -06:00
Robert C. Helling
fb265c2929 Context menu entry to change setpoint
This patch adds a context menu entry to add a setpoint change
event. In particular, this can be used to turn a logged dive into
a CCR dive.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:23:45 -08:00
Robert C. Helling
96a94f1a19 A widget to add a set-point change
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-01 14:19:03 -08:00
Miika Turkia
11be32645b Tuning the manual CSV import dialog
This allows more space between the input fields in the dialog.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 13:19:54 -08:00
Miika Turkia
1b74947bf5 Allow user to select date format on manual CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 13:19:49 -08:00
Tim Wootton
3b3d8949f7 Correct diveplan as it's dive plan everywhere else in planner
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 13:18:29 -08:00
Tim Wootton
93d59c22d7 Match agreed captalisation style
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 07:57:33 -08:00
Tim Wootton
f72ec5e29b Consistent representation of O₂
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-25 07:57:28 -08:00
Miika Turkia
42dbecae17 Tooltips for some of the manual CSV import fields
Date and duration formats are not necessarily self explanatory so adding
tooltips to explain the expected format.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-24 09:42:19 -08:00
Robert C. Helling
4a751750e0 Reset plot info pointer when painting several polyons
For each polygon that we paint we have to step through the
plot_info from the start again.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-24 06:50:19 -08:00
Dirk Hohndel
bf14d31804 Make the button labels for apply / cancel of edits more consistent
Before you could 'Cancel' the edit and then would be asked if you wanted
to 'Discard' your changes or 'Cancel'. So clicking 'Cancel' cancelled the
action of having clicked 'Cancel'. That's so confusing, it's even hard to
explain. Yes, it uses "typical" language for user interaction and kind of
makes sense, but it's not easy to understand for the non-technical user.

With the new labels the user is asked to whether they want to 'Apply' the
changes or 'Discard' them. And when they choose 'Discard' the verification
question is still 'Discard' or 'Cancel'. That seems much more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-23 07:45:17 -08:00
Robert C. Helling
13934b0f02 Check error code of get_cylider_idx_by_use()
If not cylinder with type DILUENT or OXYGEN is defined, this function
returns -1 which should not be used as an index to an array. This
patch adds code to check for this return value and exit gracefully.

On line I marked with a comment. Someone more knowledgeable of that part of
code than me should double check that return is here what we want.

[Dirk Hohndel: fixed small oversight...]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-22 16:22:57 -08:00
Dirk Hohndel
38bbed978a Use our own file open dialog
Clearly the static dialogs don't work. Even with the previous commit the
dialog still said "Save" insted of "Open". So let's just assemble our own
dialog and be done with it. I hope I got all the options right...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-22 16:06:01 -08:00
Dirk Hohndel
ba1631f52d Don't ask confusing questions in open file dialog
Using the SaveFile dialog to open a file caused it to ask the user if they
wanted to overwrite a file when they actually tried to open an existing
file. This fixes that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-22 07:47:25 -08:00
Dirk Hohndel
fc7f0c6215 Use getSaveFileName() as the file open dialog
This way we can specify file names that don't exist and therefore make our
git syntax (/path/to/dir[branch]) work.

Thanks to Tomaz for pointing this out.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-21 09:46:24 -08:00
John Van Ostrand
21675de534 Small changes to Yearly Statistics window
Added a title bar with close button.
Set an appropriate title.
Centred the window relative to mainwindow.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-20 07:47:20 -08:00
Dirk Hohndel
3dc864f1b1 Profile: adjust tank pressures at gas change (incomplete)
This code sets up the UI that will allow the user to adjust tank pressures
at a gaschange event. The actual changing of the pressure is not
implemented, yet, so this is disabled until someone finds time to do so.

The scenario is this: a tec diver or sidemount diver without pressure
sensors on at least one of their tanks still wants to reasonably
accurately track gas consumption during a dive. The diver takes notes of
the pressures at every tank switch (I find that odd, but apparently some
cave divers indeed do that as they switch back and forth between different
gases) and then wants to adjust the pressures in Subsurface to match those
written down.

One difficulty here is that the first and last pressure of a tank with no
sensor data is still considered "sensor pressure" - this is basically an
implementation detail in the code that is used to do the pressure
interpolation to have constant-SAC pressure plots for tanks without
sensors. So when we check if there is indeed no pressure data available at
the gas change, we can't just work with the interpolated pressure - if
this is the first (or last) time the tank was used, that pressure may be
marked as sensor pressure.

What's missing is the UI to enter the desired new pressure plus the black
magic that actually inserts this into the dive in a way that doesn't break
the assumptions in the rest of the code. I'm running out of time to do
that but wanted to preserve this code so someone can continue this later.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 16:29:27 -08:00
Dirk Hohndel
f2a2ded04e Profile: don't offer to switch to an already active tank
Adding a gas change to tank that we are already breathing from makes no
sense, so let's not offer this.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 22:44:33 +00:00
Dirk Hohndel
639e079131 Profile: add helper function to get the sample entry for a mouse position
This seems quite useful to have.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 22:40:42 +00:00
Dirk Hohndel
21658383e5 Profile: keep the plotInfo in the corresponding member variable
We had the variable. As a pointer. Which we used memset to clear. Ouch -
that smells like some bad cut and paste.

With this change the object keeps the corresponding plotInfo around (just
like some others do) and can use it later. I suspect this code could use
some larger cleanup, but it's a bit too late for this in the development
cycle, I guess. I'm sure I'll regret this in the future...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 22:28:16 +00:00
Dirk Hohndel
76c44dd6a3 Don't offer to add a gas change if there is ony one gas
In the context menu of the profile it makes no sense to offer the ability
to switch gases unless there is a gas to switch to.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-19 22:15:33 +00:00
Dirk Hohndel
1723c01603 Replace other references to hohndel.org
The only place where I'm not sure if there are unintended sideeffects of
changing over to the new domain is QCoreApplication::setOrganizationDomain

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18 13:13:39 +00:00
Dirk Hohndel
fe2c46a5b7 Move update check and survey to the new domain
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18 13:01:54 +00:00
Dirk Hohndel
e157f6220f Don't use DC configuration menu item as preference dialog on Mac
Qt by default uses a rather simplistic text heuristic to figure out if a
menu entry is one of the special ones that need to be moved into the
application menu (About, Preferences, Quit - but for Preferences anything
that matches settings, options, config is used as well).

This patch tells Qt to keep its hands off the the DC configuration entry
in the menu.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18 06:08:00 +00:00
Dirk Hohndel
99531579e3 Only show tags in filter panel that are actually used
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 21:15:35 +00:00
Lubomir I. Ivanov
609036c570 Ruler: fix weird behaviour near x = 0
RulerNodeItem2::recalculate() does something which is
apparently not a good idea in combination with
RulerNodeItem2::mouseMoveEvent().

Each time the mouse moves, setPos() is called. Then in
recalculate() the x() value is checked and if less than 0
it's changed to x = 0 (setPos(0, y());).

This last call (setPos(0, y());)
however does not work and the value remains less than zero
leaving one of the ruler points outside of the graph.

To solve the issue we add a silly explicit check if x() < 0
before calling setPos() in RulerNodeItem2::mouseMoveEvent().

The 'x() > timeAxis->posAtValue(data->sec)' strangely works
on the other hand.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 21:04:27 +00:00
Dirk Hohndel
3ddbab6847 Clarify the meaning of the values in the stats tab
Extend the tooltips to be shown both on the labels and the values and add
tooltips for all min/avg/max elements.

To avoid confusion when only one dive is selected, no longer show min SAC
or max SAC or min duration or max duration.

Fixes #694

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 18:44:51 +00:00
Dirk Hohndel
f5bea8fcfd Clean up yearly statistics
Remove the unused upper widget, set a somewhat random but at least more
reasonable default size and finally support Ctrl-W and Ctrl-Q shortcuts.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 18:19:51 +00:00
Robert C. Helling
d5d7fdc9af For CCR dives, show plot for diluent and O2 cylinder pressures
Also fixes a bug in the diluent pressure interpolation

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 18:02:42 +00:00
Dirk Hohndel
8856417b2f Allow translation of the cylinder use strings for the UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 14:39:30 +00:00
Dirk Hohndel
0c3f13d128 Add the ability to modify the cylinder use in the UI
Thanks to Tomaz for writing a first draft of the delegate.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 14:03:37 +00:00
Dirk Hohndel
44a154f7da When editing cylinders, copy all relevant data
Maybe it would be better to just copy the whole structure and then clear
the things we don't want to copy? This seems fragile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 10:45:14 +00:00
Dirk Hohndel
7196176fa0 Correctly copy weight systems on edit
We copied the string pointers instead of copying the strings. Once those
got freed, things went downhill.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 10:41:02 +00:00
Tomaz Canabrava
82a946152b 727 fixed
--047d7b8737f87ede8e050803e6b2
Content-Type: text/plain; charset=UTF-8

<div dir="ltr"><br></div>

From 3db4a422485374801ca2f6233ec23b8671a8656d Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tomaz.canabrava@intel.com>
Date: Sun, 16 Nov 2014 23:22:58 -0200
Subject: [PATCH] fix 727 - position correctly the popup.

When the user entered a tag and that made the message box display
the popup with the possible choices was still in the old position
hidding the line edit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17 06:02:21 +00:00
Dirk Hohndel
adc08bba4f Remove bogus strings and add tooltips to filter buttons
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-16 18:55:27 +00:00
Dirk Hohndel
80bdbc348d Divelist trip text includes the number of dives shown with current filter
But only if not all dives in the trip are shown.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-16 18:46:07 +00:00
Dirk Hohndel
e5c70de1ee Remove unused DivesFilteredOut variable
It's kinda redundant, anyway, given that we know the total number of
dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-16 18:39:29 +00:00
Dirk Hohndel
05e02b939a Improve the filter logic
The MultiFilter itself should walk the dives in a trip. This way the logic
(OR within a category, but AND between categories) is correctly applied
and the flags in the dives are set correctly (which makes the overall
counts for dives filtered work correctly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-16 18:36:42 +00:00
Dirk Hohndel
ad603b6e9f Improve the filter message and placement
This makes the text easier to translate (and more meaningful).
Also modifies its position to be centereed in order to look less "squeezed
into the corner".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-16 18:36:42 +00:00
Tomaz Canabrava
7c5c38b154 Addded a min / max layout for the filter, and a filter count
But the filter count seems to be broken for some reason and
I really don't know why. It seems to work for tags, but
not for everything else.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-16 18:34:47 +00:00
Dirk Hohndel
ff193e309c Consistently have a space between file type and extension
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-15 08:01:12 -08:00
Salvo 'LtWorf' Tomaselli
4ef35f0651 Mark string for translation
An error string was left untranslated.

Signed-off-by: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-15 06:02:30 -08:00
Dirk Hohndel
8d766e13e2 Make sure we always have copies of equipment descriptions
Having pointers copied around that might get freed elsewhere could be a
problem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-14 13:45:54 -08:00
Tomaz Canabrava
1055b5afd3 Fix memleak on Pixmap cache
as we load dives and dives, new DiveEvents will be created
but the transparent pixmap never deleted, also this makes
the transparent pixmap only for the correct event, not for
all of them.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-14 13:45:54 -08:00
Dirk Hohndel
b800530bcd Don't show a pixmap for heading event
Some dive computers appear to have heading data in every sample. In order
to avoid a completely cluttered dive profile we no longer show a flag for
every heading event but instead show a basically transparent pixmap (which
is invisible to the user) that allows us to report the heading information
in the tooltip but leaves the profile uncluttered.

Fixes #586

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-14 10:39:18 -08:00
Miika Turkia
910d1cff74 Add .txt as dive log file
Add the .txt to the list of all dive log files as this is the file we
expect to be opened for Poseidon Mk6 log files.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-14 08:50:36 -08:00
Lubomir I. Ivanov
f602408dcd Print: support margin saving for older Qt versions
Seems like QMarginsF and QPageLayout were added quite
recently - in Qt5.3!

We attempt to support older versions by using something
found in the Qt4.7 documentation.

Patch also fixes small ordering issue where top / left
margins were swapped.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-14 08:49:53 -08:00
Lubomir I. Ivanov
7ea728e95f Print: add the support to store margins and printer options
All the print options will be stored after the user closes
or "cancels" the print dialog.

There seems to be no good way to store the last
selected page size, because print dialogs are different and
some just list them as strings - A4, A3, etc.

The patch also applies the following changes:
- renames display.h's 'struct options' to 'struct print_options'
as these were really just for the print dialog
- the print_options dialog now stores more options as 'bool'
- demote PrintDialog's 'printOptions' to 'private'

Fixes #653

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 15:05:11 -08:00
Dirk Hohndel
b2077dc9c0 Better menu entry for filter
This is no longer just a tag filter. Also, since we use this entry (and
its shortcut) like a toggle we should mark the menu entry accordingly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 14:27:30 -08:00
Dirk Hohndel
d765f7a991 When closing filter dialog via menu / shortcut, also reset them
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 14:24:09 -08:00
Dirk Hohndel
2cd31a30f2 When closing the filter window also clear the filter
The tooltip already pretended that that's what it did...

Also make the tooltip wording consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 13:46:19 -08:00
Dirk Hohndel
ac9ead4571 Random whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:52:35 -08:00
Dirk Hohndel
8086b39e11 Adjust the counter function for filter with "none of the above"
So this should count dives with neither buddy nor divemaster, without a
location, with no tags, etc.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:45:32 -08:00
Dirk Hohndel
dae76cdc2d Add a function to count dives with a specific suit
Checking against the location field probably wasn't the best way to do
this...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:35:12 -08:00
Tomaz Canabrava
dee20906e3 Suits Widget created and working.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:09:58 -08:00
Tomaz Canabrava
b7da2a9c44 This is already checked in doFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:08:48 -08:00
Tomaz Canabrava
462091b963 Create the doFilter for the Suits.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:06:20 -08:00
Tomaz Canabrava
fdbdcaab80 Suits filterRow method done.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:06:08 -08:00
Tomaz Canabrava
bfdd94ddc3 Suits update method done.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:05:56 -08:00
Tomaz Canabrava
88d19bca6c Added skeleton of the Suits Filter.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:04:44 -08:00
Tomaz Canabrava
16e44b31d3 Last one: Common 'data' method for StringList based Filters.
This is the last of the series of Macros that I'll do to ease
the creation of a QStringListModel based filter.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:04:28 -08:00
Tomaz Canabrava
51f8010c9b Call all common methods once per class in an easy way.
New method to simplify the creation of 4 of the common
methods for each filter in an easy way. There are
a few other methods that I'm also thinking on how
to do this.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:03:30 -08:00
Tomaz Canabrava
76e1fe3ee7 Create a common macro for flags
samething as the other commits, use common code.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:02:50 -08:00
Tomaz Canabrava
dfb2575dff Clear filter is always the same for a filter based on stringlist
So, let's always use the same codebasee

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:02:37 -08:00
Tomaz Canabrava
5346b78e6c More cleanup using Macros.
The setData of any filter based on a StringList with
checkboxes should be the same, so let's use the same
codebase for it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:02:24 -08:00
Tomaz Canabrava
dfea10fbb8 Create a CREATE_INSTANCE_METHOD macro
This is just to simplify the creation of more filters.
more macros will be used, because I tend to abuse them.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:01:56 -08:00
Tomaz Canabrava
10fecefddd Move the filters code to it's own file.
We already have a bunch of filters, let's pack them together

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 12:01:00 -08:00
Dirk Hohndel
61dc19d2e0 Show the number of dives with given person / location in the filter panel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12 16:02:37 -08:00
Anton Lundin
a06befc007 Support different salinity in planner
Depth is often mentioned in a length unit, but what we care about is
pressure. When diving in fresh water the pressure is lower than the same
depth in salt water. This adds support for using different salinities in
planning.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12 14:42:15 -08:00
Dirk Hohndel
2295e0c21e Merge branch 'fixFilterSelection' 2014-11-12 14:10:49 -08:00
Dirk Hohndel
0b31854031 Deselect dives that are no longer shown as the dive list is filtered
This cleans up the way we ensure that all dives are handled as the dive
list is filtered.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12 14:07:07 -08:00
Dirk Hohndel
72e46c0176 Fix typo
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12 10:18:26 -08:00
Anton Lundin
f8c418c789 Update strings for Suunto safety levels.
By popular demand, this changes the names of the Suunto Safety levels.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12 08:10:48 -08:00
Dirk Hohndel
19ca90f1a0 Embed the information whether a dive is hidden by a filter in the dive
This way other parts of the code can act on the "hidden_by_filter" state.

This also cleans up the way we track if a dive is hidden - do it in the
multi filter instead of the individual filters.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:34:12 -08:00
Tomaz Canabrava
d5ffc16c36 Clean Filters
Code to clean the filters. Maybe I'll also need to call this upon
closing the dialog?

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:09:11 -08:00
Tomaz Canabrava
819d358f8c A bit of code cleanup.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:09:03 -08:00
Tomaz Canabrava
1841eb98b9 Make the close button work
clicking on the close button will close the widget.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:08:01 -08:00
Tomaz Canabrava
d277d4d88e Added buttons to control the multi filter
Buttons to close, minimize and clear were added. We need better icons.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:07:32 -08:00
Tomaz Canabrava
aa44b67d6b Better size for the filter
a bit of extra spacing was necessary to get rid of the scrollbar.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:05:39 -08:00
Tomaz Canabrava
fc39d53232 Better layout for the Extra Info panel
The extra info didn't had a Layout set, this makes the
design hard and not resizable. fixed by using a layout.
I also changed a ScrollArea for a GroupBox, since the
Model already has a ScrollArea.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:04:02 -08:00
Lubomir I. Ivanov
200699706e maintab.cpp: use copy_string() instead of strdup()
The .location and .notes fields can end up being NULL,
in which case copy_string() is safer.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 11:59:35 -08:00
Dirk Hohndel
d06cc2c68e Show the number of dives with each tag in the filter panel
This is a rather brute force implementation. It might be worth while
caching this information - but I'd like to do some benchmarking, first.

Sadly this code also shows that there are some bugs hidden in the
selection code when filtering is present. When a trip is selected all
dives in the trip get selected, even those that are not visible under the
current filter.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 02:36:09 -08:00
Tim Wootton
01441ccb45 Text consistency changes
ppO2 represented with 2 as subscript.
Special l symbol for litres.
Capitalisation to bring in line with existing style.

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 14:45:11 -08:00
Dirk Hohndel
8a55006a4e Two small fixes regarding translation texts
Spelling fix for ampoea
Remove bogus HTML string from UI file

And fix the translation sources accordingly

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 13:10:50 -08:00
John Van Ostrand
f85e406855 Corrected Liquivision name
And added a missing liquivision item in file open dialog.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 12:14:38 -08:00
Dirk Hohndel
02567ec790 Be more careful when restoring a selection in the presence of filters
Try really hard to ensure there remains a valid selection. Only if none of
the dives are selectable should we give up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 11:17:58 -08:00
Dirk Hohndel
7cb307cf73 Don't crash when restoring the selection
If we end up trying to restore the selection where the selected dive is no
longer visible (i.e., it's now filtered away), this code caused a crash by
falling first() on an empty list. Let's not do that.

Fixes #758
2014-11-09 21:32:38 -08:00
Anton Lundin
0b0e5d834f Reorder initializers to be more c++-strict
c++ have some idea about in what order things should be initialized.
This makes us comply with that order.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 11:17:11 -08:00
John Van Ostrand
3fe310e529 Cleaned up file list in open and import dialogs
Lists were getting a little jumbled. I sorted the extensions and added
suitable human readable names.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:15:54 -08:00
John Van Ostrand
8136306911 Added import for Liquivision LVD log files
Support includes cylinder pressures and works for v3.0 log files.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:15:38 -08:00
Anton Lundin
450093df85 Remove leading spaces in buddy tags
The buddy list generated by the buddy tag logic gets separated by
,<space> so this trims away any leading spaces from the buddy name.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:11:36 -08:00
Dirk Hohndel
45251ec724 Show extra data in separate tab on MainTab
This way any extra data probided by the dive computer is visible to the
user (without other processing). This data cannot be edited by the user as
it reflects the information given by the dive computer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:00:58 -08:00
Dirk Hohndel
d643bde61a Always copy data in copy and paste mode
While in a multi dive edit we want to apply our usual semantics (only edit
things that are the same as in the current dive), when doing an explicit
copy and paste that doesn't seem to make sense. So we manually override
that behavior.

Fixes #753

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-05 07:13:20 -08:00
Dirk Hohndel
def9e3fc1b Make sure we don't use the 'changed' flag uninitialized
Valgrind reported this while I was testing the previous commit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04 15:05:35 -08:00
Dirk Hohndel
c9e7528370 Change tank editing behavior for multi dive edit
Previously we only applied the type of tank (description, volume, working
pressure) to all selected dives where the tank description matched.

With this patch we also copy the gas mix into all matching cylinders.

Additionally this addresses the issue that we should have a separate copy
of the cylinder description string for each dive.

Fixes #754

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04 15:05:16 -08:00
Robert C. Helling
20a9db779d Offer to save to a copy in replan mode
When replannig a dive, offer another button that creates a new
dive rather than overwriting the old. This should help in creating
several versions of a planned dive (longer/shorter, deeper/shallower
etc). Note that this makes dives that start at the same time not
influcence each other's deco.

Also, only the first of a row of simultaneous dives contributes to
the tissue loadings of later dives.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04 07:21:34 -08:00
Robert C. Helling
b16cc78482 Replace alpha value of gray star with lighter gray
It seems, on Linux qrgba does not work properly making
stars with alpha red when selected. So the patch returns
to just rgb without transparency but decreases the contrast
to white by a factor of 5.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04 07:03:54 -08:00
Dirk Hohndel
0dd87989a8 Correctly unselect trips when dive list filters change
Oddly Qt left the trips selected (but all dives where unselected in the
UI). This got our internal state rather confused. With this change we
clean up that mess and go back to just having those dives that were
originally selected and are still visible show up as selected.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03 17:52:04 -08:00
Dirk Hohndel
a3f1dc7681 Improve selection behavior of the multi filter
Only dives that remain visible stay selected. And if all selected dives
are removed by the filter, pick a new selected dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03 17:32:12 -08:00
Robert C. Helling
7f7e25d586 Make invisible stars stand out less
As my wife kept pointing out for a long time, the greyed out stars
were heavier as images than the yellow selected stars. This patch
makes the grey stars semi-transparent.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Acked-by: Andrea Fischer-Helling <andrea@fraufischer.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03 15:00:28 -08:00
Tomaz Canabrava
c65583671b Fix position and size of the Filter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03 14:33:15 -08:00
Robert C. Helling
5fa2851bdf Start with 0 when computing maxdepth when fixing up
This is needed to get the correct maxdepth when replanning
leads to a shallower dive.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03 14:32:17 -08:00
Dirk Hohndel
dfc7ee0b29 Delay replot of dive so changes aren't overwritten too early
When changing tanks we triggered a replot - but that overwrote the
displayed_dive with the current_dive before the remaining data from the
displayed_dive was used to edit the current_dive.

So now we delay this until later in the function, this way copy of paste
of both tanks and weights works.

Fixes #753

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03 09:47:24 -08:00
Dirk Hohndel
3fab68dcd3 Fix two more potential crashes for dives without samples
This should be all of them (famous last words).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03 07:50:30 -08:00
Dirk Hohndel
6ce0afb99c Don't call strdup on NULL by mistake
Hunting down a different issue I managed to cause a crash here when trying
to copy a string that ended up being NULL.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01 22:36:42 -07:00
Tomaz Canabrava
4e9aff047e Show single buddies instead on the filter.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01 22:01:33 -07:00
Tim Wootton
6fc32f6240 Capitalisation in file type list
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01 09:27:33 -07:00
Tim Wootton
1e554d5451 Adjusts tissue graph button
Tool tip not needed, text already provided on mouse-over
Corrects captitalisation style

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01 09:27:26 -07:00
Tim Wootton
683f4dc3fe Make filter UI comply with capitalisation style
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01 09:27:18 -07:00
Tim Wootton
ecb91f9eb5 Text adjustments to configuredivecomputer
Use 2 subscript on ppO2
Adhere to agreed capitalisation style
Reset instead of resetted

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01 09:27:11 -07:00
Dirk Hohndel
89e7cae854 Fix partial pressure graph thresholds
Since we only store things in the preferences if they are different from
the default, the existing code that simply compared with the settings
value didn't work when people used the defaults.

We now compare to the actual preference at runtime which should address
that.

Fixes #731

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01 09:22:07 -07:00
Tomaz Canabrava
2cde0b76f7 Fix selection on the list model.
forgot to add that we used multiselection when I recreated
the dive list.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 15:03:20 -07:00
Giuseppe Bilotta
1c1921a652 Avoid repeated layout names
Multiple layouts had the same name="gridLayout_3". Fix by shifting all
the numbers up by 1.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:57 -07:00
Dirk Hohndel
8bdc9d1ec4 Small random whitespace cleanups
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:57 -07:00
Tomaz Canabrava
18b7a2778d Added the widget on the screen, fix a typo.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
d87a1f6784 Implemented the LocationFilter widget.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
14bc7dfeeb Repopulate the LocationFilter when lading a dive file.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
fd1cc4ea2d FilterRow implemented for LocationFilter.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
8399d6f977 Repopulate method on LocationFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
1a4e69a3bb setData method for LocationFilter.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
dc147be153 Implemented the flags method for LocationFilter.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
1c0da67a26 Implemented the 'data' method of LocationFilter.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
894e0bc7a9 Implemented the constructor of LocationFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
5bc793b0f0 Implemented the instance method of LocationFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
2f60b73bb1 Location Filter, skeleton code.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
03c22c3b18 Treat buddy as Buddy and Divemaster, sort the filter lists.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
2827da5ecf Fixes in the buddy finding algorithm.
I was comparing the strings in the opposite direction.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:56 -07:00
Tomaz Canabrava
358611d029 Implement the Buddy Filter interface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:55 -07:00
Tomaz Canabrava
b1d76ed4d7 Implemented the filterRow method for BuddyList.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:55 -07:00
Tomaz Canabrava
30cf0ba79a Implemented the 'repopulate method' for BuddyFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:55 -07:00
Tomaz Canabrava
e17fa41192 Implemented the flags method for BuddyFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:55 -07:00
Tomaz Canabrava
a65280fbae Implemented the setData method for BuddyFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:55 -07:00
Tomaz Canabrava
1f9abad852 Impelmented the Data method for BuddyFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:55 -07:00
Tomaz Canabrava
7c4ddcbf7a Implemented the constructor for the BuddyFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:55 -07:00
Tomaz Canabrava
e90eac2d38 Implemented the instance method for the BuddyFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:55 -07:00
Tomaz Canabrava
2c924b6834 Added the skeleton for the BuddyFilter
Just the skeleton of the functions, nothing working yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:55 -07:00
Tomaz Canabrava
318256cfb4 Better layout for the filtering widget
Fix the layout size, moved some stuff around.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 14:58:49 -07:00
Tomaz Canabrava
ff669362fb Fix spacing in the layout of the MultiFilter
default is 8, setted to zero.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 13:52:52 -07:00
Tomaz Canabrava
c47972a189 tagfilter.ui -> filterwidget.ui
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 13:52:52 -07:00
Tomaz Canabrava
c68a94da6a TagFilter -> MultiFilter
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 13:52:51 -07:00
Tomaz Canabrava
19ac1dfa09 Added a 'MultiFilter' widget.
The multifilter widget is a container with all the filter
widgets inside of it. currently there's just one.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 13:52:51 -07:00
Tomaz Canabrava
063e6d9fbf Ctrl+F now opens the Tag Filter
And old code for the old searchbar removed.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 13:52:51 -07:00
Tomaz Canabrava
1876bec08b Make possible to hide the tag filter.
It was impossible to remove the tag filter after opening it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 13:52:51 -07:00
Tomaz Canabrava
d50e2d3356 Do not allow to collapse the pannels of the mainwindow
Disable the possibility to collapse the pannel in the
mainwindow when seeing everything.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 13:52:51 -07:00
Tomaz Canabrava
9160c26b1a Move the Filter to a better position
This patch moves the filter from the collapsable pannel
and puts it in an uncollapsable way above the dive list.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-31 13:52:51 -07:00
Dirk Hohndel
4fa3f89378 Fix adding gas change to a dive
Yikes this was stupid. We mixed changing the displayed_dive and the
current_dive. So we'd pass in the displayed_dive and a pointer to the
dive_computer structure of the current dc in the current dive. Oops.

This makes much more sense. And:

Fixes #738

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 14:08:10 -07:00
Dirk Hohndel
fa5c713f73 After editing tags, get the right tags into the displayed dive
We forgot to clear out the pre-existing tags. We did this for the actual
selected dives that were being edited, but not for the displayed_dive, so
deleted tags showed up again on screen (even though they were correctly
deleted from the selected dives in the dive list).

Fixes #732

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 13:03:50 -07:00
Dirk Hohndel
c0536e8d57 Revert "Divelist: make the column headers for units left aligned"
This reverts commit d5f19c43c9.

With the changes to the headers in commit 3515ad71c1 ("Divelist: remove
units from header, add tooltip") I think this isn't needed anymore and
actually reverting it creates a cleaner look.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 10:21:59 -07:00
Linus Torvalds
ca8fc978d2 Display dive duration in dive list in whole minutes
The whole "duration in seconds" is being way too OCD about the
information, and just makes it harder to read.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 10:13:44 -07:00
John Van Ostrand
0996908dd8 Added close button to print preview window title bar.
Without this I was only able to close it by choosing to print.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 07:47:06 -07:00
Dirk Hohndel
b2af700a42 Remove debug output in preference setting
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 07:46:24 -07:00
Dirk Hohndel
3515ad71c1 Divelist: remove units from header, add tooltip
This should help with the issues we are having with alignment / visibility
of the relevant information in the divelist.

Most people will never switch the units (or maybe switch them once, the
first time they use Subsurface). So having the units shown in the table
header quickly becomes redundant - yet having the units in there causes
all kinds of layout issues.

This patch adds a tooltip to both the header and the main data area of the
divelist. The tooltip shows the column name plus unit and the column
header no longer shows the units.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 07:40:22 -07:00
Dirk Hohndel
669da22d8c Allow the user to switch to a gas in a specific tank
When entering a gas switch manually, explicitly show the different tanks
that are available and correctly switch between different tanks with the
same gas.

See #702

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 16:25:00 -07:00
Lubomir I. Ivanov
d5f19c43c9 Divelist: make the column headers for units left aligned
Fixes #739

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-29 09:29:14 -07:00
Dirk Hohndel
4d9c30d424 Explicit first gas only on first sample
Instead of the 30 second heuristic we only assume that this is an explicit
first gas if the event coincides the first sample.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 16:27:10 -07:00
John Van Ostrand
1899d99d1c Fixed RegExp bug
This prevented import of log files other than CSV and TXT.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 14:18:29 -07:00
John Van Ostrand
884f653176 Added Cochran CAN files to the Open Logbook dialog
Subsurface can now open CAN files as an alternative to importing.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 14:16:02 -07:00
Dirk Hohndel
e32ba4d6d8 Improve tank handling for Cobalt
This isn't Cobalt specific, this is specific to dive computers that
indicate the first tank that's in use with a gaschange event that
coincides with the first sample.

We need to make sure that we suppress showing that gas change event
(regardless which cylinder it goes to) and instead set the correct
cylinder index from the very start of the dive.

This works with the test data I have and doesn't seem to break thing with
any of the files that I tried... but I'm worried that this is not the
right way to do things.

Fixes #742

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 14:04:19 -07:00
Lubomir I. Ivanov
874754e22b dive.h: add a variant of FOR_EACH_PICTURE
This prevents a warning caused by -Waddress, that the address
of 'displayed_dive' will always be defined.

Exact macro variant suggested by Dirk.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 09:10:12 -07:00
Miika Turkia
4bc9b7748b Parse meta information from Seaber log
This will parse date information from Seabear log file and skips the
"header" data to allow parsing of the CSV content.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28 07:25:45 -07:00
Anton Lundin
ee7c86f206 Create a delegate for depth and gas components
This creates a delegate to simplify the handling of gas components and
the change depth.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 15:41:55 -07:00
Anton Lundin
0e3a9328bc Create a delegate for gas type columns
This creates a delegate for the type column to choose the type value for
gases that is less confusing then the raw value.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 15:41:51 -07:00
John Van Ostrand
49401eec0b Finished Cochran dive log import
I fixed up the decode and finished the parse for Cochran EMC, Commander
and Gemini computers. I suspect that this code may only work with files
from certain versions of Cochran Analyst. It works with my own CAN files
and with the samples that came with Analyst v4.01v.

A seemingly arbitrary offset of 0x4914 is needed to access data.
The previous code uses 0x4a14 and 0x4b14. I suspect these are from
different version of Analyst.

[Dirk Hohndel: whitespace cleanup, add files to subsurface.pro, made sure
	       this compiles without the corresponding patch to
	       libdivecomputer (that isn't upstream, yet), cleaned up the
	       usage of structs, removed a few unused variables]

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 15:21:19 -07:00
Anton Lundin
29ee1896a4 Change the salinity setting for OSTC
On the OSTC's the salinity is in kg/l and is stored as kg/l * 100

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 14:40:51 -07:00
Anton Lundin
353868e6ec Change the OSTC3 copied ui to be sane for OSTC
The OSTC supports a bit different functionalities than the OSTC3 does.

The "unsupported" bits are
setBrightness
setCalibrationGas
setCompassGain
setDiveMode - Bult into setDecoType (OC/CCR)
setDiveModeColor - Lots of different colors
setFlipScreen
setLanguage - Controlled via flashing different firmwares
setPressureSensorOffset
setUnits
setSetPointFallback
setCcrMode - there are some ppO2 reading functionality in the fist gen
             OSTC that we don't care about, and the rest is controlled
             via choosing a CCR deco algorithm

Also the OSTC have a notion of number of dives it has done, so this adds
ui for that value.

There are also differences in how some values are handled. Ex the OSTC
don't have fixed samplerates that you can choose between. You can rather
just set your sample rate to X seconds.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 14:40:41 -07:00
Anton Lundin
eacf8fc623 Copy the configure OSTC3 ui to the OSTC UI
Just renumber the ui components. _3 for OSTC.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 14:40:09 -07:00
Robert C. Helling
a2f9f0c8bf Compare image times and sample times as signed ints
The problem that we were comparing signed and unsigned ints was originally
found by Lubomir. As image times can be negative (and the comparison should
fail in that case) we need to compared them as signed.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Acked-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 14:39:00 -07:00
Anton Lundin
ae4015dc10 Add a icon to the OSTC, Mk.2/2N config line
The icon comes from heinrichsweikamp.com, the same as the ostc3.png did.

I've emailed with Matthias Heinrichs at HW and they have given us
permission to use both the ostc3.png and ostc2n.png under the GPL v2.

They also can provide the hi-res originals if anyone needs to do more
work on these icons.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 14:36:13 -07:00
Anton Lundin
8f89d3cbec Remove now obsolete forward declaration
We now include the Ui header file, so we can remove the forward
declaration.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 14:35:50 -07:00
Anton Lundin
d835e6342d Set a max value for the custom text in OSTC3
The device supports a up to 60 chars custom text. This limits the
LineEdit to that amount, so users see when they reach the max limit.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 14:35:18 -07:00
Anton Lundin
8ba6736ca8 Add a shortcut to Configure dive computer dialog
This adds a shortcut, Ctrl+Shift+C to jump into the Configure dive computer
dialog.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 14:35:05 -07:00
Dirk Hohndel
7b4bf88313 Correctly save a re-planned dive
In commit a85a219df3 ("Add ability to replan a dive that we planned
before") I completely mishandled the saving of the replanned data.
How embarrassing.

Fixes #747
See #527

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 12:37:27 -07:00
Lubomir I. Ivanov
1f1bb71d78 divelistview.cpp: move a variable in a Q_OS_MAC branch
Not used on other OS and triggers a warning.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:38:34 -07:00
Lubomir I. Ivanov
0778e3e18c divelogexportdialog.cpp: fix a 'uninitialized variable' warning
DiveLogExportDialog::export_depths()

We set a default value of 'unit' which will silence the warning itself.
Then hope that the compiler will respect the argument order i.e. call
get_depth_units() (which sets 'unit') before using *unit as the last
argument passsed to put_format().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:36:28 -07:00
Lubomir I. Ivanov
8c8943bf00 globe.cpp: fix a NO_MARBLE warning
Make eventFilter() return a value for NO_MARBLE.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:35:53 -07:00
Lubomir I. Ivanov
bf3253f390 configuredivecomputerdialog.ui: fix a UIC warning
"gridLayout_1" is used twice. Re-order the grid layouts as 1, 2, 3.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:35:31 -07:00
Lubomir I. Ivanov
341eb05f83 MainWindow: prevent a possible crash on "re-plan"
MainWindow::on_actionReplanDive_triggered():

If a dive in the divelist does not have a "DC Model" for some reason,
selecting "re-plan" from the menu will pass a NULL value
current_dive->dc.model to strcmp() and break before the debug output.

To fix that we check if the said .model value is NULL.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-27 07:35:15 -07:00
Miika Turkia
8fcc074b49 Support for importing Poseidon MK6 logs
This patch adds support for importing the logs from a Poseidon MK6
rebreather. This DC produces logs that contain of a .txt file that has
all the meta data and a .csv file that contains the sample readings. The
CSV file is different from the others in that it has a line per each
sample reading at given time. Thus we have to merge all the lines from
one point in time into one sample reading of ours.

[Dirk Hohndel: addressed some compiler warnings]

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-26 20:33:50 -07:00
Dirk Hohndel
f81d316570 Correctly place the first gas label in drop to bottom mode
When dropping to the bottom in plan (and add) mode, the gas label was
placed along the diagonal line from (0,0) to the second dive data point
(i.e. the one at the end of the "at deptch" segment). That looks terrible,
the label needs to be along the segment that we are spending at the
bottom.

This patch fixes that problem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-21 14:27:50 -07:00
Anton Lundin
856ec092b7 Configure support for OSTC, Mk.2/2N/2C
First out is firmware updates.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:12:37 -07:00
Anton Lundin
02dcae3eca Add a icon for the Suunto Vyper Family config page
This adds a icon to the Vyper config page. The image is taken by me of
my Suunto Vyper. Thats the reason for the quality.

Question: Would it be ok to grab a PR image from Suunto's web page to
use here? If so they got better ones...

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:12:16 -07:00
Anton Lundin
8439e72bb1 Style cleanup
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:12:04 -07:00
Anton Lundin
1c2ddd62c1 Disable update firmware button for OSTC3 for now
We currently don't support update firmware for the OSTC3. Where waiting
for support in libdivecomputer for that, so disable that button for now.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:11:48 -07:00
Anton Lundin
c11e2fbb6f Fix spelling in configure dive computer tool tips
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:11:21 -07:00
Gehad elrobey
fae86eb4ce HTML: Export unit preferences to settings file
Working on HTML exports to support imperial and metric units and also
custom selected units based on subsurface preferences.
User selected units is exported to settings file that will be mainly used
by listlib javascript file.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:04:01 -07:00
Dirk Hohndel
71d21c375c Recalculate the decompression if the date / time of a dive changes
The pre-existing tissue load going into a dive can change if the start
time of a dive changes. Therefore we need to recalculate the ceiling when
editing start time (or date) of a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 17:40:11 -07:00
Dirk Hohndel
e1db94ea0c Correctly edit dive date/time when editing manually entered dives
While the existing code worked fine for editing that start date or time of
dives downloaded from a dive computer or imported from some other source,
for manually entered dives this did not work and the date or time was
always reset to the original time once the changes were saved.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 17:34:53 -07:00
Giuseppe Bilotta
4de44e6c9f TableView: fix button sizing
Ensure that there is no (clipped) overflowfrom the header.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:24:15 -07:00
Giuseppe Bilotta
58ac3b8f86 Fix tableview margins
The previous hard-coded solution for GTK+ didn't work on HiDPI, and a
comment hinted that even on Mac OS X it might need tuning. Find a more
generic solution that should work regardless of platform and style,
based purely on the geometries reported by the style itself.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:24:08 -07:00
Giuseppe Bilotta
dfec501e7a Resolution-independent trash icon
Also, generate the corresponding pixmap only once, and distribute it to
all models that need it.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:23:36 -07:00
Giuseppe Bilotta
60702f104c Resolution-indepent dive pictures
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:23:27 -07:00
Giuseppe Bilotta
048f18db85 Resolution-independent DiveEventItem icon sizes
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:23:18 -07:00
Robert C. Helling
5f44fdd9cf Make planner work again for CCR dives
The latest CCR patches had rendered the planner not usable for CCR dives.
This patch corrects this (and reenables the CCR set point column for
segments). The problem was that a new member setpoint of struct divepoint
had been introduced, but there was already po2 which had the same meaning.
This patch merges the two and renames them setpoint to prevent future
confusion.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19 07:07:07 -07:00
Anton Lundin
74f27a0a39 Add support to reset OSTC3 settings to default
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:22:22 -07:00
Anton Lundin
b2a66eab14 Wire up more settings in the OSTC3 settings
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:21:38 -07:00
Anton Lundin
0c7cc03892 Add a more settings to the OSTC3 settings
This adds the settings not previously available in the OSTC3 settings.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:21:01 -07:00
Anton Lundin
a3a9fd405c Create a Advanced settings page for OSTC3
This creates a Advanced settings page for the OSTC3 and moves the deco
settings off to that page.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:20:54 -07:00
Anton Lundin
ba603f882b Add GAS settings to the gas screen
These settings are gas related so they fitted in the spare space in the
gas screen.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:20:44 -07:00
Tomaz Canabrava
1180b5d2d3 Fix plus icon position based on the theme
I hope this time I got it right. basically, the old code
tried to guess where the plus icon should be with a fairly
bad set of defauults.

This one patch asks for the Qt style where everything is and
uses that knowledge to make it be in a more sane position.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Giuseppe Bilotta <giuseppe.bilota@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:18:38 -07:00
Giuseppe Bilotta
32ab2b34d3 Unify icon metrics
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:16:15 -07:00
Giuseppe Bilotta
72b256de62 actually use defaultIconSize()
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:16:11 -07:00
Giuseppe Bilotta
5a2db2db4b Define auxiliary functions for metrics
Collect font, font metrics and icon size functions in a separate module.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:16:07 -07:00
Giuseppe Bilotta
f18bcd6607 Dynamic dive trip list column widths
Compute the default widths for the columns in the dive trip list from
their header and (expected) content length rather than some fixed pixel
sizes.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:16:03 -07:00
Giuseppe Bilotta
10351b3495 Make TableView resolution independent
Don't hard-code column widths or icon sizes/positions. Instead, compute
them from the fonts used.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:15:58 -07:00
Giuseppe Bilotta
d8f756fe14 Dynamic ToolTipItem metrics
Instead of hard-coding the icon sizes and spacing, compute them from the
font sizes, that Qt auto-computes from the displya DPI.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:15:53 -07:00
Giuseppe Bilotta
0171368b6d Dynamic StarWidget metrics
The default IMG_SIZE and SPACING in the StarWidget are not appropriate
for HiDPI displays. Replace them with StarMetrics which are
auto-computed from the (default) font size (which Qt determines from the
display DPI settings).

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18 15:15:44 -07:00
Anton Lundin
29851d956f Fix the type of the for the Suunto max depth
The type is now a double. It was a int during development, but due to
the feet/128 precision i changed it to a Double, but the default value
wasn't changed type on.
All the Qt tools swallowed the number there without complaining but the
Qt designer insisted on changing it to a double.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:11:51 +02:00
Anton Lundin
fce83b953d Fix column order for OSTC3 diluent table
The fist column is the O2% value, and was handled like that in the data.
It was only the column header that was wrong.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:11:16 +02:00
Anton Lundin
882986dfdf Save columnwith of Ostc3 settings tables
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:09:15 +02:00
Anton Lundin
5a394aaff6 Make ConfigureDiveComputerDialog ui a class member
Almost all of our other classes have the ui class as a class member in
the controller code. This switches ConfigureDiveComputerDialog to that
model.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:08:18 +02:00
Anton Lundin
3785c76657 Enable/Disable Update Firmware button based on dc
Disable the Update Firmware button if you choose a device that we don't
support update firmware for.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:07:00 +02:00
Anton Lundin
40bc4b629a Don't allow writing before we got data
Don't allow creation of backup files or writes to the computer before we
know we got some data, either from a backup file or from the actual
device.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:06:34 +02:00
Anton Lundin
51ef56fbcb Set limits for Saturation/Desaturation on OSTC3
The default max value for a QSpinBox is 99. The default Saturation
factor for the OSTC3 is 110%. This code sets the max, min and default
values on those spinboxes.
The values comes from me reading the assembler code for the OSTC3.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-16 11:03:17 +02:00
Giuseppe Bilotta
3d11904f59 Remove double include
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-15 22:53:10 +02:00
Anton Lundin
0b85f59e87 255% as limit for Saturation/Desaturation on OSTC3
The default max value for a QSpinBox is 99. The default Saturation
factor for the OSTC3 is 110%. This code raises the max values to 255
which is as far as i've read the ostc3_interface.odt the max value.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-15 14:51:21 +02:00
Salvo 'LtWorf' Tomaselli
4cdb80c4cd Export to DiveShare
Adds the possibility of exporting dives to DiveShare.

Signed-off-by: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14 20:33:46 +02:00
Dirk Hohndel
64d1ccc550 Setup defaults for some of the OSTC3 settings
This is still missing lots of values which are now set to 0 with rather
unfortunate consequences (for example, setting Saturation and Desaturation
to 0 turns off the NDL / Deco calculations). So this code right now is
quite broken.

But at least this fixes the reported crash and gets some valid data
initialized.

Fixes #744

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-14 20:32:15 +02:00
Anton Lundin
3b30009d7a Remove unused variables
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:34:40 -04:00
Anton Lundin
9c0e2fc823 Connect the Suunto Vyper Configuration ui
This code connects up the configuration ui with the backing
data structures thats gets read/written to/from the devices.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:32:21 -04:00
Anton Lundin
3836e64092 This adds a ui for Suunto Vyper settings
This builds up a ui to use for all the settings for the Suunto Vyper
family devices. Some of the fields are pure information, eg, max depth
and number of dives, so they are marked read-only.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 12:32:12 -04:00
Linus Torvalds
df4e26c875 Start sanitizing gaschange event information
Decode the gasmix data into a sane format when creating the event, and
add the (currently unused) ability to specify a gas change to a
particular cylinder rather than (or in addition to) the gasmix.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 07:45:37 -04:00
Linus Torvalds
a7e1e7fee1 Pass the whole 'device_data_t' to the uemis downloader
Not only does it make it look more like the libdivecomputer downloaders,
but the uemis downloader needs it in order to support all the flags we
have.  Notably "download into private trip".

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12 07:34:46 -04:00
Robert C. Helling
2282035a4d Add export for depths of images taken
This adds an option to the export dialog to write an ascii file containing
filenames of image files a tab and the depth at the time of the image
taken.

[Dirk Hohndel: whitespace cleanup]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-10 08:03:45 -04:00
Anton Lundin
f3484d1148 Actually set the setpoints to the OSTC3
The setpoints filled in into the ui where never set on the devicedetails
object so they where never propagated to backup or write settings.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-10 02:43:42 -04:00
Joakim Bygdell
00c3b8dbaa Untangle the graphs at the bottom of the profile.
When multiple graphs are displayed at the same time they end up being printed on top of each other.
Scale the lowest graph to accommodate the tankbar.
Add an intermediate scaling step to the depth axis when pp graphs or the tissue graph are visible.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-10 02:41:26 -04:00
Tomaz Canabrava
e0b60167f2 Add possibility to filter by more than one criteria at a time
This new version of the TagFilterSortModel actually accepts
*any* new MultiFilterInterface.

So, how to use it to create a new filter:

Implement a class that inherits from MultiFilterInterface

Implement the filterRow method

TagFilterSortModel::instance->add( myClass );

and you are done.

[Dirk Hohndel: removed some debug code and did whitespace cleanup]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-02 07:35:23 -07:00
Tomaz Canabrava
84fdbefb58 Fix typo that broke settings.
A small typo broke the disabling of the graphs for the
newly added curves. ( btw, we need a designer to display
the graphs in a better way, just too much information. )

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-20 18:36:08 -07:00
Tomaz Canabrava
2b760bdd39 Fix crash when moving the mouse over the profile when no dive is shown
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-20 18:35:08 -07:00
Tomaz Canabrava
a2f2751792 Show everything when nothing is checked.
This patch fixes a bit of the logic used. Now we show every
dive if nothing is chedked.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-20 18:35:02 -07:00
Robert C. Helling
15a99f8789 Add tissue saturation plot to tooltip
This adds a graphical representation of tissue loadings at the current moment during the dive
to the tooltip box. The layout is inspired by the Sherwater Petrel.Add tissue saturation plot to tooltip

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-19 21:48:05 -07:00
Robert C. Helling
3fc9c1e005 Tissue saturation plot a la Sherwater Pretel
This adds a toolbox icon to turn on a tissue plot inspired by the bar
graph of the Sherwater Petrel,

It shows the inert gas partial pressures for individual compartments. If
they are below the ambient pressure (grey line) they are shown in units of
the ambient pressure, if they are above, the excess is shown as a
percentage of the allowed overpressure for plain Buehlmann. So it has the
same units as a gradient factor. Thus also the a gradient factor line (for
the current depth) is shown.

The different tissues get different colors, greener for the faster ones and bluer
for the slower ones.

Positioning and on/off icon action still need some tender loving care.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-19 21:46:30 -07:00
Anton Lundin
50adde828c Switch some columns to right alignment in divelist
Some columns in the dive list makes more sense to have right aligned
than left aligned. This switches the numeric columns to right alignment
so they is more easily compared visually.

But, we keep the NR-column left-aligned because we use its left
indentation as dive-in-a-trip marker.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:42:18 -07:00
Dirk Hohndel
37871e5f7d Slight change to info tab layout
This keeps max depth and average depth next to each other and instead
moves air pressure up one row.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:38:03 -07:00
Tim Wootton
42c9699870 Futher capitalisation standardisation
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:24:53 -07:00
Salvo Tomaselli
bff471f98d Typos
This fixes two typos found by lintian.
I guess a bunch of translations will need to be updated or something, I am not
sure how they work so I didn't touch them. I presume in the worst case they
will need to be re-translated at the next iteration

--
Salvo Tomaselli

"Io non mi sento obbligato a credere che lo stesso Dio che ci ha dotato di
senso, ragione ed intelletto intendesse che noi ne facessimo a meno."
                -- Galileo Galilei

http://ltworf.github.io/ltworf/
From a0e5f48349557fcccd82ba8c7555043de140835c Mon Sep 17 00:00:00 2001
From: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Signed-off-by: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Date: Fri, 12 Sep 2014 18:25:20 +0200
Subject: [PATCH] Fix typos reported by lintian

Fixes two typos reported by lintian.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:24:05 -07:00
Robert C. Helling
d6abb739d9 Helper function for partial pressure calculation
This patch introduces a new structure holding partial pressures (doubles in bar) for
all three gases and a helper function to compute them from gasmix (which holds fractions)
and ambient pressure. Currentlty this works for OC and CCR, to be extended later to PSCR.

Currently the dive_comp_type argument is unused.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:20:25 -07:00
Gaetan Bisson
ae6b0468b1 Report CNS in dive info tab
This adds a maxcnsText widget under infoTab and populates it.

Note that I manually edited maintab.ui to display CNS and OTU
next to each other and right after gas data.

Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:16:44 -07:00
Dirk Hohndel
434e7a6a71 Fix crash at startup
Not sure this is the right fix, but at least it doesn't crash any more.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:48:57 -07:00
Dirk Hohndel
0d1da0563b Random whitespace update
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:39:49 -07:00
Tomaz Canabrava
d6d82a5af8 Unused signature removed.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:32:22 -07:00
Tomaz Canabrava
db6126bc52 Show everything by default.
We should show all dives by default.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:32:15 -07:00
Tomaz Canabrava
06ebd0ea5e Better filtering of dives with no tags.
New rules for them, a new item on the model with the text
"Empty Tags" should be marked if the user wants it to be
displayed.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:32:05 -07:00
Tomaz Canabrava
bef8dc6f4b Implement trip-filtering.
Trips will be filtered if it doesn't find any tags for
dives.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:28:49 -07:00
Tomaz Canabrava
f1e7c12e8a Correctly filter dives. (trips are always shown)
This patch correctly filter dives based on tags, but it will
also keep showing all the empty trips.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:28:37 -07:00
Tomaz Canabrava
4e3689370d Create the sorting method.
This method should remove a row on the dive list model
visualization if none of the tags that it have are marked
as 'visible'.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:28:21 -07:00
Tomaz Canabrava
a6e9a1eab5 Implement the TagFilter model.
This model accepts check / unchedk. Now, I need to also
plug the result of the check / uncheck to the list model.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:28:04 -07:00
Tomaz Canabrava
7a90b9d764 Trigger the log->filter by tag to open the tag filter.
You can't really close it for now.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:27:50 -07:00
Tomaz Canabrava
abc5d5864c Add the Tag Widget on the MainWindow
Place the TagWidget on the correct place on the main  window.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-17 15:27:33 -07:00