# HG changeset patch # User Chris Cannam # Date 1192011754 0 # Node ID d3477f673fb45fb8aadd3b9221b4da8995eef27b # Parent 1ded52c7f31c559650f2e9d8a1e05c78b8eb18b0 * Add Reset Counters... function diff -r 1ded52c7f31c -r d3477f673fb4 main/MainWindow.cpp --- a/main/MainWindow.cpp Tue Oct 09 16:21:59 2007 +0000 +++ b/main/MainWindow.cpp Wed Oct 10 10:22:34 2007 +0000 @@ -45,6 +45,7 @@ #include "widgets/SubdividingMenu.h" #include "widgets/NotifyingPushButton.h" #include "widgets/KeyReference.h" +#include "widgets/LabelCounterInputDialog.h" #include "audioio/AudioCallbackPlaySource.h" #include "audioio/AudioCallbackPlayTarget.h" #include "audioio/AudioTargetFactory.h" @@ -766,6 +767,7 @@ m_numberingActions[action] = (int)i->first; if (i->first == Labeller::ValueFromTwoLevelCounter) { + QMenu *cycleMenu = numberingMenu->addMenu(tr("Cycle size")); QActionGroup *cycleGroup = new QActionGroup(this); @@ -778,6 +780,10 @@ cycleGroup->addAction(action); cycleMenu->addAction(action); } + + action = new QAction(tr("Reset Counters..."), this); + connect(action, SIGNAL(triggered()), this, SLOT(resetInstantsCounters())); + numberingMenu->addAction(action); } if (i->first == Labeller::ValueNone || @@ -2476,7 +2482,6 @@ if (m_labeller) m_labeller->setCounterCycleSize(cycle); - QSettings settings; settings.beginGroup("MainWindow"); settings.setValue("labellercycle", cycle); @@ -2484,6 +2489,13 @@ } void +MainWindow::resetInstantsCounters() +{ + LabelCounterInputDialog dialog(m_labeller, this); + dialog.exec(); +} + +void MainWindow::renumberInstants() { Pane *pane = m_paneStack->getCurrentPane(); diff -r 1ded52c7f31c -r d3477f673fb4 main/MainWindow.h --- a/main/MainWindow.h Tue Oct 09 16:21:59 2007 +0000 +++ b/main/MainWindow.h Wed Oct 10 10:22:34 2007 +0000 @@ -214,6 +214,7 @@ void insertInstantsAtBoundaries(); void setInstantsNumbering(); void setInstantsCounterCycle(); + void resetInstantsCounters(); void renumberInstants(); void documentModified();