From 3076dc6d47584b42200d050beefa26ac9df8d20c Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 13 Jul 2013 17:02:06 +0300 Subject: Profile: add the isGrayscale flag setPrintMode() can now be used to set the profile to be plotted in grayscale. Signed-off-by: Lubomir I. Ivanov --- qt-ui/profilegraphics.cpp | 4 +++- qt-ui/profilegraphics.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 1fe3fbe88..98f01db10 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -47,6 +47,7 @@ extern int evn_used; ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent), toolTip(0) , dive(0), diveDC(0) { printMode = false; + isGrayscale = false; gc.printer = false; fill_profile_color(); setScene(new QGraphicsScene()); @@ -190,9 +191,10 @@ void ProfileGraphicsView::refresh() plot(current_dive, TRUE); } -void ProfileGraphicsView::setPrintMode(bool mode) +void ProfileGraphicsView::setPrintMode(bool mode, bool grayscale) { printMode = mode; + isGrayscale = grayscale; } void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw) diff --git a/qt-ui/profilegraphics.h b/qt-ui/profilegraphics.h index a0c0161a3..04a057bdc 100644 --- a/qt-ui/profilegraphics.h +++ b/qt-ui/profilegraphics.h @@ -92,7 +92,7 @@ public: void plot(struct dive *d, bool forceRedraw = FALSE); bool eventFilter(QObject* obj, QEvent* event); void clear(); - void setPrintMode(bool); + void setPrintMode(bool mode, bool grayscale = FALSE); protected: void resizeEvent(QResizeEvent *event); @@ -136,6 +136,7 @@ private: struct divecomputer *diveDC; int zoomLevel; bool printMode; + bool isGrayscale; // Top Level Items. QGraphicsItem* profileGrid; -- cgit v1.2.3-70-g09d2