Hi,

On 26 Feb 2017, at 10:41, Stefan Fuchs <[email protected]> wrote:

If nobody disagrees I can change this after my holiday. I had a look at
the code already and found out that this may be no complete no brainer
but let's see if I can do it...

thanks to the magic of OO programming, this is surprisingly simple (I thought this would be a sentence I would never write).

Hint: You want to overwrite the headerData method. 

If you don’t want to figure it out yourself, there is a patch in the attachments.

Best
Robert

PS: Do I have to say: ACK?

From 7c879aac44b6c6284df4d9aa6281a8ae5c833c19 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Sun, 26 Feb 2017 13:34:17 +0100
Subject: [PATCH] Call the cylinder working pressure "starting pressure" in
 planner
To: [email protected]

Signed-off-by: Robert C. Helling <[email protected]>
---
 qt-models/cylindermodel.cpp | 9 +++++++++
 qt-models/cylindermodel.h   | 1 +
 2 files changed, 10 insertions(+)

diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index fe63cf6..642db98 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -18,6 +18,15 @@ CylindersModel::CylindersModel(QObject *parent) :
 
 }
 
+QVariant CylindersModel::headerData(int section, Qt::Orientation orientation, 
int role) const
+{
+       if (role == Qt::DisplayRole && in_planner() && section == WORKINGPRESS)
+               return "Start pres.";
+       else
+               return CleanerTableModel::headerData(section, orientation, 
role);
+}
+
+
 CylindersModel *CylindersModel::instance()
 {
 
diff --git a/qt-models/cylindermodel.h b/qt-models/cylindermodel.h
index ce2c87e..88da804 100644
--- a/qt-models/cylindermodel.h
+++ b/qt-models/cylindermodel.h
@@ -40,6 +40,7 @@ public:
        void updateDecoDepths(pressure_t olddecopo2);
        cylinder_t *cylinderAt(const QModelIndex &index);
        bool changed;
+       virtual QVariant headerData(int section, Qt::Orientation orientation, 
int role) const;
 
 public
 slots:
-- 
2.10.1 (Apple Git-78)

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

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

Reply via email to