]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackview.cpp
- Avoid adding an undo command when no clips are actually added. [1]
[kdenlive] / src / effectstackview.cpp
index 7f852e760241c00c95d7f39da51ee4f0ca2a74a5..dccceb75eeedac082f8db5418083c7e05d2317fa 100644 (file)
@@ -72,6 +72,7 @@ EffectStackView::EffectStackView(QWidget *parent) :
     connect(m_ui.buttonSave, SIGNAL(clicked()), this, SLOT(slotSaveEffect()));
     connect(m_ui.buttonReset, SIGNAL(clicked()), this, SLOT(slotResetEffect()));
     connect(m_effectedit, SIGNAL(parameterChanged(const QDomElement, const QDomElement)), this , SLOT(slotUpdateEffectParams(const QDomElement, const QDomElement)));
+    connect(m_effectedit, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
     m_effectLists["audio"] = &MainWindow::audioEffects;
     m_effectLists["video"] = &MainWindow::videoEffects;
     m_effectLists["custom"] = &MainWindow::customEffects;
@@ -140,6 +141,7 @@ void EffectStackView::slotUpdateEffectParams(const QDomElement old, const QDomEl
 
 void EffectStackView::slotClipItemSelected(ClipItem* c, int ix)
 {
+    if (c && !c->isEnabled()) return;
     if (c && c == m_clipref) {
         if (ix == -1) ix = m_ui.effectlist->currentRow();
     } else {
@@ -173,6 +175,7 @@ void EffectStackView::slotItemChanged(QListWidgetItem *item)
     m_ui.buttonReset->setEnabled(!disable);
     int activeRow = m_ui.effectlist->currentRow();
     if (activeRow >= 0) {
+        m_effectedit->updateParameter("disable", QString::number((int) disable));
         emit changeEffectState(m_clipref, activeRow, disable);
     }
 }
@@ -186,6 +189,7 @@ void EffectStackView::setupListView(int ix)
     // Issue 238: Add icons for effect type in effectstack.
     KIcon videoIcon("kdenlive-show-video");
     KIcon audioIcon("kdenlive-show-audio");
+    KIcon customIcon("kdenlive-custom-effect");
     QListWidgetItem* item;
 
     for (int i = 0; i < m_clipref->effectsCount(); i++) {
@@ -207,12 +211,12 @@ void EffectStackView::setupListView(int ix)
             if ("audio" == type) {
                 item = new QListWidgetItem(audioIcon, i18n(namenode.toElement().text().toUtf8().data()), m_ui.effectlist);
             } else if ("custom" == type) {
-                item = new QListWidgetItem(i18n(namenode.toElement().text().toUtf8().data()), m_ui.effectlist);
+                item = new QListWidgetItem(customIcon, i18n(namenode.toElement().text().toUtf8().data()), m_ui.effectlist);
             } else {
                 item = new QListWidgetItem(videoIcon, i18n(namenode.toElement().text().toUtf8().data()), m_ui.effectlist);
             }
             item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
-            if (d.attribute("disabled") == "1") item->setCheckState(Qt::Unchecked);
+            if (d.attribute("disable") == "1") item->setCheckState(Qt::Unchecked);
             else item->setCheckState(Qt::Checked);
         }
     }
@@ -314,4 +318,11 @@ void EffectStackView::clear()
     m_ui.effectlist->blockSignals(false);
 }
 
+
+void EffectStackView::slotSeekTimeline(int pos)
+{
+    if (!m_clipref) return;
+    emit seekTimeline(m_clipref->startPos().frames(KdenliveSettings::project_fps()) + pos);
+}
+
 #include "effectstackview.moc"