]> git.sesse.net Git - kdenlive/commitdiff
Do not allow using the duration dialog for an item in a group (sometimes caused a...
authorTill Theato <root@ttill.de>
Sun, 20 Jun 2010 22:09:53 +0000 (22:09 +0000)
committerTill Theato <root@ttill.de>
Sun, 20 Jun 2010 22:09:53 +0000 (22:09 +0000)
svn path=/trunk/kdenlive/; revision=4537

src/customtrackview.cpp

index cba64084bab2f073d31c064830a614e654a1ee3b..555a7da63cc82b2937ff741868c6b4c679f01c8d 100644 (file)
@@ -1185,14 +1185,23 @@ void CustomTrackView::editItemDuration()
         }
     }
 
+    if (!item) {
+        emit displayMessage(i18n("Cannot find clip to edit"), ErrorMessage);
+        return;
+    }
+
+    if (item->type() == GROUPWIDGET || (item->parentItem() && item->parentItem()->type() == GROUPWIDGET)) {
+        emit displayMessage(i18n("Cannot edit an item in a group"), ErrorMessage);
+        return;
+    }
+
     if (!item->isItemLocked()) {
         GenTime minimum;
         GenTime maximum;
-        if (item->type() == TRANSITIONWIDGET) {
+        if (item->type() == TRANSITIONWIDGET)
             getTransitionAvailableSpace(item, minimum, maximum);
-        } else {
+        else
             getClipAvailableSpace(item, minimum, maximum);
-        }
         //kDebug()<<"// GOT MOVE POS: "<<minimum.frames(25)<<" - "<<maximum.frames(25);
         ClipDurationDialog d(item, m_document->timecode(), minimum, maximum, this);
         if (d.exec() == QDialog::Accepted) {
@@ -1236,7 +1245,9 @@ void CustomTrackView::editItemDuration()
                 m_commandStack->push(moveCommand);
             }
         }
-    } else emit displayMessage(i18n("Item is locked"), ErrorMessage);
+    } else {
+        emit displayMessage(i18n("Item is locked"), ErrorMessage);
+    }
 }
 
 void CustomTrackView::editKeyFrame(const GenTime /*pos*/, const int /*track*/, const int /*index*/, const QString /*keyframes*/)