mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make the tissues be preferences-aware.
This patch adds a new class DiveCalculatedTissue that's preferences aware. It knows when to show or hide itself. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f8a4f8de81
commit
cde9bc0de9
4 changed files with 22 additions and 2 deletions
|
@ -388,6 +388,18 @@ void DiveCalculatedCeiling::paint(QPainter* painter, const QStyleOptionGraphicsI
|
||||||
QGraphicsPolygonItem::paint(painter, option, widget);
|
QGraphicsPolygonItem::paint(painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DiveCalculatedTissue::DiveCalculatedTissue()
|
||||||
|
{
|
||||||
|
preferencesChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiveCalculatedTissue::preferencesChanged()
|
||||||
|
{
|
||||||
|
QSettings s;
|
||||||
|
s.beginGroup("TecDetails");
|
||||||
|
setVisible(s.value("calcalltissues").toBool());
|
||||||
|
}
|
||||||
|
|
||||||
void DiveReportedCeiling::modelDataChanged()
|
void DiveReportedCeiling::modelDataChanged()
|
||||||
{
|
{
|
||||||
if (!hAxis || !vAxis || !dataModel || hDataColumn == -1 || vDataColumn == -1)
|
if (!hAxis || !vAxis || !dataModel || hDataColumn == -1 || vDataColumn == -1)
|
||||||
|
|
|
@ -103,6 +103,13 @@ public:
|
||||||
virtual void preferencesChanged();
|
virtual void preferencesChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class DiveCalculatedTissue : public DiveCalculatedCeiling {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
DiveCalculatedTissue();
|
||||||
|
void preferencesChanged();
|
||||||
|
};
|
||||||
|
|
||||||
class MeanDepthLine : public DiveLineItem {
|
class MeanDepthLine : public DiveLineItem {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -388,7 +388,7 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
||||||
qDeleteAll(allTissues);
|
qDeleteAll(allTissues);
|
||||||
allTissues.clear();
|
allTissues.clear();
|
||||||
for(int i = 0; i < 16; i++){
|
for(int i = 0; i < 16; i++){
|
||||||
DiveCalculatedCeiling *tissueItem = new DiveCalculatedCeiling();
|
DiveCalculatedTissue *tissueItem = new DiveCalculatedTissue();
|
||||||
tissueItem->setHorizontalAxis(timeAxis);
|
tissueItem->setHorizontalAxis(timeAxis);
|
||||||
tissueItem->setVerticalAxis(profileYAxis);
|
tissueItem->setVerticalAxis(profileYAxis);
|
||||||
tissueItem->setModel(dataModel);
|
tissueItem->setModel(dataModel);
|
||||||
|
|
|
@ -36,6 +36,7 @@ struct plot_info;
|
||||||
struct DiveGasPressureItem;
|
struct DiveGasPressureItem;
|
||||||
struct DiveCalculatedCeiling;
|
struct DiveCalculatedCeiling;
|
||||||
struct DiveReportedCeiling;
|
struct DiveReportedCeiling;
|
||||||
|
struct DiveCalculatedTissue;
|
||||||
|
|
||||||
class ProfileWidget2 : public QGraphicsView {
|
class ProfileWidget2 : public QGraphicsView {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -88,7 +89,7 @@ private:
|
||||||
QList<DiveEventItem*> eventItems;
|
QList<DiveEventItem*> eventItems;
|
||||||
DiveTextItem *diveComputerText;
|
DiveTextItem *diveComputerText;
|
||||||
DiveCalculatedCeiling *diveCeiling;
|
DiveCalculatedCeiling *diveCeiling;
|
||||||
QList<DiveCalculatedCeiling*> allTissues;
|
QList<DiveCalculatedTissue*> allTissues;
|
||||||
DiveReportedCeiling *reportedCeiling;
|
DiveReportedCeiling *reportedCeiling;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue