connect(enabledBox, SIGNAL(toggled(bool)), this, SLOT(slotEnable(bool)));
connect(buttonUp, SIGNAL(clicked()), this, SLOT(slotEffectUp()));
connect(buttonDown, SIGNAL(clicked()), this, SLOT(slotEffectDown()));
- connect(buttonDel, SIGNAL(clicked()), this, SLOT(slotDeleteEffect()));
+ connect(buttonDel, SIGNAL(clicked()), this, SLOT(slotDeleteGroup()));
}
}
}
-void CollapsibleGroup::slotDeleteEffect()
+void CollapsibleGroup::slotDeleteGroup()
{
- emit deleteGroup(groupIndex());
+ QDomDocument doc;
+ // delete effects from the last one to the first, otherwise each deletion would trigger an update
+ // in other effects's kdenlive_ix index.
+ for (int i = m_subWidgets.count() - 1; i >= 0; i--)
+ doc.appendChild(doc.importNode(m_subWidgets.at(i)->effect(), true));
+ emit deleteGroup(m_index, doc);
}
void CollapsibleGroup::slotEffectUp()
private slots:
void slotSwitch();
void slotShow(bool show);
- void slotDeleteEffect();
+ void slotDeleteGroup();
void slotEffectUp();
void slotEffectDown();
void slotSaveGroup();
signals:
void syncEffectsPos(int);
void effectStateChanged(bool, int ix = -1);
- void deleteGroup(int);
+ void deleteGroup(int, QDomDocument);
void changeGroupPosition(int, bool);
void activateEffect(int);
void moveEffect(int current_pos, int new_pos, int groupIndex, QString groupName);
connect(group, SIGNAL(unGroup(CollapsibleGroup*)), this , SLOT(slotUnGroup(CollapsibleGroup*)));
connect(group, SIGNAL(groupRenamed(CollapsibleGroup *)), this, SLOT(slotRenameGroup(CollapsibleGroup*)));
connect(group, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
+ connect(group, SIGNAL(deleteGroup(int, QDomDocument)), this , SLOT(slotDeleteGroup(int,QDomDocument)));
vbox1->addWidget(group);
group->installEventFilter( this );
}
}
}
+void EffectStackView2::slotDeleteGroup(int groupIndex, QDomDocument doc)
+{
+ QDomNodeList effects = doc.elementsByTagName("effect");
+ ClipItem * clip = NULL;
+ int ix;
+ if (m_effectMetaInfo.trackMode) {
+ ix = m_trackindex;
+ }
+ else {
+ clip = m_clipref;
+ ix = -1;
+ }
+
+ for (int i = 0; i < effects.count(); i++)
+ emit removeEffect(clip, ix, effects.at(i).toElement());
+}
+
void EffectStackView2::slotDeleteEffect(const QDomElement effect)
{
if (m_effectMetaInfo.trackMode)
connect(group, SIGNAL(unGroup(CollapsibleGroup*)), this , SLOT(slotUnGroup(CollapsibleGroup*)));
connect(group, SIGNAL(groupRenamed(CollapsibleGroup *)), this , SLOT(slotRenameGroup(CollapsibleGroup*)));
connect(group, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
+ connect(group, SIGNAL(deleteGroup(int, QDomDocument)), this , SLOT(slotDeleteGroup(int,QDomDocument)));
l->insertWidget(groupPos, group);
group->installEventFilter( this );
group->addGroupEffect(effectToMove);
/** @brief Delete an effect in the stack. */
void slotDeleteEffect(const QDomElement effect);
+
+ /** @brief Delete all effect in a group. */
+ void slotDeleteGroup(int groupIndex, QDomDocument doc);
/** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
void slotRenderPos(int pos);
<property name="text">
<string/>
</property>
- <property name="shortcut">
- <string>Return</string>
- </property>
</widget>
</item>
<item>