]> git.sesse.net Git - kdenlive/commitdiff
Merge branch 'master' of git://anongit.kde.org/kdenlive
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 7 Apr 2012 21:29:41 +0000 (23:29 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 7 Apr 2012 21:29:41 +0000 (23:29 +0200)
src/clipitem.cpp
src/customtrackview.cpp
src/customtrackview.h
src/effectstack/collapsibleeffect.cpp
src/effectstack/collapsibleeffect.h
src/effectstack/collapsiblegroup.cpp
src/effectstack/collapsiblegroup.h
src/effectstack/effectstackview2.cpp
src/effectstack/effectstackview2.h
src/mainwindow.cpp
src/mainwindow.h

index 3e77c933efc6db01a22d32f67c762951fd61582a..d5c03901631d67def268ef491196d0d449adfd5d 100644 (file)
@@ -1570,10 +1570,10 @@ void ClipItem::deleteEffect(QString index)
     m_effectList.removeAt(ix);
     m_effectNames = m_effectList.effectNames().join(" / ");
 
-    if (m_effectList.isEmpty() || m_selectedEffect + 1 == ix) {
+    if (m_effectList.isEmpty() || m_selectedEffect == ix) {
         // Current effect was removed
-        if (ix > m_effectList.count() - 1) {
-            setSelectedEffect(m_effectList.count() - 1);
+        if (ix > m_effectList.count()) {
+            setSelectedEffect(m_effectList.count());
         } else setSelectedEffect(ix);
     }
     if (needRepaint) update(boundingRect());
index 9e273c21a864722caf6c098f58484c83d45a0b55..ace533d4eb30321c155a83f63d61f5ac457a6e09 100644 (file)
@@ -1678,6 +1678,7 @@ void CustomTrackView::addEffect(int track, GenTime pos, QDomElement effect)
         EffectsParameterList params = clip->addEffect(effect);
         if (!m_document->renderer()->mltAddEffect(track, pos, params))
             emit displayMessage(i18n("Problem adding effect to clip"), ErrorMessage);
+       clip->setSelectedEffect(params.paramValue("kdenlive_ix").toInt());
         if (clip->isSelected()) emit clipItemSelected(clip);
     } else emit displayMessage(i18n("Cannot find clip to add effect"), ErrorMessage);
 }
@@ -1803,11 +1804,11 @@ void CustomTrackView::slotAddEffect(QDomElement effect, GenTime pos, int track)
            for (int i = 0; i < itemList.count(); i++) {
                if (itemList.at(i)->type() == AVWIDGET) {
                    ClipItem *clip = static_cast<ClipItem *>(itemList.at(i));
-                   clip->setSelectedEffect(clip->effectsCount() - 1);
+                   clip->setSelectedEffect(clip->effectsCount());
                    if (!clip->isSelected()) {
                        clearSelection(false);
                        clip->setSelected(true);
-                       emit clipItemSelected(clip, clip->selectedEffectIndex());
+                       emit clipItemSelected(clip);
                    }
                    break;
                }
@@ -1943,7 +1944,7 @@ void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement insertedE
             }
             clip->updateEffect(effect);
            if (updateEffectStack && clip->isSelected())
-               emit clipItemSelected(clip, ix);
+               emit clipItemSelected(clip);
            if (ix == clip->selectedEffectIndex()) {
                // make sure to update display of clip keyframes
                clip->setSelectedEffect(ix);
@@ -1974,7 +1975,7 @@ void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement insertedE
         if (success) {
            clip->updateEffect(effect);
            if (updateEffectStack && clip->isSelected()) {
-               emit clipItemSelected(clip, ix);
+               emit clipItemSelected(clip);
            }
            if (ix == clip->selectedEffectIndex()) {
                // make sure to update display of clip keyframes
@@ -2023,7 +2024,8 @@ void CustomTrackView::moveEffect(int track, GenTime pos, int oldPos, int newPos)
         } else if (before.attribute("id") == "speed") {
             m_document->renderer()->mltUpdateEffectPosition(track, pos, newPos, oldPos);
         } else m_document->renderer()->mltMoveEffect(track, pos, oldPos, newPos);
-        emit clipItemSelected(clip, newPos);
+       clip->setSelectedEffect(newPos);
+        emit clipItemSelected(clip);
         setDocumentModified();
     } else emit displayMessage(i18n("Cannot move effect"), ErrorMessage);
 }
@@ -2499,7 +2501,7 @@ void CustomTrackView::dropEvent(QDropEvent * event)
             groupSelectedItems(true);
         } else if (items.count() == 1) {
             m_dragItem = static_cast <AbstractClipItem *>(items.at(0));
-            emit clipItemSelected((ClipItem*)m_dragItem, -1, false);
+            emit clipItemSelected((ClipItem*)m_dragItem, false);
         }
         event->setDropAction(Qt::MoveAction);
         event->accept();
@@ -2724,7 +2726,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++) {
@@ -3687,7 +3688,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
                 EffectsList::setParameter(oldeffect, "in", QString::number(start));
                 EffectsList::setParameter(oldeffect, "out", QString::number(end));
                 slotUpdateClipEffect(item, -1, effect, oldeffect, ix);
-                emit clipItemSelected(item, ix);
+                emit clipItemSelected(item);
             }
         } else if (item->fadeIn() != 0 && ix2 == -1) {
             QDomElement effect;
@@ -3710,7 +3711,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
                 EffectsList::setParameter(oldeffect, "in", QString::number(start));
                 EffectsList::setParameter(oldeffect, "out", QString::number(end));
                 slotUpdateClipEffect(item, -1, effect, oldeffect, ix2);
-                emit clipItemSelected(item, ix2);
+                emit clipItemSelected(item);
             }
         }
     } else if (m_operationMode == FADEOUT) {
@@ -3731,7 +3732,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
                 EffectsList::setParameter(oldeffect, "out", QString::number(end));
                 // kDebug()<<"EDIT FADE OUT : "<<start<<"x"<<end;
                 slotUpdateClipEffect(item, -1, effect, oldeffect, ix);
-                emit clipItemSelected(item, ix);
+                emit clipItemSelected(item);
             }
         } else if (item->fadeOut() != 0 && ix2 == -1) {
             QDomElement effect;
@@ -3756,7 +3757,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
                 EffectsList::setParameter(oldeffect, "out", QString::number(end));
                 // kDebug()<<"EDIT FADE OUT : "<<start<<"x"<<end;
                 slotUpdateClipEffect(item, -1, effect, oldeffect, ix2);
-                emit clipItemSelected(item, ix2);
+                emit clipItemSelected(item);
             }
         }
     } else if (m_operationMode == KEYFRAME) {
@@ -3787,7 +3788,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
 
         m_commandStack->push(command);
         updateEffect(m_document->tracksCount() - item->track(), item->startPos(), item->selectedEffect(), item->selectedEffectIndex());
-        emit clipItemSelected(item, item->selectedEffectIndex());
+        emit clipItemSelected(item);
     }
     if (m_dragItem && m_dragItem->type() == TRANSITIONWIDGET && m_dragItem->isSelected()) {
         // A transition is selected
@@ -4807,7 +4808,7 @@ void CustomTrackView::updatePositionEffects(ClipItem* item, ItemInfo info, bool
                     emit displayMessage(i18n("Problem editing effect"), ErrorMessage);
                 // if fade effect is displayed, update the effect edit widget with new clip duration
                 if (item->isSelected() && effectPos == item->selectedEffectIndex())
-                    emit clipItemSelected(item, effectPos);
+                    emit clipItemSelected(item);
             }
         }
         effectPos = item->hasEffect("brightness", "fade_from_black");
@@ -4828,7 +4829,7 @@ void CustomTrackView::updatePositionEffects(ClipItem* item, ItemInfo info, bool
                     emit displayMessage(i18n("Problem editing effect"), ErrorMessage);
                 // if fade effect is displayed, update the effect edit widget with new clip duration
                 if (item->isSelected() && effectPos == item->selectedEffectIndex())
-                    emit clipItemSelected(item, effectPos);
+                    emit clipItemSelected(item);
             }
         }
     }
@@ -4854,7 +4855,7 @@ void CustomTrackView::updatePositionEffects(ClipItem* item, ItemInfo info, bool
                     emit displayMessage(i18n("Problem editing effect"), ErrorMessage);
                 // if fade effect is displayed, update the effect edit widget with new clip duration
                 if (item->isSelected() && effectPos == item->selectedEffectIndex())
-                    emit clipItemSelected(item, effectPos);
+                    emit clipItemSelected(item);
             }
         }
         effectPos = item->hasEffect("brightness", "fade_to_black");
@@ -4875,7 +4876,7 @@ void CustomTrackView::updatePositionEffects(ClipItem* item, ItemInfo info, bool
                     emit displayMessage(i18n("Problem editing effect"), ErrorMessage);
                 // if fade effect is displayed, update the effect edit widget with new clip duration
                 if (item->isSelected() && effectPos == item->selectedEffectIndex())
-                    emit clipItemSelected(item, effectPos);
+                    emit clipItemSelected(item);
             }
         }
     }
@@ -4890,7 +4891,7 @@ void CustomTrackView::updatePositionEffects(ClipItem* item, ItemInfo info, bool
             EffectsList::setParameter(eff, "frame", QString::number(freeze_pos));
             if (standalone) {
                 if (item->isSelected() && item->selectedEffect().attribute("id") == "freeze") {
-                    emit clipItemSelected(item, item->selectedEffectIndex());
+                    emit clipItemSelected(item);
                 }
             }
         }
@@ -6877,7 +6878,7 @@ void CustomTrackView::slotGotFilterJobResults(const QString &/*id*/, int startPo
         }
         EditEffectCommand *command = new EditEffectCommand(this, m_document->tracksCount() - clip->track(), clip->startPos(), effect, newEffect, clip->selectedEffectIndex(), true, true);
         m_commandStack->push(command);
-        emit clipItemSelected(clip, clip->selectedEffectIndex());
+        emit clipItemSelected(clip);
     }
     
 }
index afde5018d51a83508628b37c949b957327940af0..f4175ab3f3d9ba96018652a7751ae63e4090ca96 100644 (file)
@@ -472,9 +472,8 @@ signals:
     void mousePosition(int);
     /** @brief A clip was selected in timeline, update the effect stack
      *  @param clip The clip
-     *  @param ix The index of currently selected effect
      *  @param raise If true, the effect stack widget will be raised (come to front). */
-    void clipItemSelected(ClipItem *clip, int ix = -1, bool raise = true);
+    void clipItemSelected(ClipItem *clip, bool raise = true);
     void transitionItemSelected(Transition*, int track = 0, QPoint p = QPoint(), bool update = false);
     void activateDocumentMonitor();
     void trackHeightChanged();
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..e5984ee0f253321ae2f4660672a4663f1a50274c 100644 (file)
@@ -89,7 +89,7 @@ void EffectStackView2::slotRenderPos(int pos)
         m_effects.at(i)->slotSyncEffectsPos(pos);
 }
 
-void EffectStackView2::slotClipItemSelected(ClipItem* c, int ix)
+void EffectStackView2::slotClipItemSelected(ClipItem* c)
 {
     if (c && !c->isEnabled()) return;
     if (c && c == m_clipref) {
@@ -107,12 +107,9 @@ void EffectStackView2::slotClipItemSelected(ClipItem* c, int ix)
                 m_ui.checkAll->setText(i18n("Effects for %1").arg(cname));
             }
             m_ui.checkAll->setEnabled(true);
-            ix = c->selectedEffectIndex();
             QString size = c->baseClip()->getProperty("frame_size");
             double factor = c->baseClip()->getProperty("aspect_ratio").toDouble();
             m_effectMetaInfo.frameSize = QPoint((int)(size.section('x', 0, 0).toInt() * factor + 0.5), size.section('x', 1, 1).toInt());
-        } else {
-            ix = 0;
         }
     }
     if (m_clipref == NULL) {
@@ -125,7 +122,7 @@ void EffectStackView2::slotClipItemSelected(ClipItem* c, int ix)
     setEnabled(true);
     m_effectMetaInfo.trackMode = false;
     m_currentEffectList = m_clipref->effectList();
-    setupListView(ix);
+    setupListView();
 }
 
 void EffectStackView2::slotTrackItemSelected(int ix, const TrackInfo info)
@@ -138,11 +135,11 @@ void EffectStackView2::slotTrackItemSelected(int ix, const TrackInfo info)
     m_ui.checkAll->setToolTip(QString());
     m_ui.checkAll->setText(i18n("Effects for track %1").arg(info.trackName.isEmpty() ? QString::number(ix) : info.trackName));
     m_trackindex = ix;
-    setupListView(0);
+    setupListView();
 }
 
 
-void EffectStackView2::setupListView(int ix)
+void EffectStackView2::setupListView()
 {
     blockSignals(true);
     m_draggedEffect = NULL;
@@ -191,7 +188,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 );
            }
@@ -203,6 +200,7 @@ void EffectStackView2::setupListView(int ix)
         kDebug() << "IMPORTED STK: " << doc.toString();*/
        
        ItemInfo info;
+       bool isSelected = false;
        if (m_effectMetaInfo.trackMode) { 
             info.track = m_trackInfo.type;
             info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
@@ -210,16 +208,24 @@ void EffectStackView2::setupListView(int ix)
             info.startPos = GenTime(-1);
             info.track = 0;
        }
-       else info = m_clipref->info();
+       else {
+           info = m_clipref->info();
+       }
 
         CollapsibleEffect *currentEffect = new CollapsibleEffect(d, m_currentEffectList.at(i), info, &m_effectMetaInfo, i == m_currentEffectList.count() - 1, view);
+       if (m_effectMetaInfo.trackMode) {
+           isSelected = currentEffect->effectIndex() == 1;
+       }
+       else {
+           isSelected = currentEffect->effectIndex() == m_clipref->selectedEffectIndex();
+       }
+       if (isSelected) currentEffect->setActive(true);
         m_effects.append(currentEffect);
         if (group) {
            group->addGroupEffect(currentEffect);
        } else {
            vbox1->addWidget(currentEffect);
        }
-       if (currentEffect->effectIndex() == ix) currentEffect->setActive(true);
 
        // Check drag & drop
        currentEffect->installEventFilter( this );
@@ -230,7 +236,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 +366,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 +430,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 +524,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 +664,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..48fa4f42196f3685639aa85dd07688ca7d6411fb 100644 (file)
@@ -102,18 +102,16 @@ private:
     /** @brief The current number of groups. */
     int m_groupIndex;
 
-    /** @brief Sets the list of effects according to the clip's effect list.
-    * @param ix Number of the effect to preselect */
-    void setupListView(int ix);
+    /** @brief Sets the list of effects according to the clip's effect list. */
+    void setupListView();
     
     /** @brief Build the drag info and start it. */
     void startDrag();
 
 public slots:
     /** @brief Sets the clip whose effect list should be managed.
-    * @param c Clip whose effect list should be managed
-    * @param ix Effect to preselect */
-    void slotClipItemSelected(ClipItem* c, int ix);
+    * @param c Clip whose effect list should be managed */
+    void slotClipItemSelected(ClipItem* c);
 
     void slotTrackItemSelected(int ix, const TrackInfo info);
    
@@ -143,13 +141,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);
     
index 903cb09e624d0101daafde3d103a3abb21f3f2a5..b16cafd6d6e4891ba21e71bf38a77abb825b8fb4 100644 (file)
@@ -644,7 +644,7 @@ MainWindow::~MainWindow()
     if (m_stopmotion) {
         delete m_stopmotion;
     }
-    m_effectStack->slotClipItemSelected(NULL, 0);
+    m_effectStack->slotClipItemSelected(NULL);
     m_transitionConfig->slotTransitionItemSelected(NULL, 0, QPoint(), false);
 
     if (m_projectMonitor) m_projectMonitor->stop();
@@ -2329,7 +2329,7 @@ void MainWindow::slotUpdateProjectProfile(const QString &profile)
     }
 
     // Deselect current effect / transition
-    m_effectStack->slotClipItemSelected(NULL, 0);
+    m_effectStack->slotClipItemSelected(NULL);
     m_transitionConfig->slotTransitionItemSelected(NULL, 0, QPoint(), false);
     m_clipMonitor->slotSetClipProducer(NULL);
     bool updateFps = m_activeDocument->setProfilePath(profile);
@@ -2469,12 +2469,9 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             disconnect(m_activeDocument, SIGNAL(signalDeleteProjectClip(const QString &)), this, SLOT(slotDeleteClip(const QString &)));
             disconnect(m_activeDocument, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &)));
             disconnect(m_activeDocument, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &)));
-            disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_effectStack, SLOT(slotClipItemSelected(ClipItem*, int)));
-            disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), this, SLOT(slotActivateEffectStackView(ClipItem*, int, bool)));
-            disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_projectMonitor, SLOT(slotSetSelectedClip(ClipItem*)));
+            disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, bool)), this, SLOT(slotTimelineClipSelected(ClipItem*, bool)));
             disconnect(m_activeTimeline->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), m_transitionConfig, SLOT(slotTransitionItemSelected(Transition*, int, QPoint, bool)));
             disconnect(m_activeTimeline->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), this, SLOT(slotActivateTransitionView(Transition *)));
-            disconnect(m_activeTimeline->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), m_projectMonitor, SLOT(slotSetSelectedClip(Transition*)));
             disconnect(m_activeTimeline->projectView(), SIGNAL(playMonitor()), m_projectMonitor, SLOT(slotPlay()));
             disconnect(m_activeTimeline->projectView(), SIGNAL(displayMessage(const QString&, MessageType)), m_messageLabel, SLOT(setMessage(const QString&, MessageType)));
             disconnect(m_activeTimeline->projectView(), SIGNAL(showClipFrame(DocClipBase *, QPoint, bool, const int)), m_clipMonitor, SLOT(slotSetClipProducer(DocClipBase *, QPoint, bool, const int)));
@@ -2538,12 +2535,10 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
 
     connect(m_notesWidget, SIGNAL(textChanged()), doc, SLOT(setModified()));
 
-    connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_effectStack, SLOT(slotClipItemSelected(ClipItem*, int)));
     connect(trackView->projectView(), SIGNAL(updateClipMarkers(DocClipBase *)), this, SLOT(slotUpdateClipMarkers(DocClipBase*)));
-    connect(trackView, SIGNAL(showTrackEffects(int, TrackInfo)), m_effectStack, SLOT(slotTrackItemSelected(int, TrackInfo)));
-    connect(trackView, SIGNAL(showTrackEffects(int, TrackInfo)), this, SLOT(slotActivateEffectStackView()));
+    connect(trackView, SIGNAL(showTrackEffects(int, TrackInfo)), this, SLOT(slotTrackSelected(int, TrackInfo)));
 
-    connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), this, SLOT(slotActivateEffectStackView(ClipItem*, int, bool)));
+    connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, bool)), this, SLOT(slotTimelineClipSelected(ClipItem*, bool)));
     connect(trackView->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), m_transitionConfig, SLOT(slotTransitionItemSelected(Transition*, int, QPoint, bool)));
     connect(trackView->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), this, SLOT(slotActivateTransitionView(Transition *)));
     m_zoomSlider->setValue(doc->zoom().x());
@@ -2555,7 +2550,6 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     connect(trackView->projectView(), SIGNAL(showClipFrame(DocClipBase *, QPoint, bool, const int)), m_clipMonitor, SLOT(slotSetClipProducer(DocClipBase *, QPoint, bool, const int)));
     connect(trackView->projectView(), SIGNAL(playMonitor()), m_projectMonitor, SLOT(slotPlay()));
 
-    connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_projectMonitor, SLOT(slotSetSelectedClip(ClipItem*)));
     connect(trackView->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), m_projectMonitor, SLOT(slotSetSelectedClip(Transition*)));
 
     connect(m_projectList, SIGNAL(gotFilterJobResults(const QString &, int, int, const QString &, stringMap)), trackView->projectView(), SLOT(slotGotFilterJobResults(const QString &, int, int, const QString &, stringMap)));
@@ -3312,11 +3306,18 @@ void MainWindow::customEvent(QEvent* e)
     if (e->type() == QEvent::User)
         m_messageLabel->setMessage(static_cast <MltErrorEvent *>(e)->message(), MltError);
 }
-void MainWindow::slotActivateEffectStackView(ClipItem* item, int ix, bool raise)
+
+void MainWindow::slotTimelineClipSelected(ClipItem* item, bool raise)
 {
-    Q_UNUSED(item)
-    Q_UNUSED(ix)
+    m_effectStack->slotClipItemSelected(item);
+    m_projectMonitor->slotSetSelectedClip(item);
+    if (raise)
+        m_effectStack->raiseWindow(m_effectStackDock);
+}
 
+void MainWindow::slotTrackSelected(int index, TrackInfo info, bool raise)
+{
+    m_effectStack->slotTrackItemSelected(index, info);
     if (raise)
         m_effectStack->raiseWindow(m_effectStackDock);
 }
index 4b5851367e4cf9af8cd0b414a6869fac76a10e45..c54a2325de4dc1c564e9d21886ef88a00d16f812 100644 (file)
@@ -422,7 +422,8 @@ private slots:
     void slotAddProjectClipList(KUrl::List urls);
     void slotShowClipProperties(DocClipBase *clip);
     void slotShowClipProperties(QList <DocClipBase *>cliplist, QMap<QString, QString> commonproperties);
-    void slotActivateEffectStackView(ClipItem* item = NULL, int ix = -1, bool raise = true);
+    void slotTimelineClipSelected(ClipItem* item, bool raise = true);
+    void slotTrackSelected(int index, TrackInfo info, bool raise = true);
     void slotActivateTransitionView(Transition *);
     void slotChangeTool(QAction * action);
     void slotChangeEdit(QAction * action);