Commit graph

2877 commits

Author SHA1 Message Date
Anton Lundin
bdea7dd0d6 Prevent leak by connecting object to its parrent
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 07:22:24 -08:00
Anton Lundin
d812d7b1f6 Free memory returned from get_dive_gas_string
After we created a QString from it, we need to free the char*.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-18 07:20:25 -08:00
nikhil
be1b79081d Modification to the User Survey UI
As per the suggestion by Dirk Hohndel, I changed the "Type of Diver" from
RadioButton to Checkbox.

The User Survey UI was not clear earlier, so I grouped the similar options under
a question. I also modified the language and re-arranged the visual components.

Earlier, the user could choose contradicting import types at once. This has beencorrected by using RadioButtons instead of CheckBoxes.

Signed-off-by : Nikhil Bharadwaj Gosala <nikhil.gosala@gmail.com>

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-17 21:43:45 -08:00
nikhil
355db46187 Modified the UI of the User Survey Page
The UI in the User Survey page was not clear and the Text Blocks were getting
cut. So I increased the size of the Text Blocks.

Also the survey was using CheckBoxes instead of RadioButtons. The problem with
this is that the user could choose to be both Recreational and Technical diver
which cannot be possible. So I replaced the CheckBoxes with RadioButtons.

I also replaced the CheckBoxes, which asked the user from where he was importing data, with RadioButtons so that the user can select only one option.

I also modified the English used and made it concise and clear.

Signed-off by : Nikhil Bharadwaj Gosala <nikhil.gosala@gmail.com>

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-17 21:43:35 -08:00
nikhil
71dbcdc0d6 Added the option of opening User Survey form explicitly
Earlier, there was no option for the user to explicitly open the User
Survey form. This has been corrected by placing an option in the "Help"
menu by which the user can explicity open the User Survey form.

Signed-off-by: Nikhil Bharadwaj Gosala <nikhil.gosala@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-17 21:38:04 -08:00
Robert C. Helling
b72c32da7d Turn of replotting while the cylinder type combo box is active
Since replotting is expensive and it is triggered while scrolling
through the list of cylinders, better not do it for improved
user experience and replot only after the combo box loses
focus.

I hope this...

Fixes #768

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-17 21:33:55 -08:00
Guillaume GARDET
1910d6d546 Fix compilation with upstream Marble
<marble/MarbleDebug.h> is not availaible in all Marble versions.
As Marble::MarbleDebug::setEnabled(verbose) is only used when
MARBLE_SUBSURFACE_BRANCH is defined, also include header file only when
MARBLE_SUBSURFACE_BRANCH is set.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-17 08:09:54 -08:00
Robert C. Helling
a6fdd6220b Removed leftover qDebug()'s
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-16 07:08:21 -08:00
Robert C. Helling
9ad3e83c77 Put manual set-point changes at negative time at start of dive
Manually inserting set-point changes at negative times (left
of the profile) caused the setpoint to end up at stupid values
(probably some signed/unsigned confusion). This patch aligns
them with the start of the dive.

Fixes #774

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-16 07:07:49 -08:00
Dirk Hohndel
bceff788fb Only setup marble debug output when comiling against our branch
Otherwise this might break the compile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-16 07:06:22 -08:00
Dirk Hohndel
9fe458ea2e Enable Marble debug messages from Subsurface command line
Calling Subsurface with -v now gets you debug output. Of course, with a
regular "release" build of Marble you still won't see much. But with the
changes in the special Subsurface-testing branch you actually get some
very useful information when debugging a lack of maps in Marble.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-13 17:08:58 -08:00
Joakim Bygdell
8d4a3842ee Prevent the tank bar from overlaping the temperature graph.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 11:55:23 -08:00
Tomaz Canabrava
4487efcabe More lists organized alphabetically.
I forgot this one, tsc.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 10:40:42 -08:00
Dirk Hohndel
719cfe0ece Trivial white space fix
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 15:49:12 -07:00
Dirk Hohndel
c76cb59aa0 More temperature plot position tuning
Depending on the options shown, the latest change appears to have moved
the temperature graph a bit too low. This seems to work better in my
experiments.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 15:48:19 -07:00
Joakim Bygdell
6653d98e67 Rearrange the vertical positions to better accomodate the temperature graph.
Fixes #778

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 09:39:53 -07:00
Tomaz Canabrava
7e2f7747d6 Organize string-lists alphabetically for completion
This micro patch adds the ability to sort the lists alphabetically
for user interaction. Dirk asked me to do this for location, but
this actually changes for location, divemaster, buddy and suit.

Seems a good thing for all.

Fixes #780

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 09:12:49 -07:00
Dirk Hohndel
3f34af4bed Make filter for filter criteria case insensitive
When opening the filter dialog we allow the user to filter the choices
that are shown. The text that they enter in that filter for filter
criteria should be treated as case insensitive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 21:23:12 -07:00
Dirk Hohndel
4029c87ec7 Hide any pictures shown when closing divelog
Fixes #776

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 21:16:34 -07:00
Dirk Hohndel
b575069638 Don't skip the first tag when filtering
No idea why this code was there... but what it caused was an invalid
access to checkState[-1] when a dive had that first tag. This explains why
sometimes the dives that had that tag were shown, regardless of whether
the selected filter criteria should have excluded them or not.

Fixes #769

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 20:55:31 -07:00
Dirk Hohndel
6f231c67a0 Close and clear filters when closing divelog
Otherwise non-sensical information stays behind.

Fixes #777

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 20:16:39 -07:00
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