diff main/MainWindow.cpp @ 340:3211f8cef51a sv-v1.7.1

* Layer data editor window: fix sorting for columns in region model, add Find feature * RDF import: assign names to layers based on event types, if no suitable labels are found in the RDF * Add label to status bar showing the last text that was passed in current layer (so e.g. counting 1, 2, 3, 4 if that's what beats are labelled) * Better layout of text labels for region layers in segmentation mode when they are close together * Give text layer the same method for finding "nearest point" as region and note layers, should improve its editability
author Chris Cannam
date Thu, 22 Oct 2009 15:54:21 +0000
parents 33ae130b951f
children 1fc7ee4ff506
line wrap: on
line diff
--- a/main/MainWindow.cpp	Fri Oct 16 08:31:02 2009 +0000
+++ b/main/MainWindow.cpp	Thu Oct 22 15:54:21 2009 +0000
@@ -37,6 +37,7 @@
 #include "layer/SliceLayer.h"
 #include "layer/SliceableLayer.h"
 #include "layer/ImageLayer.h"
+#include "layer/RegionLayer.h"
 #include "widgets/Fader.h"
 #include "view/Overview.h"
 #include "widgets/PropertyBox.h"
@@ -277,6 +278,8 @@
     setupHelpMenu();
 
     statusBar();
+    m_currentLabel = new QLabel;
+    statusBar()->addPermanentWidget(m_currentLabel);
 
     connect(m_viewManager, SIGNAL(activity(QString)),
             m_activityLog, SLOT(activityHappened(QString)));
@@ -3491,6 +3494,33 @@
     }
 
     statusBar()->showMessage(m_myStatusMessage);
+
+    updatePositionStatusDisplays();
+}
+
+void
+MainWindow::updatePositionStatusDisplays() const
+{
+    if (!statusBar()->isVisible()) return;
+
+    Pane *pane = 0;
+    size_t frame = m_viewManager->getPlaybackFrame();
+
+    if (m_paneStack) pane = m_paneStack->getCurrentPane();
+    if (!pane) return;
+
+    int layers = pane->getLayerCount();
+    if (layers == 0) m_currentLabel->setText("");
+
+    for (int i = layers-1; i >= 0; --i) {
+        Layer *layer = pane->getLayer(i);
+        if (!layer) continue;
+        if (!layer->isLayerEditable()) continue;
+        QString label = layer->getLabelPreceding
+            (pane->alignFromReference(frame));
+        m_currentLabel->setText(label);
+        break;
+    }
 }
 
 void