From 0c566f1bf663a28f62aa7bddcfef6cd1d33b7d04 Mon Sep 17 00:00:00 2001 From: Till Theato Date: Sun, 7 Nov 2010 20:09:39 +0000 Subject: [PATCH] Pre-select the first parameter on effects with not other parameter selected to be shown in the timeline svn path=/trunk/kdenlive/; revision=5082 --- src/effectstackedit.cpp | 3 +++ src/keyframeedit.cpp | 16 ++++++++++++++++ src/keyframeedit.h | 3 +++ 3 files changed, 22 insertions(+) diff --git a/src/effectstackedit.cpp b/src/effectstackedit.cpp index b8d69b8b..f628408d 100644 --- a/src/effectstackedit.cpp +++ b/src/effectstackedit.cpp @@ -447,6 +447,9 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in m_vbox->addWidget(toFillin); } m_vbox->addStretch(); + + if(m_keyframeEditor) + m_keyframeEditor->checkVisibleParam(); } wipeInfo EffectStackEdit::getWipeInfo(QString value) diff --git a/src/keyframeedit.cpp b/src/keyframeedit.cpp index c65c6c31..b5838df4 100644 --- a/src/keyframeedit.cpp +++ b/src/keyframeedit.cpp @@ -426,4 +426,20 @@ bool KeyframeEdit::isVisibleParam(const QString& name) return false; } +void KeyframeEdit::checkVisibleParam() +{ + if (m_params.count() == 0) + return; + + foreach(QDomElement elem, m_params) { + if (elem.attribute("intimeline") == "1") + return; + } + + slotUpdateVisibleParameter(0); + QRadioButton *radio = static_cast(m_slidersLayout->itemAtPosition(0, 1)->widget()); + if (radio) + radio->setChecked(true); +} + #include "keyframeedit.moc" diff --git a/src/keyframeedit.h b/src/keyframeedit.h index 23115b36..7594c44f 100644 --- a/src/keyframeedit.h +++ b/src/keyframeedit.h @@ -90,6 +90,9 @@ public: /** @brief Returns true if the parameter @param name should be shown on the clip in timeline. */ bool isVisibleParam(const QString &name); + /** @brief Makes the first parameter visible in timeline if no parameter is selected. */ + void checkVisibleParam(); + private: QList m_params; int m_min; -- 2.39.2