[vlmc-devel] commit: TracksScene: Disallow clip deletion using 'delete' key while a mouse action is occuring. ( =?UTF-8?Q?Hugo=20Beauz=C3=A9e=2DLuyssen?==?UTF-8?Q?=20?=)

git at videolan.org git at videolan.org
Tue Nov 30 18:03:21 CET 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Nov 30 17:55:06 2010 +0100| [5b0a80573fe0cf8296f28e38f3c7ed1a9e8f18fc] | committer: Hugo Beauzée-Luyssen 

TracksScene: Disallow clip deletion using 'delete' key while a mouse action is occuring.

Fix a bug reported by Rohit.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=5b0a80573fe0cf8296f28e38f3c7ed1a9e8f18fc
---

 src/Gui/timeline/TracksScene.cpp |    5 ++++-
 src/Gui/timeline/TracksView.cpp  |    6 ++++++
 src/Gui/timeline/TracksView.h    |    5 +++++
 3 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/Gui/timeline/TracksScene.cpp b/src/Gui/timeline/TracksScene.cpp
index 01309b3..ee03796 100644
--- a/src/Gui/timeline/TracksScene.cpp
+++ b/src/Gui/timeline/TracksScene.cpp
@@ -73,7 +73,10 @@ TracksScene::askRemoveSelectedItems()
 {
     TracksView* tv = Timeline::getInstance()->tracksView();
 
-    if ( !tv ) return;
+    if ( !tv )
+        return;
+    if ( tv->currentAction() != TracksView::None )
+        return ;
 
     if ( VLMC_GET_BOOL( "general/ConfirmDeletion" ) == true )
     {
diff --git a/src/Gui/timeline/TracksView.cpp b/src/Gui/timeline/TracksView.cpp
index ae8ab59..3cee278 100644
--- a/src/Gui/timeline/TracksView.cpp
+++ b/src/Gui/timeline/TracksView.cpp
@@ -1426,3 +1426,9 @@ TracksView::item( const QUuid &uuid )
     }
     return NULL;
 }
+
+TracksView::Action
+TracksView::currentAction() const
+{
+    return m_action;
+}
diff --git a/src/Gui/timeline/TracksView.h b/src/Gui/timeline/TracksView.h
index 06310c3..1db4406 100644
--- a/src/Gui/timeline/TracksView.h
+++ b/src/Gui/timeline/TracksView.h
@@ -238,6 +238,11 @@ public slots:
      */
     void                    removeItem( AbstractGraphicsItem *item );
 
+    /**
+     *  \returns        The current mouse action.
+     */
+    Action                  currentAction() const;
+
 protected:
     virtual void            resizeEvent( QResizeEvent *event );
     virtual void            drawBackground( QPainter *painter, const QRectF &rect );



More information about the Vlmc-devel mailing list