Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 190:89a41f3d24d1
* textual changes
author | Chris Cannam |
---|---|
date | Tue, 09 Oct 2007 16:21:10 +0000 |
parents | 26397b84e6a2 |
children | d3477f673fb4 |
comparison
equal
deleted
inserted
replaced
189:26397b84e6a2 | 190:89a41f3d24d1 |
---|---|
746 connect(action, SIGNAL(triggered()), this, SLOT(insertInstantsAtBoundaries())); | 746 connect(action, SIGNAL(triggered()), this, SLOT(insertInstantsAtBoundaries())); |
747 connect(this, SIGNAL(canInsertInstantsAtBoundaries(bool)), action, SLOT(setEnabled(bool))); | 747 connect(this, SIGNAL(canInsertInstantsAtBoundaries(bool)), action, SLOT(setEnabled(bool))); |
748 m_keyReference->registerShortcut(action); | 748 m_keyReference->registerShortcut(action); |
749 menu->addAction(action); | 749 menu->addAction(action); |
750 | 750 |
751 QMenu *numberingMenu = menu->addMenu(tr("Set Instant Numbering")); | 751 QMenu *numberingMenu = menu->addMenu(tr("Number New Instants with")); |
752 QActionGroup *numberingGroup = new QActionGroup(this); | 752 QActionGroup *numberingGroup = new QActionGroup(this); |
753 | 753 |
754 Labeller::TypeNameMap types = m_labeller->getTypeNames(); | 754 Labeller::TypeNameMap types = m_labeller->getTypeNames(); |
755 for (Labeller::TypeNameMap::iterator i = types.begin(); i != types.end(); ++i) { | 755 for (Labeller::TypeNameMap::iterator i = types.begin(); i != types.end(); ++i) { |
756 if (i->first == Labeller::ValueFromLabel) continue; | 756 |
757 if (i->first == Labeller::ValueFromLabel || | |
758 i->first == Labeller::ValueFromExistingNeighbour) continue; | |
759 | |
757 action = new QAction(i->second, this); | 760 action = new QAction(i->second, this); |
758 connect(action, SIGNAL(triggered()), this, SLOT(setInstantsNumbering())); | 761 connect(action, SIGNAL(triggered()), this, SLOT(setInstantsNumbering())); |
759 action->setCheckable(true); | 762 action->setCheckable(true); |
760 action->setChecked(m_labeller->getType() == i->first); | 763 action->setChecked(m_labeller->getType() == i->first); |
761 numberingGroup->addAction(action); | 764 numberingGroup->addAction(action); |
762 numberingMenu->addAction(action); | 765 numberingMenu->addAction(action); |
763 m_numberingActions[action] = (int)i->first; | 766 m_numberingActions[action] = (int)i->first; |
764 } | 767 |
765 | 768 if (i->first == Labeller::ValueFromTwoLevelCounter) { |
766 QMenu *cycleMenu = menu->addMenu(tr("Set Instant Counter Cycle")); | 769 QMenu *cycleMenu = numberingMenu->addMenu(tr("Cycle size")); |
767 QActionGroup *cycleGroup = new QActionGroup(this); | 770 QActionGroup *cycleGroup = new QActionGroup(this); |
768 | 771 |
769 int cycles[] = { 2, 3, 4, 5, 6, 7, 8, 10, 12, 16 }; | 772 int cycles[] = { 2, 3, 4, 5, 6, 7, 8, 10, 12, 16 }; |
770 for (int i = 0; i < sizeof(cycles)/sizeof(cycles[0]); ++i) { | 773 for (int i = 0; i < sizeof(cycles)/sizeof(cycles[0]); ++i) { |
771 action = new QAction(QString("%1").arg(cycles[i]), this); | 774 action = new QAction(QString("%1").arg(cycles[i]), this); |
772 connect(action, SIGNAL(triggered()), this, SLOT(setInstantsCounterCycle())); | 775 connect(action, SIGNAL(triggered()), this, SLOT(setInstantsCounterCycle())); |
773 action->setCheckable(true); | 776 action->setCheckable(true); |
774 action->setChecked(cycles[i] == m_labeller->getCounterCycleSize()); | 777 action->setChecked(cycles[i] == m_labeller->getCounterCycleSize()); |
775 cycleGroup->addAction(action); | 778 cycleGroup->addAction(action); |
776 cycleMenu->addAction(action); | 779 cycleMenu->addAction(action); |
780 } | |
781 } | |
782 | |
783 if (i->first == Labeller::ValueNone || | |
784 i->first == Labeller::ValueFromTwoLevelCounter || | |
785 i->first == Labeller::ValueFromRealTime) { | |
786 numberingMenu->addSeparator(); | |
787 } | |
777 } | 788 } |
778 | 789 |
779 action = new QAction(tr("Re-Number Selected Instants"), this); | 790 action = new QAction(tr("Re-Number Selected Instants"), this); |
780 action->setStatusTip(tr("Re-number the selected instants using the current labelling scheme")); | 791 action->setStatusTip(tr("Re-number the selected instants using the current labelling scheme")); |
781 connect(action, SIGNAL(triggered()), this, SLOT(renumberInstants())); | 792 connect(action, SIGNAL(triggered()), this, SLOT(renumberInstants())); |