changeset 731:f831ca41d4a5 tonioni

Add selectionChangedByUser for selection changes prompted by interactivity rather than by undo/redo
author Chris Cannam
date Wed, 05 Mar 2014 09:35:32 +0000
parents 711ae36a53a2
children 558c71a802d4
files view/Pane.cpp view/ViewManager.cpp view/ViewManager.h
diffstat 3 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/view/Pane.cpp	Tue Mar 04 16:45:39 2014 +0000
+++ b/view/Pane.cpp	Wed Mar 05 09:35:32 2014 +0000
@@ -359,10 +359,10 @@
                      bool &closeToRight) const
 {
     if (m_identifyFeatures &&
-    m_manager &&
-    m_manager->getToolModeFor(this) == ViewManager::EditMode &&
-    !m_manager->getSelections().empty() &&
-    !selectionIsBeingEdited()) {
+        m_manager &&
+        m_manager->getToolModeFor(this) == ViewManager::EditMode &&
+        !m_manager->getSelections().empty() &&
+        !selectionIsBeingEdited()) {
 
     Selection s(getSelectionAt(m_identifyPoint.x(),
                    closeToLeft, closeToRight));
--- a/view/ViewManager.cpp	Tue Mar 04 16:45:39 2014 +0000
+++ b/view/ViewManager.cpp	Wed Mar 05 09:35:32 2014 +0000
@@ -279,6 +279,7 @@
     if (m_selections.getSelections() == ms.getSelections()) return;
     SetSelectionCommand *command = new SetSelectionCommand(this, ms);
     CommandHistory::getInstance()->addCommand(command);
+    emit selectionChangedByUser();
 }
 
 size_t
--- a/view/ViewManager.h	Tue Mar 04 16:45:39 2014 +0000
+++ b/view/ViewManager.h	Wed Mar 05 09:35:32 2014 +0000
@@ -214,9 +214,14 @@
     /** Emitted when the output levels change. Values in range 0.0 -> 1.0. */
     void outputLevelsChanged(float left, float right);
 
-    /** Emitted when the selection has changed. */
+    /** Emitted whenever the selection has changed. */
     void selectionChanged();
 
+    /** Emitted when the selection has been changed through an
+     * explicit selection-editing action. *Not* emitted when the
+     * selection has been changed through undo or redo. */
+    void selectionChangedByUser();
+
     /** Emitted when the in-progress (rubberbanding) selection has changed. */
     void inProgressSelectionChanged();