summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/profilegraphics.cpp20
-rw-r--r--qt-ui/profilegraphics.h4
2 files changed, 17 insertions, 7 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index 1c6f76209..816a61827 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -268,6 +268,19 @@ void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw)
dc = fake_dc(dc);
}
+ QString nick(get_dc_nickname(dc->model, dc->deviceid));
+ if (nick.isEmpty())
+ nick = QString(dc->model);
+
+ if (nick.isEmpty())
+ nick = tr("unknown divecomputer");
+
+ if ( tr("unknown divecomputer") == nick){
+ mode = PLAN;
+ }else{
+ mode = DIVE;
+ }
+
/*
* Set up limits that are independent of
* the dive computer
@@ -309,13 +322,6 @@ void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw)
scene()->addItem(rect);
/* Put the dive computer name in the lower left corner */
- QString nick(get_dc_nickname(dc->model, dc->deviceid));
- if (nick.isEmpty())
- nick = QString(dc->model);
-
- if (nick.isEmpty())
- nick = tr("unknown divecomputer");
-
gc.leftx = 0; gc.rightx = 1.0;
gc.topy = 0; gc.bottomy = 1.0;
diff --git a/qt-ui/profilegraphics.h b/qt-ui/profilegraphics.h
index 2e4f0d596..a4d943233 100644
--- a/qt-ui/profilegraphics.h
+++ b/qt-ui/profilegraphics.h
@@ -68,6 +68,8 @@ class ProfileGraphicsView : public QGraphicsView
{
Q_OBJECT
public:
+ enum Mode{DIVE, PLAN};
+
ProfileGraphicsView(QWidget* parent = 0);
void plot(struct dive *d, bool forceRedraw = FALSE);
bool eventFilter(QObject* obj, QEvent* event);
@@ -117,6 +119,8 @@ private:
QGraphicsItem* timeMarkers;
QGraphicsItem* depthMarkers;
QGraphicsItem* diveComputer;
+
+ enum Mode mode;
};
#endif