Hi,

here are two more patches I hope address your suggestions:

From bb921c22286f0e70e9c56f32d45c0a2a907bdeb3 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Fri, 8 May 2015 23:16:26 +0200
Subject: [PATCH 1/2] Change menu entry for "replan"

Signed-off-by: Robert C. Helling <[email protected]>
---
 qt-ui/mainwindow.ui | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui
index b5456f2..8e98bed 100644
--- a/qt-ui/mainwindow.ui
+++ b/qt-ui/mainwindow.ui
@@ -458,7 +458,7 @@
   </action>
   <action name="actionReplanDive">
    <property name="text">
-    <string>Re-plan &amp;dive</string>
+    <string>Edit &amp;dive in planner</string>
    </property>
   </action>
   <action name="profPO2">
-- 
1.9.5 (Apple Git-50.3)

From 36ae335aedbfef291afa93a911991ea8a044caf9 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Fri, 8 May 2015 23:16:55 +0200
Subject: [PATCH 2/2] Keep old notes when saving as new dive in replan

... but discard an old disclaimer and runtime table if present.

Signed-off-by: Robert C. Helling <[email protected]>
---
 qt-ui/diveplanner.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 42570da..aacca8e 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -1328,6 +1328,11 @@ void DivePlannerPointsModel::createPlan(bool replanCopy)
                        if (current_dive->divetrip)
                                add_dive_to_trip(copy, current_dive->divetrip);
                        record_dive(copy);
+                       QString oldnotes(current_dive->notes);
+                       if (oldnotes.indexOf(QString(disclaimer)) >= 0)
+                               
oldnotes.truncate(oldnotes.indexOf(QString(disclaimer)));
+                       oldnotes.append(displayed_dive.notes);
+                       displayed_dive.notes = strdup(oldnotes.toUtf8().data());
                }
                copy_dive(&displayed_dive, current_dive);
        }
-- 
1.9.5 (Apple Git-50.3)


On 08 May 2015, at 19:23, Dirk Hohndel <[email protected]> wrote:

So why would this be called "replan" instead of "edit dive“?

This is easy and in patch 0001.

And if a dive isn't planned but edited, then we shouldn't have the dive
plan language in the notes field (this happened when I clicked "save
new“).

I am not sure if 0002 is what you had in mind. This keeps the old notes from the logged dive and adds the disclaimer and runtime table. Or do you want something entirely different than the runtime table?


But overall I love it.

Thanks.

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

Reply via email to