diff src/MainWindow.cpp @ 199:0ba33d6c0a71

Properly rationalise the show/hide/add/remove layer logic for pitch candidates: ctrl+return maps through to a show layer command (but the layers remain in the view) while the add/remove layer flow is used for layer creation after selection and for abandoning an edit or discarding a selection.
author Chris Cannam
date Wed, 05 Mar 2014 13:20:26 +0000
parents bb391844e2aa
children 40e6ba379f2c
line wrap: on
line diff
--- a/src/MainWindow.cpp	Wed Mar 05 11:39:28 2014 +0000
+++ b/src/MainWindow.cpp	Wed Mar 05 13:20:26 2014 +0000
@@ -1788,12 +1788,12 @@
 
     cerr << "MainWindow::abandonSelection()" << endl;
 
-    CommandHistory::getInstance()->startCompoundOperation(tr("Clear Selection"), true);
+    CommandHistory::getInstance()->startCompoundOperation(tr("Abandon Selection"), true);
 
     MultiSelection::SelectionList selections = m_viewManager->getSelections();
     if (!selections.empty()) {
         Selection sel = *selections.begin();
-        m_analyser->clearReAnalysis(sel);
+        m_analyser->abandonReAnalysis(sel);
     }
 
     MainWindowBase::clearSelection();
@@ -1909,7 +1909,12 @@
 void
 MainWindow::togglePitchCandidates()
 {
+    CommandHistory::getInstance()->startCompoundOperation(tr("Toggle Pitch Candidates"), true);
+
     m_analyser->showPitchCandidates(!m_analyser->arePitchCandidatesShown());
+
+    CommandHistory::getInstance()->endCompoundOperation();
+
     updateMenuStates();
 }