summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2015-06-16 21:15:46 +1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-16 20:32:40 -0700
commitf66ea4cbb03c126fce3805d778c9f197fb6fa5e8 (patch)
tree4d9cffaf012cd798bd5333b28721e522853b40ca
parentd9b39efeb7998392524ff2197683aef50246c6ab (diff)
downloadsubsurface-f66ea4cbb03c126fce3805d778c9f197fb6fa5e8.tar.gz
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 <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--planner.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/planner.c b/planner.c
index c8578c320..9b2d355fa 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 && !postponed) {