X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fprojectlist.cpp;h=20ab1d4b3c6e23fb888cbec8a7b87423bad806e1;hb=05d5da65489ab125958e4f62ded8987bcf4989aa;hp=d1be91f7e1a870cc21d98234c1fddb4f9c59a41b;hpb=9472299b931b35891fb78bc18ec06d921bf59a33;p=kdenlive diff --git a/src/projectlist.cpp b/src/projectlist.cpp index d1be91f7..20ab1d4b 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -77,6 +77,7 @@ ProjectList::ProjectList(QWidget *parent) : KTreeWidgetSearchLine *searchView = new KTreeWidgetSearchLine(this); m_toolbar = new QToolBar("projectToolBar", this); m_toolbar->addWidget(searchView); + searchView->setTreeWidget(m_listView); m_addButton = new QToolButton(m_toolbar); m_addButton->setPopupMode(QToolButton::MenuButtonPopup); @@ -85,7 +86,7 @@ ProjectList::ProjectList(QWidget *parent) : layout->addWidget(m_toolbar); layout->addWidget(m_listView); setLayout(layout); - //m_toolbar->setEnabled(false); + connect(m_listView, SIGNAL(itemSelectionChanged()), this, SLOT(slotClipSelected())); @@ -355,10 +356,10 @@ void ProjectList::slotRemoveClip() if (item->isGroup()) folderids[item->groupName()] = item->clipId(); else ids << item->clipId(); if (item->numReferences() > 0) { - if (KMessageBox::questionYesNo(this, i18np("Delete clip %2 ?
This will also remove the clip in timeline", "Delete clip %2 ?
This will also remove its %1 clips in timeline", item->numReferences(), item->names().at(1)), i18n("Delete Clip")) != KMessageBox::Yes) return; + if (KMessageBox::questionYesNo(this, i18np("Delete clip %2?
This will also remove the clip in timeline", "Delete clip %2?
This will also remove its %1 clips in timeline", item->numReferences(), item->names().at(1)), i18n("Delete Clip")) != KMessageBox::Yes) return; } else if (item->isGroup() && item->childCount() > 0) { int children = item->childCount(); - if (KMessageBox::questionYesNo(this, i18n("Delete folder %2 ?
This will also remove the %1 clips in that folder", children, item->names().at(1)), i18n("Delete Folder")) != KMessageBox::Yes) return; + if (KMessageBox::questionYesNo(this, i18n("Delete folder %2?
This will also remove the %1 clips in that folder", children, item->names().at(1)), i18n("Delete Folder")) != KMessageBox::Yes) return; for (int i = 0; i < children; ++i) { ProjectItem *child = static_cast (item->child(i)); ids << child->clipId(); @@ -618,15 +619,20 @@ void ProjectList::slotAddClip(const QList 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 %1
is invalid, will be removed from project.", path)); + if (!path.isEmpty()) { + if (replace) KMessageBox::sorry(this, i18n("Clip %1
is invalid, will be removed from project.", path)); + else { + if (KMessageBox::questionYesNo(this, i18n("Clip %1
is missing or invalid. Remove it from project?", path), i18n("Invalid clip")) == KMessageBox::Yes) replace = true; + } + } QList 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); @@ -814,7 +820,11 @@ void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Produce item->setProperties(properties, metadata); Q_ASSERT_X(item->referencedClip(), "void ProjectList::slotReplyGetFileProperties", QString("Item with groupName %1 does not have a clip associated").arg(item->groupName()).toLatin1()); if (replace) item->referencedClip()->setProducer(producer); - emit receivedClipDuration(clipId, item->clipMaxDuration()); + else { + // Check if duration changed. + emit receivedClipDuration(clipId); + delete producer; + } m_listView->blockSignals(false); } else kDebug() << "//////// COULD NOT FIND CLIP TO UPDATE PRPS..."; if (!m_infoQueue.isEmpty()) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));