[GRASS-dev] new std options for files

Glynn Clements glynn at gclements.plus.com
Wed Mar 21 13:55:56 EDT 2007


Hamish wrote:

> > I've just added two new standard options for file input and output to
> > the parser. Time to make distclean again, sorry. (added to the end of
> > the list, so there shouldn't be as much weirdness this time)
> 
> as earlier mentioned* I'd like to change the Option struct to
> rationalize the ->description and ->label parts.
> 
> currently, if a label is defined it becomes the description, and the
> description becomes the tooltip. This is non-intuitive and inconsistent.

This is between the application and the GUI code. The parser options
which generate descriptions (--interface-description, --tcltk,
--script etc) simply output the contents of those fields as-is.

I note that a few of the standard options abuse these fields, assuming
that both fields will be displayed consecutively (as is done for
--help). Those should be fixed, as should applications which use the
fields in a similar manner.

> Proposed change: ->description is always the option description, and
> ->tooltip, if present, contains the tooltip. ->label is dropped.

->description should be a description suitable for --help or use in
the manual page. If present, ->label should be a shorter description
for use in dialogs in case ->description is too long for that purpose. 

I'm not sure that you really need tooltips when you already have a
text label, but if they are desired, they may as well contain the
contents of the ->description field.

> Also in Flag and GModule structs.
> 
> Alternative (which I'm leaning towards):  keep ->label, just remove the
> weirdness and make it always be the tooltip.

The weirdness (e.g. misuse of those fields by G_OPT_WHERE and
G_OPT_V_CATS) should definitely be removed.

I see no point in having a tooltip which says exactly the same thing
as the label. Tooltips are only useful if they contain additional
information which isn't in the button/checkbox/etc label (e.g. because
the button uses an icon or a terse description).

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list