]> git.sesse.net Git - kdenlive/commitdiff
Fix effect stack global enable/disable checkbox
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 7 Apr 2012 20:32:15 +0000 (22:32 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 7 Apr 2012 20:32:15 +0000 (22:32 +0200)
src/customtrackview.cpp
src/effectstack/collapsibleeffect.cpp
src/effectstack/collapsibleeffect.h
src/effectstack/collapsiblegroup.cpp
src/effectstack/collapsiblegroup.h
src/effectstack/effectstackview2.cpp
src/effectstack/effectstackview2.h

index 9e273c21a864722caf6c098f58484c83d45a0b55..5c5a2bc2621a61655de550d80af7bfbdc1ec0c5d 100644 (file)
@@ -2724,7 +2724,6 @@ void CustomTrackView::addTrack(TrackInfo type, int ix)
             }*/
         }
         // Sync transition tracks with MLT playlist
-        
         Transition *tr;        
        TransitionInfo info;
        for (int i = 0; i < transitionInfos.count(); i++) {
index c3b22c252aee52e5f54dabb865608be4d2b89f79..523afe10010b2646b03f7fcb91c8533d53426750 100644 (file)
@@ -345,7 +345,7 @@ void CollapsibleEffect::mouseReleaseEvent( QMouseEvent *event )
   QWidget::mouseReleaseEvent(event);
 }
 
-void CollapsibleEffect::slotEnable(bool disable)
+void CollapsibleEffect::slotEnable(bool disable, bool updateMainStatus)
 {
     title->setEnabled(!disable);
     enabledButton->blockSignals(true);
@@ -356,7 +356,7 @@ void CollapsibleEffect::slotEnable(bool disable)
     if (!disable || KdenliveSettings::disable_effect_parameters()) {
         widgetFrame->setEnabled(!disable);
     }
-    emit effectStateChanged(disable, effectIndex());
+    emit effectStateChanged(disable, effectIndex(), updateMainStatus);
 }
 
 void CollapsibleEffect::slotDeleteEffect()
index 6b12a873dcf015b444907a785a338359477d3d25..530a53e56305a0bb29190558e93e2c7c56845758 100644 (file)
@@ -149,7 +149,7 @@ public:
 
 public slots:
     void slotSyncEffectsPos(int pos);
-    void slotEnable(bool enable);
+    void slotEnable(bool enable, bool updateMainStatus = true);
     void slotResetEffect();
 
 private slots:
@@ -185,7 +185,7 @@ protected:
 signals:
     void parameterChanged(const QDomElement, const QDomElement, int);
     void syncEffectsPos(int);
-    void effectStateChanged(bool, int ix = -1);
+    void effectStateChanged(bool, int ix = -1, bool updateMainStatus = true);
     void deleteEffect(const QDomElement);
     void changeEffectPosition(int, bool);
     void activateEffect(int);
index d46e20f9a6333ea04942bac6dc0efa097397db72..cb1ad1d559ea510870804321858b73e3f0fdf74b 100644 (file)
@@ -140,7 +140,7 @@ void CollapsibleGroup::slotDeleteGroup()
     // 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);
+    emit deleteGroup(doc);
 }
 
 void CollapsibleGroup::slotEffectUp()
index 5f5e21682e448f804ae90275111df51a3bcdf2fc..bab2fe611e7c5f5581bea035993fe9d8c5eb94e5 100644 (file)
@@ -107,7 +107,7 @@ protected:
 signals:
     void syncEffectsPos(int);
     void effectStateChanged(bool, int ix = -1);
-    void deleteGroup(int, QDomDocument);
+    void deleteGroup(QDomDocument);
     void changeGroupPosition(int, bool);
     void activateEffect(int);
     void moveEffect(int current_pos, int new_pos, int groupIndex, QString groupName);
index 8d64110e61fb409b7ca0f7051d87c6d53a57adcf..91476f0b476b4effe6cc24f55e4c2f8f1d96aa6d 100644 (file)
@@ -191,7 +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)));
+               connect(group, SIGNAL(deleteGroup(QDomDocument)), this , SLOT(slotDeleteGroup(QDomDocument)));
                vbox1->addWidget(group);
                group->installEventFilter( this );
            }
@@ -230,7 +230,7 @@ void EffectStackView2::setupListView(int ix)
        connect(currentEffect, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
        connect(currentEffect, SIGNAL(resetEffect(int)), this , SLOT(slotResetEffect(int)));
         connect(currentEffect, SIGNAL(changeEffectPosition(int,bool)), this , SLOT(slotMoveEffectUp(int , bool)));
-        connect(currentEffect, SIGNAL(effectStateChanged(bool, int)), this, SLOT(slotUpdateEffectState(bool, int)));
+        connect(currentEffect, SIGNAL(effectStateChanged(bool,int,bool)), this, SLOT(slotUpdateEffectState(bool,int,bool)));
         connect(currentEffect, SIGNAL(activateEffect(int)), this, SLOT(slotSetCurrentEffect(int)));
         connect(currentEffect, SIGNAL(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
         connect(currentEffect, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
@@ -360,13 +360,13 @@ void EffectStackView2::startDrag()
 }
 
 
-void EffectStackView2::slotUpdateEffectState(bool disable, int index)
+void EffectStackView2::slotUpdateEffectState(bool disable, int index, bool updateMainStatus)
 {
     if (m_effectMetaInfo.trackMode)
         emit changeEffectState(NULL, m_trackindex, index, disable);
     else
         emit changeEffectState(m_clipref, -1, index, disable);
-    slotUpdateCheckAllButton();
+    if (updateMainStatus) slotUpdateCheckAllButton();
 }
 
 
@@ -424,17 +424,17 @@ void EffectStackView2::clear()
 
 void EffectStackView2::slotCheckAll(int state)
 {
-    if (state == 1) {
-        state = 2;
+    if (state == Qt::PartiallyChecked) {
+        state = Qt::Checked;
         m_ui.checkAll->blockSignals(true);
         m_ui.checkAll->setCheckState(Qt::Checked);
         m_ui.checkAll->blockSignals(false);
     }
 
-    bool disabled = (state != 2);
+    bool disabled = state == Qt::Unchecked;
     for (int i = 0; i < m_effects.count(); i++) {
        if (!m_effects.at(i)->isGroup()) {
-           m_effects.at(i)->slotEnable(!disabled);
+           m_effects.at(i)->slotEnable(disabled, false);
        }
     }
 }
@@ -518,7 +518,7 @@ void EffectStackView2::slotSetCurrentEffect(int ix)
     }
 }
 
-void EffectStackView2::slotDeleteGroup(int groupIndex, QDomDocument doc)
+void EffectStackView2::slotDeleteGroup(QDomDocument doc)
 {
     QDomNodeList effects = doc.elementsByTagName("effect");
     ClipItem * clip = NULL;
@@ -658,7 +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)));
+    connect(group, SIGNAL(deleteGroup(QDomDocument)), this , SLOT(slotDeleteGroup(QDomDocument)));
     l->insertWidget(groupPos, group);
     group->installEventFilter( this );
     group->addGroupEffect(effectToMove);
index df90457ef389ec07f7a3be6ff9333f890246c103..a5d80f933e6f4c8c565a997b7cab142072542ecd 100644 (file)
@@ -143,13 +143,13 @@ private slots:
     void slotDeleteEffect(const QDomElement effect);
     
     /** @brief Delete all effect in a group. */
-    void slotDeleteGroup(int groupIndex, QDomDocument doc);
+    void slotDeleteGroup(QDomDocument doc);
 
     /** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
     void slotRenderPos(int pos);
 
     /** @brief Called whenever an effect is enabled / disabled by user. */
-    void slotUpdateEffectState(bool disable, int index);
+    void slotUpdateEffectState(bool disable, int index, bool updateMainStatus);
 
     void slotSetCurrentEffect(int ix);