- QMap <QString, QString> props;
- props["description"] = item->text(2);
- slotUpdateClipProperties(clip, props);
- } else if (column == 1 && clip->isGroup()) {
- m_doc->slotEditFolder(item->text(1), clip->groupName(), clip->clipId());
- clip->setGroupName(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));
+ 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);
+ }