]> git.sesse.net Git - kdenlive/commitdiff
Pre-select the first parameter on effects with not other parameter selected to be...
authorTill Theato <root@ttill.de>
Sun, 7 Nov 2010 20:09:39 +0000 (20:09 +0000)
committerTill Theato <root@ttill.de>
Sun, 7 Nov 2010 20:09:39 +0000 (20:09 +0000)
svn path=/trunk/kdenlive/; revision=5082

src/effectstackedit.cpp
src/keyframeedit.cpp
src/keyframeedit.h

index b8d69b8b02f035d59db9926db55bb6b7f6bf030b..f628408d2c2c41cdb73b32696024913708204cd3 100644 (file)
@@ -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)
index c65c6c31475639156814c1c917d351f30623f11b..b5838df4336a059cd4c4a64b8f97d4f3a04782c6 100644 (file)
@@ -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<QRadioButton*>(m_slidersLayout->itemAtPosition(0, 1)->widget());
+    if (radio)
+        radio->setChecked(true);
+}
+
 #include "keyframeedit.moc"
index 23115b36b090a202d335767a617c77cbe8f9af82..7594c44f57be6942ed90a493a3f04813f1eb8861 100644 (file)
@@ -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 <QDomElement> m_params;
     int m_min;