Commit graph

995 commits

Author SHA1 Message Date
Dirk Hohndel
513df18f50 Even more Mac-i-ness
Move the About and Preferences menu item to the App menu.
Switch the accelerator key to be Meta (i.e., Command) instead of Control

This required a bit of restructuring of the code, but it's all for a good
cause.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-03 07:25:35 -08:00
Dirk Hohndel
53ecd2025d Adding the right header file for R_OK on Windows
Dang, I should have compile tested this on Windows before the last
commit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-03 07:25:26 -08:00
Dirk Hohndel
7b5874ead7 Only set the window icon if the icon file exists
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-02 20:15:24 -08:00
Dirk Hohndel
43530d397b Correctly free the GSList in file_open
Passing a value that is known to be NULL to g_slist_free seems like the
wrong approach...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-02 20:13:45 -08:00
Dirk Hohndel
eac816b9d8 Use the right function to get resource path on Mac
Much better than hacking together my own...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-02 08:26:24 -08:00
Henrik Brautaset Aronsen
3232632fd6 Use a more standard approach to save preferences on MacOSX
CFPreferences* seems to be the proper way to handle preferences on MacOSX.
This approach also eliminates a problem where the hard coded preferences
path couldn't be read.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
[ fixed small coding style issues ]
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-02 07:31:19 -08:00
Dirk Hohndel
0915d2e691 More AsciiDoc updates
Add missing internal links

Work on better visual representation of structured data

Start creating quoted text (instead of styled text)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-01 17:41:05 -08:00
Dirk Hohndel
f10596f68b Update asciidoc headers and deal with internal links
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-01 16:52:45 -08:00
Linus Torvalds
1a83bf43b6 First try at converting user-manual to AsciiDoc
You can do "make doc" in the main directory to create the html version,
and if you want to play around with it, do "make show" in the
Documentation subdirectory to start firefox on the end result.

It's by no means perfect, but it gives somewhat reasonable results, and
this is enough initial work for people to play around with, I think.

NOTE! You need "asciidoc" installed to do this: it's a python program,
so it should be pretty easy even on non-Linux platforms.  And on Linux,
most distributions package it, so you just have to do something like

	yum install asciidoc

to get it (replace with apt-get/zypper/whatever).

Asciidoc can generate other output too (man-pages, LaTeX, etc), maybe
people want to play with that part too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-01 15:12:28 -08:00
Linus Torvalds
1d51c77729 Merge branch 'mac' of git://git.hohndel.org/subsurface
* 'mac' of git://git.hohndel.org/subsurface:
  Turn subsurface into a real Mac application
2012-01-01 14:37:38 -08:00
Dirk Hohndel
605e063203 Turn subsurface into a real Mac application
To do this a few things needed to move into the os specific files, but the
overall change is fairly small and the difference on the Mac is amazing.

Subsurface now becomes a Mac app with Mac toolbar and useful default
fonts.

Changed the CFBundleIdentifier to be the reverse DNS of the subsurface
site (sadly, 'torvalds' is not yet a TLD).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-01 14:01:38 -08:00
Henrik Brautaset Aronsen
16b6df559f Define O2 permille for air in one spot
Having the O2 permille defined once is more readable.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
2011-12-31 17:15:59 +01:00
Henrik Brautaset Aronsen
2175226580 Display OTU for dives using air
Zero o2 means 20.9% o2, which can be confusing...

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
2011-12-31 17:00:36 +01:00
Linus Torvalds
e5b6bfc7ed Move the gasmix cleanups from XML parsing to the generic dive fixup stage
Right now we do certain cylinder info operations only when importing
from an XML file, which is wrong.  In particular, we do the "is the
gasmix air" or "what is the standard cylinder name" only at XML read
time, which means that if you import a dive directly from the dive
computer, it won't have the air sanitization or the proper default
cylinder names.

Of course, most dive computers don't actually save enough cylinder
information for us to do the cylinder name lookup anyway, but some do.
And all Nitrox-capable dive computers do have that O2 percentage that
needs cleanup too.

Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-12-30 13:09:17 -08:00
Dirk Hohndel
565736a471 Make icon file name OS helper function
This way we can load the correct icon on the Mac without ugly hacks in the
OS independent code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-28 15:57:36 -08:00
Linus Torvalds
a8676438a7 Merge branches 'windows', 'docs' and 'forlinus' of git://git.hohndel.org/subsurface
* 'windows' of git://git.hohndel.org/subsurface:
  Fixes for the Windows installer

* 'docs' of git://git.hohndel.org/subsurface:
  Version 0.0.7 of user manual

* 'forlinus' of git://git.hohndel.org/subsurface:
  Remove unused return value
2011-12-27 09:27:33 -08:00
Dirk Hohndel
4dfbb7394f Remove unused return value
We never use the number of decimals that this function returns. So we
might as well not return them to begin with.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-26 16:46:06 -08:00
Jacco van Koll
265fa8ec1f Version 0.0.7 of user manual
Added chapter 14: The menu and sub-menus

Signed-off-by: Jacco van Koll <jko@haringstad.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-26 16:15:30 -08:00
Dirk Hohndel
210781e7be Fixes for the Windows installer
Add missing files and update a library version number.

The library version thing seems to indicate that this is much more fragile
than I'd want it to be...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-26 16:07:03 -08:00
Henrik Brautaset Aronsen
1511711507 There's a difference between "it's" and "its"
Just sayin'

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
2011-12-26 12:08:34 +01:00
Cristian Ionescu-Idbohrn
4cd67e027c Fix incorrect utf-8 in Documentation/user-manual.txt
Not sure, but us-ascii might have been intended.

Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com>
[ And even if you do want to use utf8, you should use it correctly, not
  with this "pick random character" approach  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-12-24 13:48:54 -08:00
Linus Torvalds
f2ccd1c3d5 Merge branch 'docs' of git://git.hohndel.org/subsurface
* 'docs' of git://git.hohndel.org/subsurface:
  Version 0.0.6 of user manual
2011-12-23 20:23:04 -08:00
Jacco van Koll
4fe64e95d3 Version 0.0.6 of user manual
Corrected some typo's
Modified chapter 12. Importing dives from JDivelogAdded chapter 13.
Importing dives from Suunto Divemanager 3.*
Added Appendix B: very tiny example script for importing Suunto
Divemanager 3.* xml files

Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-23 19:44:56 -08:00
Linus Torvalds
34dcc119fe parse-xml: read the file into memory separately
Using xmlParseFile() was simple, but I'm planning on extending the file
parsing past just XML, since we want to be able to import other formats
too.  And quite frankly, that means that we'll want to read the file
into memory to look at it before we start parsing it.

We could decide do it by file extensions too, and I'll look at that
approach as well, but regardless of how we do things it's almost
certainly a good idea to do the file access in one place.  The XML
parsing might as well happen from a memory buffer instead anyway.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-12-18 18:34:02 -08:00
Linus Torvalds
11495bbb2b Use an ellipsis for Nitrox O2% ranges
The plain dash may look a bit too much like a trimix specification.  Is
the ellipsis better? Maybe.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-12-18 18:33:56 -08:00
Miika Turkia
d1d17c543c Multiple cylinder support for JDiveLog import
Support for multiple cylinders and gas change events when Importing
JDiveLog logs to Subsurface. This is tested with manually crafted data
and not real data (originating from dive computer).

NOTE: Subsurface does not handle importing multiple cylinders
correctly but imports only the first cylinder. However, manually
converting data to a file and opening that in Subsurface works
correctly.
 (xsltproc jdivelog2subsurface.xslt jdivelog-gas.jlb > gas.xml)

Some minor tweaking on importing JDiveLog specific fields to notes
fields in Subsurface is also included.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-12-18 11:56:26 -08:00
Dirk Hohndel
84f172dccb Add more details to import chapter of user-manual
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-16 13:11:29 -08:00
Jacco van Koll
4ce4f4441c Version 0.0.5 of user manual
Added chapter 12. Importing dives from JDivelog
Adding some divecomputers to Appendix A

Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
2011-12-16 13:02:50 -08:00
Linus Torvalds
b5139aeb22 Merge branch 'forlinus' of git://git.hohndel.org/subsurface
* 'forlinus' of git://git.hohndel.org/subsurface:
  Return is not a function
2011-12-14 21:06:00 -08:00
Dirk Hohndel
0a9e5aa735 Return is not a function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-14 20:53:25 -08:00
Linus Torvalds
b0759feef8 Merge branch 'forlinus' of git://git.hohndel.org/subsurface
* 'forlinus' of git://git.hohndel.org/subsurface:
  Improve Makefile for MacOS
  Add reasonable default device names for divecomputer import
  More intuitive label for "not saving" when exiting
2011-12-14 18:19:48 -08:00
Dirk Hohndel
6245b700a4 Improve Makefile for MacOS
Some macs appear to need "-framework CoreFoundation" added to the linking
step, others (which appear to have the exact same OS and tools installed),
don't. But as it doesn't appeart to hurt, I unconditionally add this.

Switched to using pkgconfig to find libdivecomputer on the Mac.

Tried to clean up the Makefile a bit

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Acked-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
2011-12-14 11:22:12 -08:00
Dirk Hohndel
4b77a5def6 Add reasonable default device names for divecomputer import
So far we hard coded /dev/ttyUSB0 - which is a good starting point in
Linux but not so useful on Windows or MacOS. This was now moved into one
of our OS helper functions with (somewhat) reasonable defaults.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-13 20:34:56 -08:00
Dirk Hohndel
df12fcf310 Clarify documentation about connecting dive computers
This works rather differently on the different OSs

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-13 20:16:46 -08:00
Jacco van Koll
8fc7cafa56 Version 0.0.4 of user manual
Cleanup of the layout
Changed line-length to 74
Added chapter 11. How to find the Device Name
Added Appendix A: Supported divecomputers

Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
2011-12-13 19:55:26 -08:00
Dirk Hohndel
001f6d05dc More intuitive label for "not saving" when exiting
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>
2011-12-13 15:02:17 -08:00
Dirk Hohndel
269b5c0286 Fixing whitespace, line wrapping
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-12 14:46:55 -08:00
Jacco van Koll
4a6d3835d0 Version 0.0.3 of user manual
Added missing chapters. Now includes adding information.
2011-12-12 14:37:07 -08:00
Jacco van Koll
52bba5aad9 Version 0.0.2 of user manual
Signed-off-by:    Jacco van Koll <jacco.van.koll@gmail.com>
2011-12-12 12:49:27 -08:00
Dirk Hohndel
636e7b512f Reformat, reorganize and slightly modify user manual
Getting started on better user documentation. Awesome.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-12 12:18:32 -08:00
Jacco van Koll
a9f6bad5db First draft of user documentation
Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
2011-12-12 12:03:04 -08:00
Linus Torvalds
827c1e3521 Merge branch 'forlinus' of git://git.hohndel.org/subsurface
* '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
2011-12-12 11:20:36 -08:00
Dirk Hohndel
4e4e3cc43a Small improvement to plot info debugging code
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-12 10:13:03 -08:00
Dirk Hohndel
d7482356fd Add three more trimix test dives
This allows us to check what we display in the dive list and how we sort
it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-12 10:12:29 -08:00
Dirk Hohndel
1802487e4f Make test dive 15 a bit more useful
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-12 10:11:53 -08:00
Dirk Hohndel
989a70727d Two test dives I added a couple of months ago
...and never commited

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-12 09:24:54 -08:00
Dirk Hohndel
549ad65bcb Add libxslt to Windows packaging file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-12 09:24:54 -08:00
Linus Torvalds
393c437772 Pack the star rating on a line of its own
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>
2011-12-12 09:24:47 -08:00
Linus Torvalds
d3f1a30364 divelist: show/sort nitrox dive oxygen percentage as a range
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>
2011-12-12 09:20:22 -08:00
Linus Torvalds
51176cb089 Make the dive gas record the single highest mix
.. 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>
2011-12-11 21:28:18 -08:00