Right now the options are "Save" and "Cancel". I wrote that code and it
always bugged me - "Cancel" could mean that I want to cancel the the whole
operation, i.e. that I don't want to quit after all. Showing "Save" and
"No" seems much more logical.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* 'forlinus' of git://git.hohndel.org/subsurface:
Small improvement to plot info debugging code
Add three more trimix test dives
Make test dive 15 a bit more useful
Two test dives I added a couple of months ago
Add libxslt to Windows packaging file
Packing it next to the divemaster/buddy information may work great on a
big screen with lots of pixes, but it makes the minimum window size way
wide for a small screen. So don't do it.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
If you are diving multiple nitrox cylinders, we now show them as a range
instead of just the max. We'll still sort by max O2 (and for the same
max, by min O2).
So now with trimix dives, we'll show the bottom gas (we assume that
"highest He percentage" is that bottom gas), for nitrox dives we'll show
the range of Oxygen percentage, and for all-air dives we'll show just
"air".
For simple nitrox dives (only a single mix), we'll obviously show just
that single percentage. This should hopefully conclude the whole "show
multiple cylinders in dive list" mess.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
.. using the regular sorting rules: sort by Helium content first, Oxygen
content second. Air always sorts last (even behind the theoretical
hypoxic Nitrox that nobody sane would use).
This is what Don Kinney implies would be the natural thing for a trimix
diver.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
.. and use this for the nitrox column, which can now be more complex
than just a single number.
The rule for the "nitrox" column is now:
- we look up the highest Oxygen and Helium mix for the dive
(Note: we look them up independently, so if you have a EAN50 deco
bottle, and a 20% Helium low-oxygen bottle for the deep portion, then
we'll consider the dive to be a "50% Oxygen, 20% Helium" dive, even
though you obviously never used that combination at the same time)
- we sort by Helium first, Oxygen second. So a dive with a 10% Helium
mix is considered to be "stronger" than a 50% Nitrox mix.
- If Helium is non-zero, we show "O2/He", otherwise we show just "O2"
(or "air"). So "21/20" means "21% oxygen, 20% Helium", while "40"
means "Ean 40".
- I got rid of the decimals. We save them, and you can see them in the
dive equipment details, but for the dive list we just use rounded
percentages.
Let's see how many bugs I introduced. I don't actually have any trimix
dives, but I edited a few for (very limited) testing.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The divelist airmix display is kind of broken: it only looks at the
first cylinder, and it only looks at Oxygen content, not Helium.
But at least we can make sure to update it when somebody edits the
cylinder information, instead of leaving it extra broken.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is Henrik's list of common metric sized cylinders, although my
experience differs from this one. In Cyprus, I was diving double 12L
cylinders, but they were 200 bar, not the 232 bar ones Henrik has on the
list.
Also, I really think we should just have a checkbox for "double" instead
of naming them explicitly like this. Henrik does have the 12L 200 bar
ones in his singles list.
But as a stop-gap, I'm just taking the values from Henrik's patch, but
converted to the new cleaned-up reference tank model setup.
Based-on-patch-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This makes the reference tanks ("struct tank_info") use a saner format
which specifies explicitly whether the size is in ml or cubic feet, and
whether the pressure is in psi or bar.
So instead of having magic rules ("size is in cuft if < 1000, otherwise
mliter"), just set the size explicitly:
{ "11.1 l", .ml = 11100 },
{ "AL80", .cuft = 80, .psi = 3000 },
and then the code can just convert to standard measurements without any
odd rules, and the initialization table becomes self-explanatory too.
This is in preparation for doing the metric tanks with pressure: Henrik
Aronsen sent a really ugly patch using the previous setup, I just
couldn't stand the additional hackery.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
They were never intended to be sortable, but using common code with the
dive list picked up that "sort by index" thing by mistake.
If we really want to be able to sort cylinders by O2 percentage (which
really doesn't seem to make much sense, considering that you usually
have just one or two cylinders) we will need to also handle the case of
editing the (differently sorted) cylinder table. Which we don't do now.
Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Henrik Aronsen points out that we've not made it possible to edit the He
percentages for trimix diving. It's easy enough to do, I just didn't
have any dives that needed it myself. So here goes.
Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Round maximum depth on dive list to get consistent data between the dive
list and dive info.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Miika fixed the statistics code that didn't properly check for the "no
cylinder info" case - this cleans it up and just uses the helper
function in equipment.c.
Rename the helper to be slightly better named while at it.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
O2 per cent from dive computer should be shown in Dive Info if one is
given even without pressure information for the cylinder.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
With the whole UI change (three-paned window and different look with new
colors), let's just make a new release, as Dirk points out.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'stars' of git://git.hohndel.org/subsurface:
Fix some issues with star rating code
Add typical 0 to 5 star rating for dives
Still not great editing, but other than that it looks good.
To waste less space in the tree view heading we simply put a star in the
heading instead of "Rating".
We now treat "zero stars" to mean "not rated" and don't store that value
in the XML file.
Rating is no longer a top level tag in the dive entry but instead a
property of the dive tag.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This works ok-ish, but doesn't allow us to click on the stars and edit
them in the divelist, which a user might expect to be able to do - in
most "star rating UIs" you simply click on the n-th star to set that
rating. Here you need to edit the dive and pick the rating from a drop
down menu.
Minor oddity: you can actually (if you force it) write anything you want
into the star rating. But anything that isn't one of the predefined
strings simply results in a zero star rating.
Overall the UI feels a bit... forced. But I think this is quite useful
anyway.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Suggested by Henrik Aronsen, and seems much more natural. Especially
with lots of keyboards having function keys oddly mapped.
Suggested-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Currently just tied to F1-F4 (for divelist, profile, info, and "all
three" respectively), which is just crazy. But using "ctrl-P" for
"Profile" isn't sane either, that's the standard printer keyboard
shortcut. So what would be good keyboard shortcuts for these things?
I also wonder how I can get gtk to shut up about the fact that a pane
becomes too small for the contents of that pane? We very much want to do
that, and it's very intentional. Gtk does the right thing apart from
the whining (and apart from the visually ugly part of a widget that
doesn't fit, but making it pretty doesn't really seem possible).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fix ugly printout, give colors proper names, make grid lines and alert
marker easier to see, and specify printer colors independently.
Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
The profile colors were defined all over the place, so I put them all in one spot. I'm unsure if this is the best solution to that problem, but I guess it's a step in the right direction.
Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
The profile colors aren't very pretty, and the grid lines are too thick.
This commit tries to improve that.
Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
grep for Target doesn't work on non english platforms
-dumpmachine is (hopefully) supposed to always return
the target machine tuple
Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'windows-fixes' of git://git.hohndel.org/subsurface:
fix mingw-win32 specific warnings in libdivecomputer.c
Fix mingw-make.sh to find correct xslt-config
Spelling: paragrahps -> paragraphs.
Update the README's example commit message to start with a capital
letter. Capitalize "Java".
Signed-off-by: Joachim Schipper <joachim@joachimschipper.nl>
1) since %lld is not defined in the MSVC runtime, use
the portable PRId64 macro from inttypes.h for 64bit integers
notice in inttypes.h from mingw-win32:
/* 7.8.1 Macros for format specifiers
*
* MS runtime does not yet understand C9x standard "ll"
* length specifier. It appears to treat "ll" as "l".
* The non-standard I64 length specifier causes warning in GCC,
* but understood by MS runtime functions.
*/
2) include unistd.h to disable warning:
warning: implicit declaration of function 'usleep'
Lubomir's code then caused a warning building natively under Linux, which
I fixed as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
* 'windows-fixes' of git://git.hohndel.org/subsurface:
Add more typecasts for Windows`
Fix the Windows preferences support
Update the Windows installer creation script
It doesn't make sense with the new three-pane layout, and I don't think
we're reviving it.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is based on an older patch by Lubomir I. Ivanov <neolit123@gmail.com>
which no longer applies due to the refactoring of the registry setting
code.
It takes care of all of the casts between actual C types and the Windows
specific types that the Windows API functions expect. It also adds some
comments to the overloading of "value" in our subsurface_set_conf function.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now that I can test Windows binaries again, the bugs were rather easy to
spot. Because of the different flow of the opening, writing and closing of
the registry key my first attempt got things wrong - we simply always
create the key with all access rights; if it exists Windows will just open
it for us. The second bug was a cut'n'paste error.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This now works with a straight out of the box MinGW install on OpenSUSE.
A simple shell script that shows how to invoke the cross build is
included.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should make the Makefile much more robust when cross compiling.
The windows.c code is now compile tested but not functionally tested.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds tested code for Linux and Mac OS, implementing the api that
Linus suggested.
The Windows code was moved into its own file, but hasn't even been compile
tested, yet.
In order to have just one interface to set or get a preference value we
encode TRUE as (void *) 1 and FALSE as NULL. This works consistently on
all platforms and regardless of whether we have 32 or 64 bit.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We assume every sample with a depth of less than 10cm to be on the
surface.
This does not impact our interpolated pressures (one could assume that the
diver is not breathing from the regulator when on the surface - but
without air integration that's just an assumption).
It also doesn't change our tank pressure coloring by sac rate as that
always uses the momentary sac rate. Technically speaking this might impact
the actual colors printed (as those are relative to the total sac on the
dive which may go up due to this change).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>