diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-10 17:33:46 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-10 17:33:46 -0300 |
commit | b4835badb6addf8385b7800c673b25789089ea84 (patch) | |
tree | f4772d2292522cd44829db41577630cfa93a6753 /qt-ui/profilegraphics.cpp | |
parent | 1baef83791ce1dd29b4784420dc9c34cd5ff9680 (diff) | |
download | subsurface-b4835badb6addf8385b7800c673b25789089ea84.tar.gz |
Added a 'Plan' mode and a 'Dive' mode on the profile.
Added a 'Plan' mode and a 'Dive' mode on the profile. Those modes
tell the application what can be done: Plan - the dive's dinamyc and
can be changed, 'Dive', the dive is fixed ( most probably downloaded
from a dive computer and it's readonly. ) - now I need to properly
populate stuff.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 20 |
1 files changed, 13 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; |