1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #include "projectlist.h"
21 #include "projectitem.h"
22 #include "addfoldercommand.h"
23 #include "kdenlivesettings.h"
24 #include "slideshowclip.h"
25 #include "ui_colorclip_ui.h"
26 #include "titlewidget.h"
27 #include "definitions.h"
28 #include "clipmanager.h"
29 #include "docclipbase.h"
30 #include "kdenlivedoc.h"
33 #include "projectlistview.h"
34 #include "editclipcommand.h"
35 #include "editclipcutcommand.h"
36 #include "editfoldercommand.h"
37 #include "addclipcutcommand.h"
39 #include "ui_templateclip_ui.h"
44 #include <KFileDialog>
45 #include <KInputDialog>
46 #include <KMessageBox>
47 #include <KIO/NetAccess>
50 #include <nepomuk/global.h>
51 #include <nepomuk/resourcemanager.h>
52 //#include <nepomuk/tag.h>
55 #include <QMouseEvent>
56 #include <QStylePainter>
61 #include <QHeaderView>
63 ProjectList::ProjectList(QWidget *parent) :
72 m_transcodeAction(NULL),
79 m_listView = new ProjectListView(this);;
80 QVBoxLayout *layout = new QVBoxLayout;
81 layout->setContentsMargins(0, 0, 0, 0);
84 KTreeWidgetSearchLine *searchView = new KTreeWidgetSearchLine(this);
85 m_toolbar = new QToolBar("projectToolBar", this);
86 m_toolbar->addWidget(searchView);
87 int s = style()->pixelMetric(QStyle::PM_SmallIconSize);
88 m_toolbar->setIconSize(QSize(s, s));
89 searchView->setTreeWidget(m_listView);
91 m_addButton = new QToolButton(m_toolbar);
92 m_addButton->setPopupMode(QToolButton::MenuButtonPopup);
93 m_toolbar->addWidget(m_addButton);
95 layout->addWidget(m_toolbar);
96 layout->addWidget(m_listView);
99 m_queueTimer.setInterval(100);
100 connect(&m_queueTimer, SIGNAL(timeout()), this, SLOT(slotProcessNextClipInQueue()));
101 m_queueTimer.setSingleShot(true);
105 connect(m_listView, SIGNAL(itemSelectionChanged()), this, SLOT(slotClipSelected()));
106 connect(m_listView, SIGNAL(focusMonitor()), this, SLOT(slotClipSelected()));
107 connect(m_listView, SIGNAL(pauseMonitor()), this, SLOT(slotPauseMonitor()));
108 connect(m_listView, SIGNAL(requestMenu(const QPoint &, QTreeWidgetItem *)), this, SLOT(slotContextMenu(const QPoint &, QTreeWidgetItem *)));
109 connect(m_listView, SIGNAL(addClip()), this, SLOT(slotAddClip()));
110 connect(m_listView, SIGNAL(addClip(const QList <QUrl>, const QString &, const QString &)), this, SLOT(slotAddClip(const QList <QUrl>, const QString &, const QString &)));
111 connect(m_listView, SIGNAL(addClipCut(const QString &, int, int)), this, SLOT(slotAddClipCut(const QString &, int, int)));
112 connect(m_listView, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotItemEdited(QTreeWidgetItem *, int)));
113 connect(m_listView, SIGNAL(showProperties(DocClipBase *)), this, SIGNAL(showClipProperties(DocClipBase *)));
115 m_listViewDelegate = new ItemDelegate(m_listView);
116 m_listView->setItemDelegate(m_listViewDelegate);
118 if (KdenliveSettings::activate_nepomuk()) {
119 Nepomuk::ResourceManager::instance()->init();
120 if (!Nepomuk::ResourceManager::instance()->initialized()) {
121 kDebug() << "Cannot communicate with Nepomuk, DISABLING it";
122 KdenliveSettings::setActivate_nepomuk(false);
128 ProjectList::~ProjectList()
132 m_listView->blockSignals(true);
134 delete m_listViewDelegate;
137 void ProjectList::focusTree() const
139 m_listView->setFocus();
142 void ProjectList::setupMenu(QMenu *addMenu, QAction *defaultAction)
144 QList <QAction *> actions = addMenu->actions();
145 for (int i = 0; i < actions.count(); i++) {
146 if (actions.at(i)->data().toString() == "clip_properties") {
147 m_editAction = actions.at(i);
148 m_toolbar->addAction(m_editAction);
151 } else if (actions.at(i)->data().toString() == "delete_clip") {
152 m_deleteAction = actions.at(i);
153 m_toolbar->addAction(m_deleteAction);
156 } else if (actions.at(i)->data().toString() == "edit_clip") {
157 m_openAction = actions.at(i);
160 } else if (actions.at(i)->data().toString() == "reload_clip") {
161 m_reloadAction = actions.at(i);
167 QMenu *m = new QMenu();
168 m->addActions(actions);
169 m_addButton->setMenu(m);
170 m_addButton->setDefaultAction(defaultAction);
171 m_menu = new QMenu();
172 m_menu->addActions(addMenu->actions());
175 void ProjectList::setupGeneratorMenu(QMenu *addMenu, QMenu *transcodeMenu)
177 if (!addMenu) return;
178 QMenu *menu = m_addButton->menu();
179 menu->addMenu(addMenu);
180 m_addButton->setMenu(menu);
182 m_menu->addMenu(addMenu);
183 if (addMenu->isEmpty()) addMenu->setEnabled(false);
184 m_menu->addMenu(transcodeMenu);
185 if (transcodeMenu->isEmpty()) transcodeMenu->setEnabled(false);
186 m_transcodeAction = transcodeMenu;
187 m_menu->addAction(m_reloadAction);
188 m_menu->addAction(m_editAction);
189 m_menu->addAction(m_openAction);
190 m_menu->addAction(m_deleteAction);
191 m_menu->insertSeparator(m_deleteAction);
195 QByteArray ProjectList::headerInfo() const
197 return m_listView->header()->saveState();
200 void ProjectList::setHeaderInfo(const QByteArray &state)
202 m_listView->header()->restoreState(state);
205 void ProjectList::slotEditClip()
208 if (!m_listView->currentItem() || m_listView->currentItem()->type() == PROJECTFOLDERTYPE) return;
209 if (m_listView->currentItem()->type() == PROJECTSUBCLIPTYPE) {
210 item = static_cast <ProjectItem*>(m_listView->currentItem()->parent());
211 } else item = static_cast <ProjectItem*>(m_listView->currentItem());
212 if (!(item->flags() & Qt::ItemIsDragEnabled)) return;
214 emit clipSelected(item->referencedClip());
215 emit showClipProperties(item->referencedClip());
219 void ProjectList::slotOpenClip()
222 if (!m_listView->currentItem() || m_listView->currentItem()->type() == PROJECTFOLDERTYPE) return;
223 if (m_listView->currentItem()->type() == QTreeWidgetItem::UserType + 1) {
224 item = static_cast <ProjectItem*>(m_listView->currentItem()->parent());
225 } else item = static_cast <ProjectItem*>(m_listView->currentItem());
227 if (item->clipType() == IMAGE) {
228 if (KdenliveSettings::defaultimageapp().isEmpty()) KMessageBox::sorry(this, i18n("Please set a default application to open images in the Settings dialog"));
229 else QProcess::startDetached(KdenliveSettings::defaultimageapp(), QStringList() << item->clipUrl().path());
231 if (item->clipType() == AUDIO) {
232 if (KdenliveSettings::defaultaudioapp().isEmpty()) KMessageBox::sorry(this, i18n("Please set a default application to open audio files in the Settings dialog"));
233 else QProcess::startDetached(KdenliveSettings::defaultaudioapp(), QStringList() << item->clipUrl().path());
238 void ProjectList::cleanup()
240 m_listView->clearSelection();
241 QTreeWidgetItemIterator it(m_listView);
244 if ((*it)->type() != PROJECTCLIPTYPE) {
248 item = static_cast <ProjectItem *>(*it);
249 if (item->numReferences() == 0) item->setSelected(true);
255 void ProjectList::trashUnusedClips()
257 QTreeWidgetItemIterator it(m_listView);
262 if ((*it)->type() != PROJECTCLIPTYPE) {
266 item = static_cast <ProjectItem *>(*it);
267 if (item->numReferences() == 0) {
268 ids << item->clipId();
269 KUrl url = item->clipUrl();
270 if (!url.isEmpty() && !urls.contains(url.path())) urls << url.path();
275 // Check that we don't use the URL in another clip
276 QTreeWidgetItemIterator it2(m_listView);
278 if ((*it2)->type() != PROJECTCLIPTYPE) {
282 item = static_cast <ProjectItem *>(*it2);
283 if (item->numReferences() > 0) {
284 KUrl url = item->clipUrl();
285 if (!url.isEmpty() && urls.contains(url.path())) urls.removeAll(url.path());
290 m_doc->deleteProjectClip(ids);
291 for (int i = 0; i < urls.count(); i++) {
292 KIO::NetAccess::del(KUrl(urls.at(i)), this);
296 void ProjectList::slotReloadClip(const QString &id)
298 QList<QTreeWidgetItem *> selected;
299 if (id.isEmpty()) selected = m_listView->selectedItems();
300 else selected.append(getItemById(id));
302 for (int i = 0; i < selected.count(); i++) {
303 if (selected.at(i)->type() != PROJECTCLIPTYPE) continue;
304 item = static_cast <ProjectItem *>(selected.at(i));
306 if (item->clipType() == IMAGE) {
307 item->referencedClip()->producer()->set("force_reload", 1);
308 } else if (item->clipType() == TEXT) {
309 if (!item->referencedClip()->getProperty("xmltemplate").isEmpty()) regenerateTemplate(item);
311 //requestClipInfo(item->toXml(), item->clipId(), true);
312 // Clear the file_hash value, which will cause a complete reload of the clip
313 emit getFileProperties(item->toXml(), item->clipId(), m_listView->iconSize().height(), true);
318 void ProjectList::setRenderer(Render *projectRender)
320 m_render = projectRender;
321 m_listView->setIconSize(QSize((ProjectItem::itemDefaultHeight() - 2) * m_render->dar(), ProjectItem::itemDefaultHeight() - 2));
324 void ProjectList::slotClipSelected()
326 if (m_listView->currentItem()) {
327 if (m_listView->currentItem()->type() == PROJECTFOLDERTYPE) {
328 emit clipSelected(NULL);
329 m_editAction->setEnabled(false);
330 m_deleteAction->setEnabled(true);
331 m_openAction->setEnabled(false);
332 m_reloadAction->setEnabled(false);
333 m_transcodeAction->setEnabled(false);
336 if (m_listView->currentItem()->type() == PROJECTSUBCLIPTYPE) {
337 // this is a sub item, use base clip
338 m_deleteAction->setEnabled(true);
339 clip = static_cast <ProjectItem*>(m_listView->currentItem()->parent());
340 if (clip == NULL) kDebug() << "-----------ERROR";
341 SubProjectItem *sub = static_cast <SubProjectItem*>(m_listView->currentItem());
342 emit clipSelected(clip->referencedClip(), sub->zone());
345 clip = static_cast <ProjectItem*>(m_listView->currentItem());
346 emit clipSelected(clip->referencedClip());
347 m_editAction->setEnabled(true);
348 m_deleteAction->setEnabled(true);
349 m_reloadAction->setEnabled(true);
350 m_transcodeAction->setEnabled(true);
351 if (clip->clipType() == IMAGE && !KdenliveSettings::defaultimageapp().isEmpty()) {
352 m_openAction->setIcon(KIcon(KdenliveSettings::defaultimageapp()));
353 m_openAction->setEnabled(true);
354 } else if (clip->clipType() == AUDIO && !KdenliveSettings::defaultaudioapp().isEmpty()) {
355 m_openAction->setIcon(KIcon(KdenliveSettings::defaultaudioapp()));
356 m_openAction->setEnabled(true);
357 } else m_openAction->setEnabled(false);
360 emit clipSelected(NULL);
361 m_editAction->setEnabled(false);
362 m_deleteAction->setEnabled(false);
363 m_openAction->setEnabled(false);
364 m_reloadAction->setEnabled(false);
365 m_transcodeAction->setEnabled(false);
369 void ProjectList::slotPauseMonitor()
371 if (m_render) m_render->pause();
374 void ProjectList::slotUpdateClipProperties(const QString &id, QMap <QString, QString> properties)
376 ProjectItem *item = getItemById(id);
378 slotUpdateClipProperties(item, properties);
379 if (properties.contains("out")) {
381 } else if (properties.contains("colour") || properties.contains("resource") || properties.contains("xmldata") || properties.contains("force_aspect_ratio") || properties.contains("templatetext")) {
382 slotRefreshClipThumbnail(item);
388 void ProjectList::slotUpdateClipProperties(ProjectItem *clip, QMap <QString, QString> properties)
391 clip->setProperties(properties);
392 if (properties.contains("name")) {
393 m_listView->blockSignals(true);
394 clip->setText(0, properties.value("name"));
395 m_listView->blockSignals(false);
396 emit clipNameChanged(clip->clipId(), properties.value("name"));
398 if (properties.contains("description")) {
399 CLIPTYPE type = clip->clipType();
400 m_listView->blockSignals(true);
401 clip->setText(1, properties.value("description"));
402 m_listView->blockSignals(false);
404 if (KdenliveSettings::activate_nepomuk() && (type == AUDIO || type == VIDEO || type == AV || type == IMAGE || type == PLAYLIST)) {
405 // Use Nepomuk system to store clip description
406 Nepomuk::Resource f(clip->clipUrl().path());
407 f.setDescription(properties.value("description"));
410 emit projectModified();
414 void ProjectList::slotItemEdited(QTreeWidgetItem *item, int column)
416 if (item->type() == PROJECTSUBCLIPTYPE) {
417 // this is a sub-item
419 // user edited description
420 SubProjectItem *sub = static_cast <SubProjectItem*>(item);
421 ProjectItem *item = static_cast <ProjectItem *>(sub->parent());
422 EditClipCutCommand *command = new EditClipCutCommand(this, item->clipId(), sub->zone(), sub->zone(), sub->description(), sub->text(1), true);
423 m_commandStack->push(command);
424 //slotUpdateCutClipProperties(sub->clipId(), sub->zone(), sub->text(1), sub->text(1));
428 if (item->type() == PROJECTFOLDERTYPE) {
429 if (column != 0) return;
430 FolderProjectItem *folder = static_cast <FolderProjectItem*>(item);
431 editFolder(item->text(0), folder->groupName(), folder->clipId());
432 folder->setGroupName(item->text(0));
433 m_doc->clipManager()->addFolder(folder->clipId(), item->text(0));
434 const int children = item->childCount();
435 for (int i = 0; i < children; i++) {
436 ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
437 child->setProperty("groupname", item->text(0));
442 ProjectItem *clip = static_cast <ProjectItem*>(item);
444 if (clip->referencedClip()) {
445 QMap <QString, QString> oldprops;
446 QMap <QString, QString> newprops;
447 oldprops["description"] = clip->referencedClip()->getProperty("description");
448 newprops["description"] = item->text(1);
450 if (clip->clipType() == TEXT) {
451 // This is a text template clip, update the image
452 /*oldprops.insert("xmldata", clip->referencedClip()->getProperty("xmldata"));
453 newprops.insert("xmldata", generateTemplateXml(clip->referencedClip()->getProperty("xmltemplate"), item->text(2)).toString());*/
454 oldprops.insert("templatetext", clip->referencedClip()->getProperty("templatetext"));
455 newprops.insert("templatetext", item->text(1));
457 slotUpdateClipProperties(clip->clipId(), newprops);
458 EditClipCommand *command = new EditClipCommand(this, clip->clipId(), oldprops, newprops, false);
459 m_commandStack->push(command);
461 } else if (column == 0) {
462 if (clip->referencedClip()) {
463 QMap <QString, QString> oldprops;
464 QMap <QString, QString> newprops;
465 oldprops["name"] = clip->referencedClip()->getProperty("name");
466 newprops["name"] = item->text(0);
467 slotUpdateClipProperties(clip, newprops);
468 emit projectModified();
469 EditClipCommand *command = new EditClipCommand(this, clip->clipId(), oldprops, newprops, false);
470 m_commandStack->push(command);
475 void ProjectList::slotContextMenu(const QPoint &pos, QTreeWidgetItem *item)
481 m_editAction->setEnabled(enable);
482 m_deleteAction->setEnabled(enable);
483 m_reloadAction->setEnabled(enable);
484 m_transcodeAction->setEnabled(enable);
486 ProjectItem *clip = NULL;
487 if (m_listView->currentItem()->type() == PROJECTSUBCLIPTYPE) {
488 clip = static_cast <ProjectItem*>(item->parent());
489 } else if (m_listView->currentItem()->type() == PROJECTCLIPTYPE) clip = static_cast <ProjectItem*>(item);
490 if (clip && clip->clipType() == IMAGE && !KdenliveSettings::defaultimageapp().isEmpty()) {
491 m_openAction->setIcon(KIcon(KdenliveSettings::defaultimageapp()));
492 m_openAction->setEnabled(true);
493 } else if (clip && clip->clipType() == AUDIO && !KdenliveSettings::defaultaudioapp().isEmpty()) {
494 m_openAction->setIcon(KIcon(KdenliveSettings::defaultaudioapp()));
495 m_openAction->setEnabled(true);
496 } else m_openAction->setEnabled(false);
497 } else m_openAction->setEnabled(false);
501 void ProjectList::slotRemoveClip()
503 if (!m_listView->currentItem()) return;
505 QMap <QString, QString> folderids;
506 QList<QTreeWidgetItem *> selected = m_listView->selectedItems();
508 QUndoCommand *delCommand = new QUndoCommand();
509 delCommand->setText(i18n("Delete Clip Zone"));
511 for (int i = 0; i < selected.count(); i++) {
512 if (selected.at(i)->type() == PROJECTSUBCLIPTYPE) {
514 SubProjectItem *sub = static_cast <SubProjectItem *>(selected.at(i));
515 ProjectItem *item = static_cast <ProjectItem *>(sub->parent());
516 new AddClipCutCommand(this, item->clipId(), sub->zone().x(), sub->zone().y(), sub->description(), false, true, delCommand);
517 } else if (selected.at(i)->type() == PROJECTFOLDERTYPE) {
519 FolderProjectItem *folder = static_cast <FolderProjectItem *>(selected.at(i));
520 folderids[folder->groupName()] = folder->clipId();
521 int children = folder->childCount();
523 if (children > 0 && KMessageBox::questionYesNo(this, i18np("Delete folder <b>%2</b>?<br>This will also remove the clip in that folder", "Delete folder <b>%2</b>?<br>This will also remove the %1 clips in that folder", children, folder->text(1)), i18n("Delete Folder")) != KMessageBox::Yes) return;
524 for (int i = 0; i < children; ++i) {
525 ProjectItem *child = static_cast <ProjectItem *>(folder->child(i));
526 ids << child->clipId();
529 ProjectItem *item = static_cast <ProjectItem *>(selected.at(i));
530 ids << item->clipId();
531 if (item->numReferences() > 0) {
532 if (KMessageBox::questionYesNo(this, i18np("Delete clip <b>%2</b>?<br>This will also remove the clip in timeline", "Delete clip <b>%2</b>?<br>This will also remove its %1 clips in timeline", item->numReferences(), item->names().at(1)), i18n("Delete Clip")) != KMessageBox::Yes) return;
537 if (delCommand->childCount() == 0) delete delCommand;
538 else m_commandStack->push(delCommand);
539 if (!ids.isEmpty()) m_doc->deleteProjectClip(ids);
540 if (!folderids.isEmpty()) deleteProjectFolder(folderids);
541 if (m_listView->topLevelItemCount() == 0) {
542 m_editAction->setEnabled(false);
543 m_deleteAction->setEnabled(false);
544 m_openAction->setEnabled(false);
545 m_reloadAction->setEnabled(false);
546 m_transcodeAction->setEnabled(false);
550 void ProjectList::selectItemById(const QString &clipId)
552 ProjectItem *item = getItemById(clipId);
553 if (item) m_listView->setCurrentItem(item);
557 void ProjectList::slotDeleteClip(const QString &clipId)
559 ProjectItem *item = getItemById(clipId);
561 kDebug() << "/// Cannot find clip to delete";
564 m_listView->blockSignals(true);
566 m_doc->clipManager()->deleteClip(clipId);
567 m_listView->blockSignals(false);
572 void ProjectList::editFolder(const QString folderName, const QString oldfolderName, const QString &clipId)
574 EditFolderCommand *command = new EditFolderCommand(this, folderName, oldfolderName, clipId, false);
575 m_commandStack->push(command);
576 m_doc->setModified(true);
579 void ProjectList::slotAddFolder()
581 AddFolderCommand *command = new AddFolderCommand(this, i18n("Folder"), QString::number(m_doc->clipManager()->getFreeFolderId()), true);
582 m_commandStack->push(command);
585 void ProjectList::slotAddFolder(const QString foldername, const QString &clipId, bool remove, bool edit)
588 FolderProjectItem *item = getFolderItemById(clipId);
590 m_doc->clipManager()->deleteFolder(clipId);
595 FolderProjectItem *item = getFolderItemById(clipId);
597 m_listView->blockSignals(true);
598 item->setGroupName(foldername);
599 m_listView->blockSignals(false);
600 m_doc->clipManager()->addFolder(clipId, foldername);
601 const int children = item->childCount();
602 for (int i = 0; i < children; i++) {
603 ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
604 child->setProperty("groupname", foldername);
610 m_listView->blockSignals(true);
611 m_listView->setCurrentItem(new FolderProjectItem(m_listView, text, clipId));
612 m_doc->clipManager()->addFolder(clipId, foldername);
613 m_listView->blockSignals(false);
616 m_doc->setModified(true);
621 void ProjectList::deleteProjectFolder(QMap <QString, QString> map)
623 QMapIterator<QString, QString> i(map);
624 QUndoCommand *delCommand = new QUndoCommand();
625 delCommand->setText(i18n("Delete Folder"));
626 while (i.hasNext()) {
628 new AddFolderCommand(this, i.key(), i.value(), false, delCommand);
630 m_commandStack->push(delCommand);
633 void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties)
635 m_listView->setEnabled(false);
637 m_listView->blockSignals(true);
639 // remove file_hash so that we load all properties for the clip
640 QDomElement e = clip->toXML().cloneNode().toElement();
641 e.removeAttribute("file_hash");
642 m_infoQueue.insert(clip->getId(), e);
643 //m_render->getFileProperties(clip->toXML(), clip->getId(), true);
645 const QString parent = clip->getProperty("groupid");
646 ProjectItem *item = NULL;
647 if (!parent.isEmpty()) {
648 FolderProjectItem *parentitem = getFolderItemById(parent);
651 QString groupName = clip->getProperty("groupname");
652 //kDebug() << "Adding clip to new group: " << groupName;
653 if (groupName.isEmpty()) groupName = i18n("Folder");
655 parentitem = new FolderProjectItem(m_listView, text, parent);
657 //kDebug() << "Adding clip to existing group: " << parentitem->groupName();
659 if (parentitem) item = new ProjectItem(parentitem, clip);
661 if (item == NULL) item = new ProjectItem(m_listView, clip);
662 KUrl url = clip->fileURL();
664 if (getProperties == false && !clip->getClipHash().isEmpty()) {
665 QString cachedPixmap = m_doc->projectFolder().path(KUrl::AddTrailingSlash) + "thumbs/" + clip->getClipHash() + ".png";
666 if (QFile::exists(cachedPixmap)) {
667 item->setData(0, Qt::DecorationRole, QPixmap(cachedPixmap));
671 if (!url.isEmpty() && KdenliveSettings::activate_nepomuk()) {
672 // if file has Nepomuk comment, use it
673 Nepomuk::Resource f(url.path());
674 QString annotation = f.description();
675 if (!annotation.isEmpty()) item->setText(1, annotation);
676 item->setText(2, QString::number(f.rating()));
680 QList <CutZoneInfo> cuts = clip->cutZones();
681 if (!cuts.isEmpty()) {
682 for (int i = 0; i < cuts.count(); i++) {
683 SubProjectItem *sub = new SubProjectItem(item, cuts.at(i).zone.x(), cuts.at(i).zone.y(), cuts.at(i).description);
684 if (!clip->getClipHash().isEmpty()) {
685 QString cachedPixmap = m_doc->projectFolder().path(KUrl::AddTrailingSlash) + "thumbs/" + clip->getClipHash() + '#' + QString::number(cuts.at(i).zone.x()) + ".png";
686 if (QFile::exists(cachedPixmap)) {
687 sub->setData(0, Qt::DecorationRole, QPixmap(cachedPixmap));
693 if (getProperties && m_listView->isEnabled()) m_listView->blockSignals(false);
694 if (getProperties && !m_queueTimer.isActive()) m_queueTimer.start();
697 void ProjectList::slotResetProjectList()
700 emit clipSelected(NULL);
701 m_thumbnailQueue.clear();
706 void ProjectList::requestClipInfo(const QDomElement xml, const QString id)
709 m_infoQueue.insert(id, xml);
710 //if (m_infoQueue.count() == 1 || ) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
713 void ProjectList::slotProcessNextClipInQueue()
715 if (m_infoQueue.isEmpty()) {
716 slotProcessNextThumbnail();
720 QMap<QString, QDomElement>::const_iterator j = m_infoQueue.constBegin();
721 if (j != m_infoQueue.constEnd()) {
722 const QDomElement dom = j.value();
723 const QString id = j.key();
724 m_infoQueue.remove(j.key());
725 emit getFileProperties(dom, id, m_listView->iconSize().height(), false);
729 void ProjectList::slotUpdateClip(const QString &id)
731 ProjectItem *item = getItemById(id);
732 m_listView->blockSignals(true);
733 if (item) item->setData(1, UsageRole, QString::number(item->numReferences()));
734 m_listView->blockSignals(false);
737 void ProjectList::updateAllClips()
739 m_listView->setSortingEnabled(false);
741 QTreeWidgetItemIterator it(m_listView);
744 m_listView->blockSignals(true);
746 if ((*it)->type() == PROJECTSUBCLIPTYPE) {
748 SubProjectItem *sub = static_cast <SubProjectItem *>(*it);
749 if (sub->data(0, Qt::DecorationRole).isNull()) {
750 item = static_cast <ProjectItem *>((*it)->parent());
751 requestClipThumbnail(item->clipId() + '#' + QString::number(sub->zone().x()));
755 } else if ((*it)->type() == PROJECTFOLDERTYPE) {
760 item = static_cast <ProjectItem *>(*it);
761 clip = item->referencedClip();
762 if (item->referencedClip()->producer() == NULL) {
763 if (clip->isPlaceHolder() == false) {
764 requestClipInfo(clip->toXML(), clip->getId());
765 } else item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
767 if (item->data(0, Qt::DecorationRole).isNull()) {
768 requestClipThumbnail(clip->getId());
770 if (item->data(0, DurationRole).toString().isEmpty()) {
771 item->changeDuration(item->referencedClip()->producer()->get_playtime());
774 item->setData(1, UsageRole, QString::number(item->numReferences()));
775 //qApp->processEvents();
778 qApp->processEvents();
779 if (!m_queueTimer.isActive()) m_queueTimer.start();
781 if (m_listView->isEnabled()) m_listView->blockSignals(false);
782 m_listView->setSortingEnabled(true);
783 if (m_infoQueue.isEmpty()) slotProcessNextThumbnail();
786 void ProjectList::slotAddClip(const QList <QUrl> givenList, const QString &groupName, const QString &groupId)
788 if (!m_commandStack) {
789 kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
792 if (givenList.isEmpty()) {
793 // Build list of mime types
794 QStringList mimeTypes = QStringList() << "application/x-kdenlive" << "application/x-kdenlivetitle" << "video/x-flv" << "application/vnd.rn-realmedia" << "video/x-dv" << "video/dv" << "video/x-msvideo" << "video/x-matroska" << "video/mlt-playlist" << "video/mpeg" << "video/ogg" << "video/x-ms-wmv" << "audio/x-flac" << "audio/x-matroska" << "audio/mp4" << "audio/mpeg" << "audio/x-mp3" << "audio/ogg" << "audio/x-wav" << "application/ogg" << "video/mp4" << "video/quicktime" << "image/gif" << "image/jpeg" << "image/png" << "image/x-tga" << "image/x-bmp" << "image/svg+xml" << "image/tiff" << "image/x-xcf-gimp" << "image/x-vnd.adobe.photoshop" << "image/x-pcx" << "image/x-exr";
796 QString allExtensions;
797 foreach(const QString& mimeType, mimeTypes) {
798 KMimeType::Ptr mime(KMimeType::mimeType(mimeType));
800 allExtensions.append(mime->patterns().join(" "));
801 allExtensions.append(' ');
804 const QString dialogFilter = allExtensions.simplified() + ' ' + QLatin1Char('|') + i18n("All Supported Files") + "\n* " + QLatin1Char('|') + i18n("All Files");
805 list = KFileDialog::getOpenUrls(KUrl("kfiledialog:///clipfolder"), dialogFilter, this);
808 for (int i = 0; i < givenList.count(); i++)
809 list << givenList.at(i);
812 foreach(const KUrl &file, list) {
813 // Check there is no folder here
814 KMimeType::Ptr type = KMimeType::findByUrl(file);
815 if (type->is("inode/directory")) {
816 // user dropped a folder
817 list.removeAll(file);
821 if (list.isEmpty()) return;
823 if (givenList.isEmpty()) {
824 QStringList groupInfo = getGroup();
825 m_doc->slotAddClipList(list, groupInfo.at(0), groupInfo.at(1));
826 } else m_doc->slotAddClipList(list, groupName, groupId);
829 void ProjectList::slotRemoveInvalidClip(const QString &id, bool replace)
831 ProjectItem *item = getItemById(id);
832 QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
834 const QString path = item->referencedClip()->fileURL().path();
835 if (!path.isEmpty()) {
836 if (replace) KMessageBox::sorry(this, i18n("Clip <b>%1</b><br>is invalid, will be removed from project.", path));
838 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;
843 if (replace) m_doc->deleteProjectClip(ids);
847 void ProjectList::slotAddColorClip()
849 if (!m_commandStack) {
850 kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
852 QDialog *dia = new QDialog(this);
853 Ui::ColorClip_UI dia_ui;
855 dia_ui.clip_name->setText(i18n("Color Clip"));
856 dia_ui.clip_duration->setText(KdenliveSettings::color_duration());
857 if (dia->exec() == QDialog::Accepted) {
858 QString color = dia_ui.clip_color->color().name();
859 color = color.replace(0, 1, "0x") + "ff";
860 QStringList groupInfo = getGroup();
861 m_doc->slotCreateColorClip(dia_ui.clip_name->text(), color, dia_ui.clip_duration->text(), groupInfo.at(0), groupInfo.at(1));
867 void ProjectList::slotAddSlideshowClip()
869 if (!m_commandStack) {
870 kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
872 SlideshowClip *dia = new SlideshowClip(m_timecode, this);
874 if (dia->exec() == QDialog::Accepted) {
875 QStringList groupInfo = getGroup();
876 m_doc->slotCreateSlideshowClipFile(dia->clipName(), dia->selectedPath(), dia->imageCount(), dia->clipDuration(), dia->loop(), dia->fade(), dia->lumaDuration(), dia->lumaFile(), dia->softness(), groupInfo.at(0), groupInfo.at(1));
881 void ProjectList::slotAddTitleClip()
883 QStringList groupInfo = getGroup();
884 m_doc->slotCreateTextClip(groupInfo.at(0), groupInfo.at(1));
887 void ProjectList::slotAddTitleTemplateClip()
889 QStringList groupInfo = getGroup();
890 if (!m_commandStack) {
891 kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
894 // Get the list of existing templates
896 filter << "*.kdenlivetitle";
897 const QString path = m_doc->projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
898 QStringList templateFiles = QDir(path).entryList(filter, QDir::Files);
900 QDialog *dia = new QDialog(this);
901 Ui::TemplateClip_UI dia_ui;
903 for (int i = 0; i < templateFiles.size(); ++i) {
904 dia_ui.template_list->comboBox()->addItem(templateFiles.at(i), path + templateFiles.at(i));
906 dia_ui.template_list->fileDialog()->setFilter("*.kdenlivetitle");
907 //warning: setting base directory doesn't work??
909 dia_ui.template_list->fileDialog()->setUrl(startDir);
910 dia_ui.text_box->setHidden(true);
911 if (dia->exec() == QDialog::Accepted) {
912 QString textTemplate = dia_ui.template_list->comboBox()->itemData(dia_ui.template_list->comboBox()->currentIndex()).toString();
913 if (textTemplate.isEmpty()) textTemplate = dia_ui.template_list->comboBox()->currentText();
914 // Create a cloned template clip
915 m_doc->slotCreateTextTemplateClip(groupInfo.at(0), groupInfo.at(1), KUrl(textTemplate));
920 QStringList ProjectList::getGroup() const
923 QTreeWidgetItem *item = m_listView->currentItem();
924 while (item && item->type() != PROJECTFOLDERTYPE) {
925 item = item->parent();
929 FolderProjectItem *folder = static_cast <FolderProjectItem *>(item);
930 result << folder->groupName();
931 result << folder->clipId();
932 } else result << QString() << QString();
936 void ProjectList::setDocument(KdenliveDoc *doc)
938 m_listView->blockSignals(true);
940 m_listView->setSortingEnabled(false);
941 emit clipSelected(NULL);
942 m_thumbnailQueue.clear();
946 m_timecode = doc->timecode();
947 m_commandStack = doc->commandStack();
950 QMap <QString, QString> flist = doc->clipManager()->documentFolderList();
951 QMapIterator<QString, QString> f(flist);
952 while (f.hasNext()) {
954 (void) new FolderProjectItem(m_listView, QStringList() << f.value(), f.key());
957 QList <DocClipBase*> list = doc->clipManager()->documentClipList();
958 for (int i = 0; i < list.count(); i++) {
959 slotAddClip(list.at(i), false);
962 m_listView->blockSignals(false);
963 m_toolbar->setEnabled(true);
964 connect(m_doc->clipManager(), SIGNAL(reloadClip(const QString &)), this, SLOT(slotReloadClip(const QString &)));
965 connect(m_doc->clipManager(), SIGNAL(checkAllClips()), this, SLOT(updateAllClips()));
968 QList <DocClipBase*> ProjectList::documentClipList() const
970 if (m_doc == NULL) return QList <DocClipBase*> ();
971 return m_doc->clipManager()->documentClipList();
974 QDomElement ProjectList::producersList()
977 QDomElement prods = doc.createElement("producerlist");
978 doc.appendChild(prods);
979 kDebug() << "//////////// PRO LISTÂ BUILD PRDSLIST ";
980 QTreeWidgetItemIterator it(m_listView);
982 if ((*it)->type() != PROJECTCLIPTYPE) {
987 prods.appendChild(doc.importNode(((ProjectItem *)(*it))->toXml(), true));
993 void ProjectList::slotCheckForEmptyQueue()
995 if (!m_refreshed && m_thumbnailQueue.isEmpty() && m_infoQueue.isEmpty()) {
997 emit loadingIsOver();
998 emit displayMessage(QString(), -1);
999 m_listView->blockSignals(false);
1000 m_listView->setEnabled(true);
1001 } else if (!m_refreshed) QTimer::singleShot(300, this, SLOT(slotCheckForEmptyQueue()));
1004 void ProjectList::reloadClipThumbnails()
1006 kDebug() << "////////////// RELOAD CLIPS THUMBNAILS!!!";
1007 m_thumbnailQueue.clear();
1008 QTreeWidgetItemIterator it(m_listView);
1010 if ((*it)->type() != PROJECTCLIPTYPE) {
1015 m_thumbnailQueue << ((ProjectItem *)(*it))->clipId();
1018 QTimer::singleShot(300, this, SLOT(slotProcessNextThumbnail()));
1021 void ProjectList::requestClipThumbnail(const QString id)
1023 if (!m_thumbnailQueue.contains(id)) m_thumbnailQueue.append(id);
1026 void ProjectList::slotProcessNextThumbnail()
1028 if (m_thumbnailQueue.isEmpty() && m_infoQueue.isEmpty()) {
1029 slotCheckForEmptyQueue();
1032 if (!m_infoQueue.isEmpty()) {
1033 //QTimer::singleShot(300, this, SLOT(slotProcessNextThumbnail()));
1036 if (m_thumbnailQueue.count() > 1) {
1037 int max = m_doc->clipManager()->clipsCount();
1038 emit displayMessage(i18n("Loading thumbnails"), (int)(100 *(max - m_thumbnailQueue.count()) / max));
1040 slotRefreshClipThumbnail(m_thumbnailQueue.takeFirst(), false);
1043 void ProjectList::slotRefreshClipThumbnail(const QString &clipId, bool update)
1045 QTreeWidgetItem *item = getAnyItemById(clipId);
1046 if (item) slotRefreshClipThumbnail(item, update);
1047 else slotProcessNextThumbnail();
1050 void ProjectList::slotRefreshClipThumbnail(QTreeWidgetItem *it, bool update)
1052 if (it == NULL) return;
1053 ProjectItem *item = NULL;
1054 bool isSubItem = false;
1056 if (it->type() == PROJECTFOLDERTYPE) return;
1057 if (it->type() == PROJECTSUBCLIPTYPE) {
1058 item = static_cast <ProjectItem *>(it->parent());
1059 frame = static_cast <SubProjectItem *>(it)->zone().x();
1062 item = static_cast <ProjectItem *>(it);
1063 frame = item->referencedClip()->getClipThumbFrame();
1067 DocClipBase *clip = item->referencedClip();
1069 slotProcessNextThumbnail();
1073 int height = m_listView->iconSize().height();
1074 int width = (int)(height * m_render->dar());
1075 if (clip->clipType() == AUDIO) pix = KIcon("audio-x-generic").pixmap(QSize(width, height));
1076 else if (clip->clipType() == IMAGE) pix = QPixmap::fromImage(KThumb::getFrame(item->referencedClip()->producer(), 0, width, height));
1077 else pix = item->referencedClip()->thumbProducer()->extractImage(frame, width, height);
1079 if (!pix.isNull()) {
1080 m_listView->blockSignals(true);
1081 it->setData(0, Qt::DecorationRole, pix);
1082 if (m_listView->isEnabled()) m_listView->blockSignals(false);
1083 if (!isSubItem) m_doc->cachePixmap(item->getClipHash(), pix);
1084 else m_doc->cachePixmap(item->getClipHash() + '#' + QString::number(frame), pix);
1086 if (update) emit projectModified();
1087 QTimer::singleShot(30, this, SLOT(slotProcessNextThumbnail()));
1091 void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Producer *producer, const QMap < QString, QString > &properties, const QMap < QString, QString > &metadata, bool replace)
1093 ProjectItem *item = getItemById(clipId);
1094 if (item && producer) {
1095 m_listView->blockSignals(true);
1096 item->setProperties(properties, metadata);
1097 //Q_ASSERT_X(item->referencedClip(), "void ProjectList::slotReplyGetFileProperties", QString("Item with groupName %1 does not have a clip associated").arg(item->groupName()).toLatin1());
1098 item->referencedClip()->setProducer(producer, replace);
1099 //emit receivedClipDuration(clipId);
1100 if (m_listView->isEnabled() && replace) {
1101 // update clip in clip monitor
1102 emit clipSelected(NULL);
1103 emit clipSelected(item->referencedClip());
1106 // Check if duration changed.
1107 emit receivedClipDuration(clipId);
1110 if (m_listView->isEnabled()) m_listView->blockSignals(false);
1111 /*if (item->icon(0).isNull()) {
1112 requestClipThumbnail(clipId);
1114 } else kDebug() << "//////// COULD NOT FIND CLIP TO UPDATE PRPS...";
1115 int max = m_doc->clipManager()->clipsCount();
1116 emit displayMessage(i18n("Loading clips"), (int)(100 *(max - m_infoQueue.count()) / max));
1117 // small delay so that the app can display the progress info
1118 if (item && m_infoQueue.isEmpty() && m_thumbnailQueue.isEmpty()) {
1119 m_listView->setCurrentItem(item);
1120 emit clipSelected(item->referencedClip());
1122 QTimer::singleShot(30, this, SLOT(slotProcessNextClipInQueue()));
1125 void ProjectList::slotReplyGetImage(const QString &clipId, const QPixmap &pix)
1127 ProjectItem *item = getItemById(clipId);
1128 if (item && !pix.isNull()) {
1129 m_listView->blockSignals(true);
1130 item->setData(0, Qt::DecorationRole, pix);
1131 m_doc->cachePixmap(item->getClipHash(), pix);
1132 if (m_listView->isEnabled()) m_listView->blockSignals(false);
1136 QTreeWidgetItem *ProjectList::getAnyItemById(const QString &id)
1138 QTreeWidgetItemIterator it(m_listView);
1139 QString lookId = id;
1140 if (id.contains('#')) {
1141 lookId = id.section('#', 0, 0);
1144 ProjectItem *result = NULL;
1146 if ((*it)->type() != PROJECTCLIPTYPE) {
1151 ProjectItem *item = static_cast<ProjectItem *>(*it);
1152 if (item->clipId() == lookId) {
1158 if (result == NULL || !id.contains('#')) return result;
1159 else for (int i = 0; i < result->childCount(); i++) {
1160 SubProjectItem *sub = static_cast <SubProjectItem *>(result->child(i));
1161 if (sub && sub->zone().x() == id.section('#', 1, 1).toInt()) {
1170 ProjectItem *ProjectList::getItemById(const QString &id)
1173 QTreeWidgetItemIterator it(m_listView);
1175 if ((*it)->type() != PROJECTCLIPTYPE) {
1180 item = static_cast<ProjectItem *>(*it);
1181 if (item->clipId() == id)
1188 FolderProjectItem *ProjectList::getFolderItemById(const QString &id)
1190 FolderProjectItem *item;
1191 QTreeWidgetItemIterator it(m_listView);
1193 if ((*it)->type() == PROJECTFOLDERTYPE) {
1194 item = static_cast<FolderProjectItem *>(*it);
1195 if (item->clipId() == id) return item;
1202 void ProjectList::slotSelectClip(const QString &ix)
1204 ProjectItem *clip = getItemById(ix);
1206 m_listView->setCurrentItem(clip);
1207 m_listView->scrollToItem(clip);
1208 m_editAction->setEnabled(true);
1209 m_deleteAction->setEnabled(true);
1210 m_reloadAction->setEnabled(true);
1211 m_transcodeAction->setEnabled(true);
1212 if (clip->clipType() == IMAGE && !KdenliveSettings::defaultimageapp().isEmpty()) {
1213 m_openAction->setIcon(KIcon(KdenliveSettings::defaultimageapp()));
1214 m_openAction->setEnabled(true);
1215 } else if (clip->clipType() == AUDIO && !KdenliveSettings::defaultaudioapp().isEmpty()) {
1216 m_openAction->setIcon(KIcon(KdenliveSettings::defaultaudioapp()));
1217 m_openAction->setEnabled(true);
1218 } else m_openAction->setEnabled(false);
1222 QString ProjectList::currentClipUrl() const
1225 if (!m_listView->currentItem() || m_listView->currentItem()->type() == PROJECTFOLDERTYPE) return QString();
1226 if (m_listView->currentItem()->type() == PROJECTSUBCLIPTYPE) {
1228 item = static_cast <ProjectItem*>(m_listView->currentItem()->parent());
1229 } else item = static_cast <ProjectItem*>(m_listView->currentItem());
1230 if (item == NULL) return QString();
1231 return item->clipUrl().path();
1234 void ProjectList::regenerateTemplate(const QString &id)
1236 ProjectItem *clip = getItemById(id);
1237 if (clip) regenerateTemplate(clip);
1240 void ProjectList::regenerateTemplate(ProjectItem *clip)
1242 //TODO: remove this unused method, only force_reload is necessary
1243 clip->referencedClip()->producer()->set("force_reload", 1);
1246 QDomDocument ProjectList::generateTemplateXml(QString path, const QString &replaceString)
1250 if (!file.open(QIODevice::ReadOnly)) {
1251 kWarning() << "ERROR, CANNOT READ: " << path;
1254 if (!doc.setContent(&file)) {
1255 kWarning() << "ERROR, CANNOT READ: " << path;
1260 QDomNodeList texts = doc.elementsByTagName("content");
1261 for (int i = 0; i < texts.count(); i++) {
1262 QString data = texts.item(i).firstChild().nodeValue();
1263 data.replace("%s", replaceString);
1264 texts.item(i).firstChild().setNodeValue(data);
1270 void ProjectList::slotAddClipCut(const QString &id, int in, int out)
1272 ProjectItem *clip = getItemById(id);
1273 if (clip == NULL) return;
1274 if (clip->referencedClip()->hasCutZone(QPoint(in, out))) return;
1275 AddClipCutCommand *command = new AddClipCutCommand(this, id, in, out, QString(), true, false);
1276 m_commandStack->push(command);
1279 void ProjectList::addClipCut(const QString &id, int in, int out, const QString desc, bool newItem)
1281 ProjectItem *clip = getItemById(id);
1283 DocClipBase *base = clip->referencedClip();
1284 base->addCutZone(in, out);
1285 m_listView->blockSignals(true);
1286 SubProjectItem *sub = new SubProjectItem(clip, in, out, desc);
1287 if (newItem && desc.isEmpty() && !m_listView->isColumnHidden(1)) {
1288 if (!clip->isExpanded()) clip->setExpanded(true);
1289 m_listView->editItem(sub, 1);
1291 QPixmap p = clip->referencedClip()->thumbProducer()->extractImage(in, (int)(sub->sizeHint(0).height() * m_render->dar()), sub->sizeHint(0).height() - 2);
1292 sub->setData(0, Qt::DecorationRole, p);
1293 m_doc->cachePixmap(clip->getClipHash() + '#' + QString::number(in), p);
1294 m_listView->blockSignals(false);
1296 emit projectModified();
1299 void ProjectList::removeClipCut(const QString &id, int in, int out)
1301 ProjectItem *clip = getItemById(id);
1303 DocClipBase *base = clip->referencedClip();
1304 base->removeCutZone(in, out);
1305 SubProjectItem *sub = getSubItem(clip, QPoint(in, out));
1307 m_listView->blockSignals(true);
1309 m_listView->blockSignals(false);
1312 emit projectModified();
1315 SubProjectItem *ProjectList::getSubItem(ProjectItem *clip, QPoint zone)
1317 SubProjectItem *sub = NULL;
1319 for (int i = 0; i < clip->childCount(); i++) {
1320 QTreeWidgetItem *it = clip->child(i);
1321 if (it->type() == PROJECTSUBCLIPTYPE) {
1322 sub = static_cast <SubProjectItem*>(it);
1323 if (sub->zone() == zone) break;
1331 void ProjectList::slotUpdateClipCut(QPoint p)
1333 if (!m_listView->currentItem() || m_listView->currentItem()->type() != PROJECTSUBCLIPTYPE) return;
1334 SubProjectItem *sub = static_cast <SubProjectItem*>(m_listView->currentItem());
1335 ProjectItem *item = static_cast <ProjectItem *>(sub->parent());
1336 EditClipCutCommand *command = new EditClipCutCommand(this, item->clipId(), sub->zone(), p, sub->text(1), sub->text(1), true);
1337 m_commandStack->push(command);
1340 void ProjectList::doUpdateClipCut(const QString &id, const QPoint oldzone, const QPoint zone, const QString &comment)
1342 ProjectItem *clip = getItemById(id);
1343 SubProjectItem *sub = getSubItem(clip, oldzone);
1344 if (sub == NULL || clip == NULL) return;
1345 DocClipBase *base = clip->referencedClip();
1346 base->updateCutZone(oldzone.x(), oldzone.y(), zone.x(), zone.y(), comment);
1347 m_listView->blockSignals(true);
1349 sub->setDescription(comment);
1350 m_listView->blockSignals(false);
1351 emit projectModified();
1354 #include "projectlist.moc"