comparison src/MainWindow.cpp @ 287:f7571cac4d5b

Remove shortcut / toolbar button hacks, but retain a comment showing one of them so it can still be quickly tested
author Chris Cannam
date Fri, 30 May 2014 10:04:57 +0100
parents 5f06331c8b4f
children d1770a8ae921
comparison
equal deleted inserted replaced
286:6860f41b3f6b 287:f7571cac4d5b
610 connect(this, SIGNAL(canSelect(bool)), action, SLOT(setEnabled(bool))); 610 connect(this, SIGNAL(canSelect(bool)), action, SLOT(setEnabled(bool)));
611 m_keyReference->registerShortcut(action); 611 m_keyReference->registerShortcut(action);
612 menu->addAction(action); 612 menu->addAction(action);
613 m_rightButtonMenu->addAction(action); 613 m_rightButtonMenu->addAction(action);
614 614
615 // action = new QAction(tr("C&lear Selection"), this); 615 action = new QAction(tr("C&lear Selection"), this);
616 action = toolbar->addAction(il.load("blank-16"), tr("Esc"));
617 action->setShortcuts(QList<QKeySequence>() 616 action->setShortcuts(QList<QKeySequence>()
618 << QKeySequence(tr("Esc")) 617 << QKeySequence(tr("Esc"))
619 << QKeySequence(tr("Ctrl+Esc"))); 618 << QKeySequence(tr("Ctrl+Esc")));
620 action->setStatusTip(tr("Clear the selection and abandon any pending pitch choices in it")); 619 action->setStatusTip(tr("Clear the selection and abandon any pending pitch choices in it"));
621 connect(action, SIGNAL(triggered()), this, SLOT(abandonSelection())); 620 connect(action, SIGNAL(triggered()), this, SLOT(abandonSelection()));
655 connect(m_showCandidatesAction, SIGNAL(triggered()), this, SLOT(togglePitchCandidates())); 654 connect(m_showCandidatesAction, SIGNAL(triggered()), this, SLOT(togglePitchCandidates()));
656 connect(this, SIGNAL(canClearSelection(bool)), m_showCandidatesAction, SLOT(setEnabled(bool))); 655 connect(this, SIGNAL(canClearSelection(bool)), m_showCandidatesAction, SLOT(setEnabled(bool)));
657 menu->addAction(m_showCandidatesAction); 656 menu->addAction(m_showCandidatesAction);
658 m_rightButtonMenu->addAction(m_showCandidatesAction); 657 m_rightButtonMenu->addAction(m_showCandidatesAction);
659 658
660 659 action = new QAction(tr("Remove Pitches"), this);
661 // action = new QAction(tr("Remove Pitches"), this); 660 //!!! NB this keyboard shortcut does not work with Qt5 on OS/X
662 action = toolbar->addAction(il.load("blank-16"), tr("Del")); 661 //!!! (none of the single-key shortcuts do). But it does work if
662 //!!! the action is added to a toolbar button:
663 // action = toolbar->addAction(il.load("editdelete"), tr("Remove Pitches"));
663 action->setShortcut(tr("Backspace")); 664 action->setShortcut(tr("Backspace"));
664 action->setStatusTip(tr("Remove all pitch estimates within the selected region, making it unvoiced")); 665 action->setStatusTip(tr("Remove all pitch estimates within the selected region, making it unvoiced"));
665 m_keyReference->registerShortcut(action); 666 m_keyReference->registerShortcut(action);
666 connect(action, SIGNAL(triggered()), this, SLOT(clearPitches())); 667 connect(action, SIGNAL(triggered()), this, SLOT(clearPitches()));
667 connect(this, SIGNAL(canClearSelection(bool)), action, SLOT(setEnabled(bool))); 668 connect(this, SIGNAL(canClearSelection(bool)), action, SLOT(setEnabled(bool)));
669 m_rightButtonMenu->addAction(action); 670 m_rightButtonMenu->addAction(action);
670 671
671 menu->addSeparator(); 672 menu->addSeparator();
672 m_rightButtonMenu->addSeparator(); 673 m_rightButtonMenu->addSeparator();
673 674
674 // action = new QAction(tr("Split Note"), this); 675 action = new QAction(tr("Split Note"), this);
675 action = toolbar->addAction(il.load("blank-16"), tr("Split")); 676 action->setShortcut(tr("Ctrl+/"));
676 action->setShortcut(tr("/"));
677 action->setStatusTip(tr("Split the note at the current playback position into two")); 677 action->setStatusTip(tr("Split the note at the current playback position into two"));
678 m_keyReference->registerShortcut(action); 678 m_keyReference->registerShortcut(action);
679 connect(action, SIGNAL(triggered()), this, SLOT(splitNote())); 679 connect(action, SIGNAL(triggered()), this, SLOT(splitNote()));
680 connect(this, SIGNAL(canExportNotes(bool)), action, SLOT(setEnabled(bool))); 680 connect(this, SIGNAL(canExportNotes(bool)), action, SLOT(setEnabled(bool)));
681 menu->addAction(action); 681 menu->addAction(action);
682 m_rightButtonMenu->addAction(action); 682 m_rightButtonMenu->addAction(action);
683 683
684 // action = new QAction(tr("Merge Notes"), this); 684 action = new QAction(tr("Merge Notes"), this);
685 action = toolbar->addAction(il.load("blank-16"), tr("Merge")); 685 action->setShortcut(tr("Ctrl+\\"));
686 action->setShortcut(tr("\\"));
687 action->setStatusTip(tr("Merge all notes within the selected region into a single note")); 686 action->setStatusTip(tr("Merge all notes within the selected region into a single note"));
688 m_keyReference->registerShortcut(action); 687 m_keyReference->registerShortcut(action);
689 connect(action, SIGNAL(triggered()), this, SLOT(mergeNotes())); 688 connect(action, SIGNAL(triggered()), this, SLOT(mergeNotes()));
690 connect(this, SIGNAL(canSnapNotes(bool)), action, SLOT(setEnabled(bool))); 689 connect(this, SIGNAL(canSnapNotes(bool)), action, SLOT(setEnabled(bool)));
691 menu->addAction(action); 690 menu->addAction(action);