]> git.sesse.net Git - kdenlive/blobdiff - src/projectlist.cpp
Improve handling of missing clips:
[kdenlive] / src / projectlist.cpp
index 0a311341f15bff190a1d2f5ecb9080bf17055df1..20ab1d4b3c6e23fb888cbec8a7b87423bad806e1 100644 (file)
@@ -86,7 +86,7 @@ ProjectList::ProjectList(QWidget *parent) :
     layout->addWidget(m_toolbar);
     layout->addWidget(m_listView);
     setLayout(layout);
-    
+
 
 
     connect(m_listView, SIGNAL(itemSelectionChanged()), this, SLOT(slotClipSelected()));
@@ -619,15 +619,20 @@ void ProjectList::slotAddClip(const QList <QUrl> givenList, QString group)
     m_doc->slotAddClipList(list, group, groupId);
 }
 
-void ProjectList::slotRemoveInvalidClip(const QString &id)
+void ProjectList::slotRemoveInvalidClip(const QString &id, bool replace)
 {
     ProjectItem *item = getItemById(id);
     if (item) {
         const QString path = item->referencedClip()->fileURL().path();
-        if (!path.isEmpty()) KMessageBox::sorry(this, i18n("Clip <b>%1</b><br>is invalid, will be removed from project.", path));
+        if (!path.isEmpty()) {
+            if (replace) KMessageBox::sorry(this, i18n("Clip <b>%1</b><br>is invalid, will be removed from project.", path));
+            else {
+                if (KMessageBox::questionYesNo(this, i18n("Clip <b>%1</b><br>is missing or invalid. Remove it from project?", path), i18n("Invalid clip")) == KMessageBox::Yes) replace = true;
+            }
+        }
         QList <QString> ids;
         ids << id;
-        m_doc->deleteProjectClip(ids);
+        if (replace) m_doc->deleteProjectClip(ids);
     }
     if (!m_infoQueue.isEmpty()) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
     else m_listView->setEnabled(true);