dive computer nicknames

Dirk Hohndel dirk at hohndel.org
Thu Dec 13 23:42:34 PST 2012


I just pushed a fun change to master:

    Add the ability to set a nickname for a dive computer
    
    We maintain a list of dive computers that we know about (by deviceid) and
    their nicknames in our config. If the user downloads dive from a dive
    computer that we haven't seen before, we give them the option to set a
    nickname for that dive computer. That nickname is displayed in the profile
    (and stored in the XML file, assuming it is not the same as the model).
    
    This implementation attempts to make sure that it correctly deals with
    utf8 nicknames.

Lubomir - I'd love for you to verify that that last statement isn't a
blatant lie... I think I am correctly dealing with utf8 strings for the
nickname, but...

This change is really useful for people who have multiple dive computers
of the same brand or for anyone who wants to log dives for others (think
a dive shop or instructor that has a set of rental computers and wants
to download data from them for some after-dive conversations or
tracking).

And of course for anyone who wants a more descriptive name in their
profile (since with Linus' recent change we now display the name of the
dive computer in the profile - this is now replaced by the nickname, if
that nickname is set).

Please test - I tried to throw lots of different scenarios at this code
but that doesn't mean the code is actually correct.

By design this should store the known nicknames in the config - so it
should ask only once per dc what the nickname should be.

/D


More information about the subsurface mailing list