diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2017-03-31 08:14:36 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-04-06 18:29:11 -0700 |
commit | c9c9b1b39951500829febd49adf9ead0d9426b59 (patch) | |
tree | aaca1a3969bd94f427ab97c262d76b58c831ae66 /core/planner.c | |
parent | 385816be2ee120850415ae79a2187bf0cdbce593 (diff) | |
download | subsurface-c9c9b1b39951500829febd49adf9ead0d9426b59.tar.gz |
Add creation date and Subsurface version to planner output
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'core/planner.c')
-rw-r--r-- | core/planner.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/planner.c b/core/planner.c index 614634f20..fdda64940 100644 --- a/core/planner.c +++ b/core/planner.c @@ -15,6 +15,7 @@ #include "gettext.h" #include "libdivecomputer/parser.h" #include "qthelperfromc.h" +#include "version.h" #define TIMESTEP 2 /* second */ #define DECOTIMESTEP 60 /* seconds. Unit of deco stop times */ @@ -67,6 +68,9 @@ void dump_plan(struct diveplan *diveplan) } #endif +/* this is in qthelper.cpp, so including the .h file is a pain */ +extern const char *get_current_date(); + bool diveplan_empty(struct diveplan *diveplan) { struct divedatapoint *dp; @@ -837,11 +841,14 @@ 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)<br></div>"), + len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "ATM pressure: %dmbar (%d%s)<br>"), diveplan->surface_pressure, altitude, 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 */ double bottomsacvalue, decosacvalue; int sacdecimals; |