[vlmc-devel] Timeline: Implement removing clips

Yikai Lu git at videolan.org
Mon Jul 11 17:08:13 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue Jul 12 00:03:20 2016 +0900| [a3f4e35109a6c078d4a074f7d1751570bf8a2ebf] | committer: Yikai Lu

Timeline: Implement removing clips

> https://code.videolan.org/videolan/vlmc/commit/a3f4e35109a6c078d4a074f7d1751570bf8a2ebf
---

 src/Gui/timeline/main.qml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/Gui/timeline/main.qml b/src/Gui/timeline/main.qml
index c21e6ad..77bf397 100644
--- a/src/Gui/timeline/main.qml
+++ b/src/Gui/timeline/main.qml
@@ -1,11 +1,13 @@
 import QtQuick 2.0
 import QtQuick.Controls 1.4
+import QtQuick.Dialogs 1.2
 
 Rectangle {
     id: page
     anchors.fill: parent
     color: "#777777"
     border.width: 0
+    focus: true
 
     property int initPosOfCursor: 100
     property int ppu: 10 // Pixels Per minimum Unit
@@ -267,6 +269,27 @@ Rectangle {
         property point initPos
     }
 
+    MessageDialog {
+        id: removeClipDialog
+        title: "VLMC"
+        text: qsTr( "Do you really want to remove selected clips?" )
+        icon: StandardIcon.Question
+        standardButtons: StandardButton.Yes | StandardButton.No
+        onYes: {
+            while ( selectedClips.length ) {
+                workflow.removeClip( selectedClips[0]["uuid"] );
+                removeClipFromTrackContainer( selectedClips[0]["item"].type, selectedClips[0]["uuid"] );
+            }
+        }
+    }
+
+    Keys.onPressed: {
+        if ( event.key === Qt.Key_Delete ) {
+            removeClipDialog.visible = true;
+            event.accepted = true;
+        }
+    }
+
     Connections {
         target: workflow
         onLengthChanged: {



More information about the Vlmc-devel mailing list