summaryrefslogtreecommitdiffstats
path: root/core/plannernotes.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/plannernotes.c')
-rw-r--r--core/plannernotes.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/core/plannernotes.c b/core/plannernotes.c
index ffbf0b1cb..131820a5b 100644
--- a/core/plannernotes.c
+++ b/core/plannernotes.c
@@ -85,20 +85,29 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
len = show_disclaimer ? snprintf(buffer, sz_buffer, "<div><b>%s</b><br></div>", disclaimer) : 0;
- if (diveplan->surface_interval > 60) {
- len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %d:%02d) %s %s<br>",
+ if (diveplan->surface_interval < 0) {
+ len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s<br>",
translate("gettextFromC", "Subsurface"),
subsurface_canonical_version(),
- translate("gettextFromC", "dive plan</b> (surface interval "),
- FRACTION(diveplan->surface_interval / 60, 60),
- translate("gettextFromC", "created on"),
- get_current_date());
- } else {
+ translate("gettextFromC", "dive plan</b> (Overlapping dives detected)"));
+ dive->notes = strdup(buffer);
+ free((void *)buffer);
+ free((void *)temp);
+ return;
+ } else if (diveplan->surface_interval >= 48 * 60 *60) {
len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %s</b><br>",
translate("gettextFromC", "Subsurface"),
subsurface_canonical_version(),
translate("gettextFromC", "dive plan</b> created on"),
get_current_date());
+ } else {
+ len += snprintf(buffer + len, sz_buffer - len, "<div><b>%s (%s) %s %d:%02d) %s %s<br>",
+ translate("gettextFromC", "Subsurface"),
+ subsurface_canonical_version(),
+ translate("gettextFromC", "dive plan</b> (surface interval "),
+ FRACTION(diveplan->surface_interval / 60, 60),
+ translate("gettextFromC", "created on"),
+ get_current_date());
}
if (prefs.display_variations)