diff main/MainWindow.cpp @ 192:d3477f673fb4

* Add Reset Counters... function
author Chris Cannam
date Wed, 10 Oct 2007 10:22:34 +0000
parents 89a41f3d24d1
children 4e030ebb6b36
line wrap: on
line diff
--- 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();