Switch the column order of the planner notes table so that duration is
displayed before runtime.  This is consistent with:
- the verbatim output order, e.g. "Stay at 12.0 m for 3:00 min - runtime
32:48 on EAN50"
- MultiDeco, e.g. http://www.hhssoftware.com/multideco/view_multideco.html
- Planner on the Shearwater Petrel
- How I have been taught to write out my dive plan in my wetnotes

R
From d929b61a0b14db26de6e34140c28bd2a5ccdecc4 Mon Sep 17 00:00:00 2001
From: Rick Walsh <[email protected]>
Date: Tue, 16 Jun 2015 21:15:46 +1000
Subject: [PATCH 3/3] Show duration before runtime on planner notes table

Switch the column order of the planner notes table so that duration is displayed before runtime.  This is consistent with:
- the verbatim output order, e.g. "Stay at 12.0 m for 3:00 min - runtime 32:48 on EAN50"
- MultiDeco, e.g. http://www.hhssoftware.com/multideco/view_multideco.html
- Planner on the Shearwater Petrel
- How I have been taught to write out my dive plan in my wetnotes

Signed-off-by: Rick Walsh <[email protected]>
---
 planner.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/planner.c b/planner.c
index 8ac66e5..0e1bae4 100644
--- a/planner.c
+++ b/planner.c
@@ -552,12 +552,12 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool
 	if (!plan_verbatim) {
 		len += snprintf(buffer + len, sizeof(buffer) - len, "<div><table><thead><tr><th>%s</th>",
 				translate("gettextFromC", "depth"));
-		if (plan_display_runtime)
-			len += snprintf(buffer + len, sizeof(buffer) - len, "<th style='padding-left: 10px;'>%s</th>",
-					translate("gettextFromC", "runtime"));
 		if (plan_display_duration)
 			len += snprintf(buffer + len, sizeof(buffer) - len, "<th style='padding-left: 10px;'>%s</th>",
 					translate("gettextFromC", "duration"));
+		if (plan_display_runtime)
+			len += snprintf(buffer + len, sizeof(buffer) - len, "<th style='padding-left: 10px;'>%s</th>",
+					translate("gettextFromC", "runtime"));
 		len += snprintf(buffer + len, sizeof(buffer) - len,
 				"<th style='padding-left: 10px; float: left;'>%s</th></tr></thead><tbody style='float: left;'>",
 				translate("gettextFromC", "gas"));
@@ -640,14 +640,14 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool
 			if ((dp->depth == lastdepth && dp->depth != nextdp->depth) || plan_display_transitions || dp->entered || !dp->next || (gaschange && dp->next && dp->depth != nextdp->depth)) {
 				snprintf(temp, sizeof(temp), translate("gettextFromC", "%3.0f%s"), depthvalue, depth_unit);
 				len += snprintf(buffer + len, sizeof(buffer) - len, "<tr><td style='padding-left: 10px; float: right;'>%s</td>", temp);
-				if (plan_display_runtime) {
-					snprintf(temp, sizeof(temp), translate("gettextFromC", "%3dmin"), (dp->time + 30) / 60);
-					len += snprintf(buffer + len, sizeof(buffer) - len, "<td style='padding-left: 10px; float: right;'>%s</td>", temp);
-				}
 				if (plan_display_duration) {
 					snprintf(temp, sizeof(temp), translate("gettextFromC", "%3dmin"), (dp->time - lasttime + 30) / 60);
 					len += snprintf(buffer + len, sizeof(buffer) - len, "<td style='padding-left: 10px; float: right;'>%s</td>", temp);
 				}
+				if (plan_display_runtime) {
+					snprintf(temp, sizeof(temp), translate("gettextFromC", "%3dmin"), (dp->time + 30) / 60);
+					len += snprintf(buffer + len, sizeof(buffer) - len, "<td style='padding-left: 10px; float: right;'>%s</td>", temp);
+				}
 
 				if (gaschange) {
 					if(dp->depth != lastdepth && plan_display_transitions && !postponed) {
-- 
2.4.3

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to