From: Till Theato Date: Sun, 24 Oct 2010 11:52:08 +0000 (+0000) Subject: Allow resetting all parameters of the selected keyframe at once X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e28f5b6f4ee21316c3b077c8c5149d4222404768;p=kdenlive Allow resetting all parameters of the selected keyframe at once svn path=/trunk/kdenlive/; revision=5042 --- diff --git a/src/doubleparameterwidget.cpp b/src/doubleparameterwidget.cpp index f876c07c..2181bd84 100644 --- a/src/doubleparameterwidget.cpp +++ b/src/doubleparameterwidget.cpp @@ -90,7 +90,7 @@ void DoubleParameterWidget::setName(const QString& name) void DoubleParameterWidget::slotReset() { - m_spinBox->setValue(m_default); + setValue(m_default); } #include "doubleparameterwidget.moc" diff --git a/src/doubleparameterwidget.h b/src/doubleparameterwidget.h index 23e757c8..87c30b66 100644 --- a/src/doubleparameterwidget.h +++ b/src/doubleparameterwidget.h @@ -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(); diff --git a/src/keyframeedit.cpp b/src/keyframeedit.cpp index 19dbcdd1..c41457a8 100644 --- a/src/keyframeedit.cpp +++ b/src/keyframeedit.cpp @@ -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(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)); diff --git a/src/keyframeedit.h b/src/keyframeedit.h index 4d3e5747..4df839d0 100644 --- a/src/keyframeedit.h +++ b/src/keyframeedit.h @@ -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: diff --git a/src/widgets/keyframeeditor_ui.ui b/src/widgets/keyframeeditor_ui.ui index eeb4f323..f8d5d4ee 100644 --- a/src/widgets/keyframeeditor_ui.ui +++ b/src/widgets/keyframeeditor_ui.ui @@ -40,7 +40,7 @@ 0 - + true @@ -72,7 +72,7 @@ - + Seek to active keyframe @@ -86,7 +86,7 @@ - + Qt::Horizontal @@ -103,6 +103,16 @@ + + + + Reset the parameters to their default values + + + ... + + +