comparison 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
comparison
equal deleted inserted replaced
198:bb391844e2aa 199:0ba33d6c0a71
1786 // content of the pitch track in the selected region rather than 1786 // content of the pitch track in the selected region rather than
1787 // simply un-selecting. 1787 // simply un-selecting.
1788 1788
1789 cerr << "MainWindow::abandonSelection()" << endl; 1789 cerr << "MainWindow::abandonSelection()" << endl;
1790 1790
1791 CommandHistory::getInstance()->startCompoundOperation(tr("Clear Selection"), true); 1791 CommandHistory::getInstance()->startCompoundOperation(tr("Abandon Selection"), true);
1792 1792
1793 MultiSelection::SelectionList selections = m_viewManager->getSelections(); 1793 MultiSelection::SelectionList selections = m_viewManager->getSelections();
1794 if (!selections.empty()) { 1794 if (!selections.empty()) {
1795 Selection sel = *selections.begin(); 1795 Selection sel = *selections.begin();
1796 m_analyser->clearReAnalysis(sel); 1796 m_analyser->abandonReAnalysis(sel);
1797 } 1797 }
1798 1798
1799 MainWindowBase::clearSelection(); 1799 MainWindowBase::clearSelection();
1800 1800
1801 CommandHistory::getInstance()->endCompoundOperation(); 1801 CommandHistory::getInstance()->endCompoundOperation();
1907 } 1907 }
1908 1908
1909 void 1909 void
1910 MainWindow::togglePitchCandidates() 1910 MainWindow::togglePitchCandidates()
1911 { 1911 {
1912 CommandHistory::getInstance()->startCompoundOperation(tr("Toggle Pitch Candidates"), true);
1913
1912 m_analyser->showPitchCandidates(!m_analyser->arePitchCandidatesShown()); 1914 m_analyser->showPitchCandidates(!m_analyser->arePitchCandidatesShown());
1915
1916 CommandHistory::getInstance()->endCompoundOperation();
1917
1913 updateMenuStates(); 1918 updateMenuStates();
1914 } 1919 }
1915 1920
1916 void 1921 void
1917 MainWindow::switchPitchUp() 1922 MainWindow::switchPitchUp()