From c356fac3b686468dba98b4650e045849274c8a4d Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 27 Feb 2014 15:31:56 -0300 Subject: New profile: Toggle on / off the ruler via settings. This patch toggles on / off the ruler via QSettings. When the user clicks on the toolbar, this sets the settings to true / false, in a way that if the user turns Subsurface on/ off, we still get the last choosed option. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index c2de05d3c..ca176a3d4 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -433,6 +433,11 @@ void ProfileWidget2::settingsChanged() dataModel->clear(); plotDives(QList() << getDiveById(diveId)); } + + bool rulerVisible = s.value("rulergraph", false).toBool(); + rulerItem->setVisible(rulerVisible); + rulerItem->destNode()->setVisible(rulerVisible ); + rulerItem->sourceNode()->setVisible(rulerVisible ); } void ProfileWidget2::resizeEvent(QResizeEvent* event) @@ -591,7 +596,7 @@ void ProfileWidget2::setProfileState() } } - bool rulerVisible = s.value("rulervisible", false).toBool(); + bool rulerVisible = s.value("rulergraph", false).toBool(); rulerItem->setVisible(rulerVisible); rulerItem->destNode()->setVisible(rulerVisible ); rulerItem->sourceNode()->setVisible(rulerVisible ); -- cgit v1.2.3-70-g09d2