]> git.sesse.net Git - kdenlive/blobdiff - src/effectstack/effectstackview2.cpp
improvements to effect stack UI & fix timeline keyframes not refreshing
[kdenlive] / src / effectstack / effectstackview2.cpp
index 2c379dd15798525d75794efa47ff154ecb5aca18..8d64110e61fb409b7ca0f7051d87c6d53a57adcf 100644 (file)
@@ -68,13 +68,17 @@ EffectStackView2::EffectStackView2(Monitor *monitor, QWidget *parent) :
     setEnabled(false);
 
     
-    setStyleSheet(CollapsibleEffect::getStyleSheet(palette()));
+    setStyleSheet(CollapsibleEffect::getStyleSheet());
 }
 
 EffectStackView2::~EffectStackView2()
 {
 }
 
+void EffectStackView2::updatePalette()
+{
+    setStyleSheet(CollapsibleEffect::getStyleSheet());
+}
 
 void EffectStackView2::slotRenderPos(int pos)
 {
@@ -187,6 +191,7 @@ void EffectStackView2::setupListView(int ix)
                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 );
            }
@@ -440,7 +445,7 @@ void EffectStackView2::slotUpdateCheckAllButton()
     bool hasDisabled = false;
     
     for (int i = 0; i < m_effects.count(); i++) {
-       if (m_effects.at(i)->enabledBox->isChecked()) hasEnabled = true;
+       if (!m_effects.at(i)->enabledButton->isChecked()) hasEnabled = true;
        else hasDisabled = true; 
     }
 
@@ -500,18 +505,36 @@ void EffectStackView2::slotUpdateEffectParams(const QDomElement old, const QDomE
 
 void EffectStackView2::slotSetCurrentEffect(int ix)
 {
-    if (m_clipref && ix != m_clipref->selectedEffectIndex())
+    if (m_clipref && ix != m_clipref->selectedEffectIndex()) {
         m_clipref->setSelectedEffect(ix);
-    for (int i = 0; i < m_effects.count(); i++) {
-       if (m_effects.at(i)->effectIndex() == ix) {
-           m_effects.at(i)->setActive(true);
-           m_ui.labelComment->setText(i18n(m_effects.at(i)->effect().firstChildElement("description").firstChildElement("full").text().toUtf8().data()));
-            m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
+       for (int i = 0; i < m_effects.count(); i++) {
+           if (m_effects.at(i)->effectIndex() == ix) {
+               m_effects.at(i)->setActive(true);
+               m_ui.labelComment->setText(i18n(m_effects.at(i)->effect().firstChildElement("description").firstChildElement("full").text().toUtf8().data()));
+               m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
+           }
+           else m_effects.at(i)->setActive(false);
        }
-        else m_effects.at(i)->setActive(false);
     }
 }
 
+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)
@@ -635,6 +658,7 @@ void EffectStackView2::slotCreateGroup(int ix)
     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);