+void ProjectList::slotUpdateClipProperties(ProjectItem *clip, QMap <QString, QString> properties)
+{
+ if (!clip) return;
+ if (!clip->isGroup()) clip->setProperties(properties);
+ if (properties.contains("name")) {
+ m_listView->blockSignals(true);
+ clip->setText(1, properties.value("name"));
+ m_listView->blockSignals(false);
+ emit clipNameChanged(clip->clipId(), properties.value("name"));
+ }
+ if (properties.contains("description")) {
+ CLIPTYPE type = clip->clipType();
+ m_listView->blockSignals(true);
+ clip->setText(2, properties.value("description"));
+ m_listView->blockSignals(false);
+ if (KdenliveSettings::activate_nepomuk() && (type == AUDIO || type == VIDEO || type == AV || type == IMAGE || type == PLAYLIST)) {
+ // Use Nepomuk system to store clip description
+ Nepomuk::Resource f(clip->clipUrl().path());
+ f.setDescription(properties.value("description"));
+ }
+ emit projectModified();
+ }
+}
+
+void ProjectList::slotItemEdited(QTreeWidgetItem *item, int column)
+{
+ ProjectItem *clip = static_cast <ProjectItem*>(item);
+ if (column == 2) {
+ if (clip->referencedClip()) {
+ QMap <QString, QString> oldprops;
+ QMap <QString, QString> newprops;
+ oldprops["description"] = clip->referencedClip()->getProperty("description");
+ newprops["description"] = item->text(2);
+
+ if (clip->clipType() == TEXT) {
+ // This is a text template clip, update the image
+ /*oldprops.insert("xmldata", clip->referencedClip()->getProperty("xmldata"));
+ newprops.insert("xmldata", generateTemplateXml(clip->referencedClip()->getProperty("xmltemplate"), item->text(2)).toString());*/
+ oldprops.insert("templatetext", clip->referencedClip()->getProperty("templatetext"));
+ newprops.insert("templatetext", item->text(2));
+ }
+ slotUpdateClipProperties(clip->clipId(), newprops);
+ EditClipCommand *command = new EditClipCommand(this, clip->clipId(), oldprops, newprops, false);
+ m_commandStack->push(command);
+ }
+ } else if (column == 1) {
+ if (clip->isGroup()) {
+ editFolder(item->text(1), clip->groupName(), clip->clipId());
+ clip->setGroupName(item->text(1));
+ m_doc->clipManager()->addFolder(clip->clipId(), item->text(1));
+ const int children = item->childCount();
+ for (int i = 0; i < children; i++) {
+ ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
+ child->setProperty("groupname", item->text(1));
+ }
+ } else {
+ if (clip->referencedClip()) {
+ QMap <QString, QString> oldprops;
+ QMap <QString, QString> newprops;
+ oldprops["name"] = clip->referencedClip()->getProperty("name");
+ newprops["name"] = item->text(1);
+ slotUpdateClipProperties(clip, newprops);
+ emit projectModified();
+ EditClipCommand *command = new EditClipCommand(this, clip->clipId(), oldprops, newprops, false);
+ m_commandStack->push(command);
+ }
+ }
+ }
+}
+
+void ProjectList::slotContextMenu(const QPoint &pos, QTreeWidgetItem *item)
+{