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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-02-27 15:31:56 -03:00 committed by Dirk Hohndel
parent 35e102b176
commit c356fac3b6

View file

@ -433,6 +433,11 @@ void ProfileWidget2::settingsChanged()
dataModel->clear();
plotDives(QList<dive*>() << 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 );