From b48880ff7a120e6cc6a5f5936e44b15a71a46e3b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Mon, 13 Sep 2010 21:35:22 +0000 Subject: [PATCH] Fix add track effect through double click in effects list svn path=/trunk/kdenlive/; revision=4882 --- src/effectstackview.cpp | 6 ++++++ src/effectstackview.h | 4 ++++ src/mainwindow.cpp | 10 +++++++--- src/mainwindow.h | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/effectstackview.cpp b/src/effectstackview.cpp index 855ed3ca..d6d79719 100644 --- a/src/effectstackview.cpp +++ b/src/effectstackview.cpp @@ -471,4 +471,10 @@ void EffectStackView::slotRenderPos(int pos) m_effectedit->slotSyncEffectsPos(pos - m_clipref->startPos().frames(KdenliveSettings::project_fps())); } +int EffectStackView::isTrackMode(bool *ok) const +{ + *ok = m_trackMode; + return m_trackindex; +} + #include "effectstackview.moc" diff --git a/src/effectstackview.h b/src/effectstackview.h index 02229adb..c86b6cfc 100644 --- a/src/effectstackview.h +++ b/src/effectstackview.h @@ -55,6 +55,10 @@ public: /** @brief Tells the effect editor to update its timecode format. */ void updateTimecodeFormat(); + /** @brief return the index of the track displayed in effect stack + ** @param ok set to true if we are looking at a track's effects, otherwise false. */ + int isTrackMode(bool *ok) const; + private: Ui::EffectStack_UI m_ui; Monitor *m_monitor; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4caa2f50..ea648dfb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -726,7 +726,7 @@ void MainWindow::slotFullScreen() KToggleFullScreenAction::setFullScreen(this, actionCollection()->action("fullscreen")->isChecked()); } -void MainWindow::slotAddEffect(const QDomElement effect, GenTime pos, int track) +void MainWindow::slotAddEffect(const QDomElement effect) { if (!m_activeDocument) return; if (effect.isNull()) { @@ -734,7 +734,10 @@ void MainWindow::slotAddEffect(const QDomElement effect, GenTime pos, int track) return; } QDomElement effectToAdd = effect.cloneNode().toElement(); - m_activeTimeline->projectView()->slotAddEffect(effectToAdd, pos, track); + bool ok; + int ix = m_effectStack->isTrackMode(&ok); + if (ok) m_activeTimeline->projectView()->slotAddTrackEffect(effectToAdd, m_activeDocument->tracksCount() - ix); + else m_activeTimeline->projectView()->slotAddEffect(effectToAdd, GenTime(), -1); } void MainWindow::slotRaiseMonitor(bool clipMonitor) @@ -3571,8 +3574,9 @@ void MainWindow::slotChangePalette(QAction *action, const QString &themename) ((QWidget*)subchild)->setPalette(plt); } } - if (m_activeTimeline) + if (m_activeTimeline) { m_activeTimeline->projectView()->updatePalette(); + } } diff --git a/src/mainwindow.h b/src/mainwindow.h index 06902e5d..eee703f2 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -312,7 +312,7 @@ private slots: void slotRaiseMonitor(bool clipMonitor); void slotUpdateClip(const QString &id); void slotUpdateMousePosition(int pos); - void slotAddEffect(const QDomElement effect, GenTime pos = GenTime(), int track = -1); + void slotAddEffect(const QDomElement effect); void slotEditProfiles(); void slotDetectAudioDriver(); void slotEditProjectSettings(); -- 2.39.2