Profile2: add some print related flags

Some flags like printMode and isGrayscale are missing yet needed.
The flag printMode is required so that we know *when* to hide
certain elements such as the ruler and tool tip (e.g. not needed
while printing).

isGrayscale should be passed to all getColor() calls, so that
the greyscale color table is respected.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2014-03-25 23:34:09 +02:00 committed by Dirk Hohndel
parent ac23d7397f
commit 06a1cb0975
2 changed files with 12 additions and 1 deletions

View file

@ -83,7 +83,9 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
po2GasItem(new PartialPressureGasItem()),
heartBeatAxis(new DiveCartesianAxis()),
heartBeatItem(new DiveHeartrateItem()),
rulerItem(new RulerItem2())
rulerItem(new RulerItem2()),
isGrayscale(false),
printMode(false)
{
memset(&plotInfo, 0, sizeof(plotInfo));
@ -789,3 +791,9 @@ void ProfileWidget2::changeGas()
mark_divelist_changed(true);
replot();
}
void ProfileWidget2::setPrintMode(bool mode, bool grayscale)
{
printMode = mode;
isGrayscale = mode ? grayscale : false;
}

View file

@ -67,6 +67,7 @@ public:
void replot();
virtual bool eventFilter(QObject *, QEvent *);
void setupItem(AbstractProfilePolygonItem *item, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis, DivePlotDataModel *model, int vData, int hData, int zValue);
void setPrintMode(bool mode, bool grayscale = false);
public
slots: // Necessary to call from QAction's signals.
@ -126,6 +127,8 @@ private:
DiveCartesianAxis *heartBeatAxis;
DiveHeartrateItem *heartBeatItem;
RulerItem2 *rulerItem;
bool isGrayscale;
bool printMode;
};
#endif // PROFILEWIDGET2_H