From 6afcbeef4d006c608bb8a8d060aea416cebccc7b Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Thu, 6 Apr 2017 22:19:57 +0200 Subject: Move version and date around notes to save space This prints this information in the header near "Subsurface" where I guess at least the version information belongs. Plus it saves a line. Signed-off-by: Robert C. Helling --- core/planner.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/core/planner.c b/core/planner.c index fdda64940..aa58552d2 100644 --- a/core/planner.c +++ b/core/planner.c @@ -591,12 +591,19 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool len = show_disclaimer ? snprintf(buffer, sz_buffer, "
%s
", disclaimer) : 0; if (diveplan->surface_interval > 60) { - len += snprintf(buffer + len, sz_buffer - len, "
%s %d:%02d)
", - translate("gettextFromC", "Subsurface dive plan (surface interval "), - FRACTION(diveplan->surface_interval / 60, 60)); + len += snprintf(buffer + len, sz_buffer - len, "
%s (%s) %s %d:%02d) %s %s
", + translate("gettextFromC", "Subsurface"), + subsurface_canonical_version(), + translate("gettextFromC", "dive plan
(surface interval "), + FRACTION(diveplan->surface_interval / 60, 60), + translate("gettextFromC", "created on"), + get_current_date()); } else { - len += snprintf(buffer + len, sz_buffer - len, "
%s
", - translate("gettextFromC", "Subsurface dive plan")); + len += snprintf(buffer + len, sz_buffer - len, "
%s (%s) %s %s
", + translate("gettextFromC", "Subsurface"), + subsurface_canonical_version(), + translate("gettextFromC", "dive plan created on"), + get_current_date()); } len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "Runtime: %dmin
"), @@ -841,14 +848,11 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool const char *depth_unit; int altitude = (int) get_depth_units((int) (log(1013.0 / diveplan->surface_pressure) * 7800000), NULL, &depth_unit); - len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "ATM pressure: %dmbar (%d%s)
"), + len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "ATM pressure: %dmbar (%d%s)
"), diveplan->surface_pressure, altitude, depth_unit); - len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "Plan creation date and version: %s, %s
"), - get_current_date(), subsurface_canonical_version()); - /* Get SAC values and units for printing it in gas consumption */ double bottomsacvalue, decosacvalue; int sacdecimals; -- cgit v1.2.3-70-g09d2