Mercurial > hg > sonic-visualiser
diff main/MainWindow.cpp @ 703:049a9418cc27
Start up with the correct values of toggleable menu entries
author | Chris Cannam |
---|---|
date | Fri, 28 Mar 2014 15:43:04 +0000 |
parents | 7f7fba33b7de |
children | d1c5444be23d |
line wrap: on
line diff
--- a/main/MainWindow.cpp Thu Mar 27 13:32:56 2014 +0000 +++ b/main/MainWindow.cpp Fri Mar 28 15:43:04 2014 +0000 @@ -914,7 +914,7 @@ action->setStatusTip(tr("Show or hide the centre line")); connect(action, SIGNAL(triggered()), this, SLOT(toggleCentreLine())); action->setCheckable(true); - action->setChecked(true); + action->setChecked(m_viewManager->shouldShowCentreLine()); m_keyReference->registerShortcut(action); menu->addAction(action); @@ -929,12 +929,14 @@ QActionGroup *overlayGroup = new QActionGroup(this); + ViewManager::OverlayMode mode = m_viewManager->getOverlayMode(); + action = new QAction(tr("Show &No Overlays"), this); action->setShortcut(tr("0")); action->setStatusTip(tr("Hide times, layer names, and scale")); connect(action, SIGNAL(triggered()), this, SLOT(showNoOverlays())); action->setCheckable(true); - action->setChecked(false); + action->setChecked(mode == ViewManager::NoOverlays); overlayGroup->addAction(action); m_keyReference->registerShortcut(action); menu->addAction(action); @@ -944,7 +946,7 @@ action->setStatusTip(tr("Show times and basic scale")); connect(action, SIGNAL(triggered()), this, SLOT(showMinimalOverlays())); action->setCheckable(true); - action->setChecked(true); + action->setChecked(mode == ViewManager::MinimalOverlays); overlayGroup->addAction(action); m_keyReference->registerShortcut(action); menu->addAction(action); @@ -954,7 +956,7 @@ action->setStatusTip(tr("Show times, layer names, and scale")); connect(action, SIGNAL(triggered()), this, SLOT(showAllOverlays())); action->setCheckable(true); - action->setChecked(false); + action->setChecked(mode == ViewManager::AllOverlays); overlayGroup->addAction(action); m_keyReference->registerShortcut(action); menu->addAction(action);