[PATCH] Typesetting in profile infobox

Dirk Hohndel dirk at hohndel.org
Wed Feb 26 14:43:23 PST 2014


Andrey - sorry for just looking at the bug issue on the first round of
feedback... here's some more feedback on your approach to fixing the
issue:

On Thu, 2014-02-27 at 00:00 +0200, Andrey Zhdanov wrote:
> There should be a space between the colon and the value in the information box in the profile.

Note it talks about the colon and the value, not about a space before
the descriptor letter (see below).

> The vertical speed should have only one digit after the decimal point (at least in metric units).

You didn't make a distinction between metric and non-metric (but I think that's fine).

> Fixes #443

Thanks, that's the correct syntax

> Signed-off-by: Andrey Zhdanov <andrjufka at gmail.com>
> ---
>  profile.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/profile.c b/profile.c
> index 5cb9564..dcf22a5 100644
> --- a/profile.c
> +++ b/profile.c
> @@ -1457,7 +1457,7 @@ static void plot_string(struct plot_data *entry, struct membuffer *b, bool has_n
>  	double depthvalue, tempvalue, speedvalue;
>  
>  	depthvalue = get_depth_units(entry->depth, NULL, &depth_unit);
> -	put_format(b, translate("gettextFromC","@:%d:%02d\nD:%.1f %s\n"), FRACTION(entry->sec, 60), depthvalue, depth_unit);
> +	put_format(b, translate("gettextFromC","@: %d:%02d\n D: %.1f %s\n"), FRACTION(entry->sec, 60), depthvalue, depth_unit);

This introduces a space before 'D' - that looks awkward, unless ALL of
the designators have the same space in front.

>  	if (GET_PRESSURE(entry)) {
>  		pressurevalue = get_pressure_units(GET_PRESSURE(entry), &pressure_unit);
>  		put_format(b, translate("gettextFromC","P:%d %s\n"), pressurevalue, pressure_unit);
> @@ -1470,7 +1470,7 @@ static void plot_string(struct plot_data *entry, struct membuffer *b, bool has_n
>  	/* Ascending speeds are positive, descending are negative */
>  	if (entry->speed > 0)
>  		speedvalue *= -1;
> -	put_format(b, translate("gettextFromC","V:%.2f %s\n"), speedvalue, vertical_speed_unit);
> +	put_format(b, translate("gettextFromC"," V: %.1f %s\n"), speedvalue, vertical_speed_unit);

Same as above.
There still tank pressure, temperature, and NDL that are missing the
space after the ':' (I'm sure there are more).

Can you look at those and get back with a better version of the patch?

Thanks

/D



More information about the subsurface mailing list