summaryrefslogtreecommitdiffstats
path: root/qt-ui/profilegraphics.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-01 11:19:23 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-01 11:19:23 -0700
commit9e635392373cdc56fb3a897ea491e7c33fdbd424 (patch)
treef774d955632b301428088365d41abe62badfdd26 /qt-ui/profilegraphics.cpp
parent1a4d098ef2062923bbe09538cc01c1d130989640 (diff)
parent0e96c9f62e3a7030d9208f32e59390cb3fd20bbe (diff)
downloadsubsurface-9e635392373cdc56fb3a897ea491e7c33fdbd424.tar.gz
Merge branch 'editMode' of github.com:tcanabrava/subsurface
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r--qt-ui/profilegraphics.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index cba803de2..0eed723dd 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -342,7 +342,7 @@ void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw)
}
if (!printMode)
- addControlItems();
+ addControlItems(d);
if (rulerEnabled && !printMode)
add_ruler();
@@ -378,20 +378,28 @@ void ProfileGraphicsView::plot_depth_scale()
depthMarkers->setPos(depthMarkers->pos().x() - 10, 0);
}
-void ProfileGraphicsView::addControlItems()
+void ProfileGraphicsView::addControlItems(struct dive *d)
{
QAction *scaleAction = new QAction(QIcon(":scale"), tr("Scale"), this);
QAction *rulerAction = new QAction(QIcon(":ruler"), tr("Ruler"), this);
QToolBar *toolBar = new QToolBar("", 0);
toolBar->addAction(rulerAction);
toolBar->addAction(scaleAction);
+ toolBar->setOrientation(Qt::Vertical);
//make toolbar transparent
- toolBar->setStyleSheet(QString::fromUtf8 ("background-color: rgba(255,255,255,0);"));
+ //toolBar->setStyleSheet(QString::fromUtf8 ("background-color: rgba(255,255,255,0);"));
connect(scaleAction, SIGNAL(triggered()), this, SLOT(on_scaleAction()));
connect(rulerAction, SIGNAL(triggered()), this, SLOT(on_rulerAction()));
- toolBarProxy = scene()->addWidget(toolBar);
//Put it into the lower right corner of the profile
+
+ QString defaultDC(d->dc.model);
+ if (defaultDC == tr("manually added dive") || defaultDC == tr("Simulated Dive")) {
+ QAction *editAction = new QAction(QIcon(":edit"), tr("Edit"), this);
+ toolBar->addAction(editAction);
+ connect(editAction, SIGNAL(triggered()), mainWindow(), SLOT(editCurrentDive()));
+ }
+ toolBarProxy = scene()->addWidget(toolBar);
toolBarProxy->setPos(gc.maxx-toolBar->width(), gc.maxy-toolBar->height());
}