mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <helling@atdotde.de>
This commit is contained in:
parent
c9c9b1b399
commit
6afcbeef4d
1 changed files with 13 additions and 9 deletions
|
@ -591,12 +591,19 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool
|
||||||
len = show_disclaimer ? snprintf(buffer, sz_buffer, "<div><b>%s</b><br></div>", disclaimer) : 0;
|
len = show_disclaimer ? snprintf(buffer, sz_buffer, "<div><b>%s</b><br></div>", disclaimer) : 0;
|
||||||
|
|
||||||
if (diveplan->surface_interval > 60) {
|
if (diveplan->surface_interval > 60) {
|
||||||
len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s %d:%02d)</b><br>",
|
len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %d:%02d) %s %s<br>",
|
||||||
translate("gettextFromC", "Subsurface dive plan (surface interval "),
|
translate("gettextFromC", "Subsurface"),
|
||||||
FRACTION(diveplan->surface_interval / 60, 60));
|
subsurface_canonical_version(),
|
||||||
|
translate("gettextFromC", "dive plan</b> (surface interval "),
|
||||||
|
FRACTION(diveplan->surface_interval / 60, 60),
|
||||||
|
translate("gettextFromC", "created on"),
|
||||||
|
get_current_date());
|
||||||
} else {
|
} else {
|
||||||
len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s</b><br>",
|
len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %s</b><br>",
|
||||||
translate("gettextFromC", "Subsurface dive plan"));
|
translate("gettextFromC", "Subsurface"),
|
||||||
|
subsurface_canonical_version(),
|
||||||
|
translate("gettextFromC", "dive plan</b> created on"),
|
||||||
|
get_current_date());
|
||||||
}
|
}
|
||||||
|
|
||||||
len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "Runtime: %dmin<br></div>"),
|
len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "Runtime: %dmin<br></div>"),
|
||||||
|
@ -841,14 +848,11 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool
|
||||||
const char *depth_unit;
|
const char *depth_unit;
|
||||||
int altitude = (int) get_depth_units((int) (log(1013.0 / diveplan->surface_pressure) * 7800000), NULL, &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)<br>"),
|
len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "ATM pressure: %dmbar (%d%s)<br></div>"),
|
||||||
diveplan->surface_pressure,
|
diveplan->surface_pressure,
|
||||||
altitude,
|
altitude,
|
||||||
depth_unit);
|
depth_unit);
|
||||||
|
|
||||||
len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "Plan creation date and version: %s, %s<br></div>"),
|
|
||||||
get_current_date(), subsurface_canonical_version());
|
|
||||||
|
|
||||||
/* Get SAC values and units for printing it in gas consumption */
|
/* Get SAC values and units for printing it in gas consumption */
|
||||||
double bottomsacvalue, decosacvalue;
|
double bottomsacvalue, decosacvalue;
|
||||||
int sacdecimals;
|
int sacdecimals;
|
||||||
|
|
Loading…
Add table
Reference in a new issue