]> git.sesse.net Git - kdenlive/commitdiff
Allow resetting all parameters of the selected keyframe at once
authorTill Theato <root@ttill.de>
Sun, 24 Oct 2010 11:52:08 +0000 (11:52 +0000)
committerTill Theato <root@ttill.de>
Sun, 24 Oct 2010 11:52:08 +0000 (11:52 +0000)
svn path=/trunk/kdenlive/; revision=5042

src/doubleparameterwidget.cpp
src/doubleparameterwidget.h
src/keyframeedit.cpp
src/keyframeedit.h
src/widgets/keyframeeditor_ui.ui

index f876c07cb54e4f758f761992d4d9d9a046a17202..2181bd8421ad64e890475a63deaae2dcc85544f5 100644 (file)
@@ -90,7 +90,7 @@ void DoubleParameterWidget::setName(const QString& name)
 
 void DoubleParameterWidget::slotReset()
 {
-    m_spinBox->setValue(m_default);
+    setValue(m_default);
 }
 
 #include "doubleparameterwidget.moc"
index 23e757c8a0cb3028317291157f7c5f05aca5ddaa..87c30b668857f40149c3859a54c26d7ab02590dc 100644 (file)
@@ -57,7 +57,6 @@ public slots:
     /** @brief Sets the value to @param value. */
     void setValue(int value);
 
-private slots:
     /** @brief Sets value to m_default. */
     void slotReset();
 
index 19dbcdd154fbd63cb460a30bee31a66d7db416bc..c41457a80156938d44c352fff07658433004281d 100644 (file)
@@ -53,6 +53,7 @@ KeyframeEdit::KeyframeEdit(QDomElement e, int minFrame, int maxFrame, int minVal
     button_add->setToolTip(i18n("Add keyframe"));
     button_delete->setIcon(KIcon("list-remove"));
     button_delete->setToolTip(i18n("Delete keyframe"));
+    buttonResetKeyframe->setIcon(KIcon("edit-undo"));
     connect(keyframe_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotAdjustKeyframeInfo()));
     connect(keyframe_list, SIGNAL(cellChanged(int, int)), this, SLOT(slotGenerateParams(int, int)));
     setupParam();
@@ -63,6 +64,7 @@ KeyframeEdit::KeyframeEdit(QDomElement e, int minFrame, int maxFrame, int minVal
     connect(button_delete, SIGNAL(clicked()), this, SLOT(slotDeleteKeyframe()));
     connect(button_add, SIGNAL(clicked()), this, SLOT(slotAddKeyframe()));
     connect(buttonKeyframes, SIGNAL(clicked()), this, SLOT(slotKeyframeMode()));
+    connect(buttonResetKeyframe, SIGNAL(clicked()), this, SLOT(slotResetKeyframe()));
     //connect(keyframe_list, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(slotSaveCurrentParam(QTreeWidgetItem *, int)));
     connect(keyframe_pos, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframePos(int)));
     //connect(keyframe_val, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframeValue(int)));
@@ -432,6 +434,16 @@ void KeyframeEdit::slotKeyframeMode()
     slotAddKeyframe();
 }
 
+void KeyframeEdit::slotResetKeyframe()
+{
+    for (int col = 0; col < keyframe_list->columnCount(); ++col) {
+        DoubleParameterWidget *doubleparam = qobject_cast<DoubleParameterWidget*>(m_slidersLayout->itemAtPosition(col, 0)->widget());
+        if (doubleparam)
+            doubleparam->slotReset();
+    }
+}
+
+
 /*void KeyframeEdit::slotSaveCurrentParam(QTreeWidgetItem *item, int column)
 {
     if (item && column == 0) m_previousPos = m_timecode.getFrameCount(item->text(0));
index 4d3e5747da17af75d83d0ee109a4783e2c0563f2..4df839d060ca785a0b2aa67baae8b67f19a49b54 100644 (file)
@@ -120,6 +120,10 @@ private slots:
 
     /** @brief Shows the keyframe table and adds a second keyframe. */
     void slotKeyframeMode();
+
+    /** @brief Resets all parameters of the selected keyframe to their default values. */
+    void slotResetKeyframe();
+
     //void slotSaveCurrentParam(QTreeWidgetItem *item, int column);
 
 signals:
index eeb4f323095dfef4118fc61edae02f147f5809a7..f8d5d4ee5c2a4be216b9a8c12893aa7184908f18 100644 (file)
@@ -40,7 +40,7 @@
       <property name="margin">
        <number>0</number>
       </property>
-      <item row="3" column="0" colspan="3">
+      <item row="3" column="0" colspan="4">
        <widget class="QTableWidget" name="keyframe_list">
         <property name="alternatingRowColors">
          <bool>true</bool>
@@ -72,7 +72,7 @@
         </property>
        </widget>
       </item>
-      <item row="4" column="2">
+      <item row="4" column="3">
        <widget class="QCheckBox" name="keyframe_seek">
         <property name="text">
          <string>Seek to active keyframe</string>
@@ -86,7 +86,7 @@
         </property>
        </widget>
       </item>
-      <item row="5" column="2">
+      <item row="5" column="2" colspan="2">
        <widget class="QSlider" name="keyframe_pos">
         <property name="orientation">
          <enum>Qt::Horizontal</enum>
         </property>
        </widget>
       </item>
+      <item row="4" column="2">
+       <widget class="QToolButton" name="buttonResetKeyframe">
+        <property name="toolTip">
+         <string>Reset the parameters to their default values</string>
+        </property>
+        <property name="text">
+         <string>...</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>