X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fkeyframeedit.cpp;h=8266ae5161d21f5b32b271956df7fa94977de98e;hb=7fa20375644d189157bc2235091ceca505325f66;hp=6085a27f554bae1da7c11b6e343b88fedf055a76;hpb=8bd6cc04a55e118845505516b41bd960629048ab;p=kdenlive diff --git a/src/keyframeedit.cpp b/src/keyframeedit.cpp index 6085a27f..8266ae51 100644 --- a/src/keyframeedit.cpp +++ b/src/keyframeedit.cpp @@ -100,16 +100,23 @@ void KeyframeEdit::addParameter(QDomElement e, int activeKeyframe) { keyframe_list->blockSignals(true); m_params.append(e.cloneNode().toElement()); + QDomNode na = e.firstChildElement("name"); QString paramName = i18n(na.toElement().text().toUtf8().data()); + QDomNode commentNode = e.firstChildElement("comment"); + QString comment; + if (!commentNode.isNull()) + comment = i18n(commentNode.toElement().text().toUtf8().data()); + int columnId = keyframe_list->columnCount(); keyframe_list->insertColumn(columnId); keyframe_list->setHorizontalHeaderItem(columnId, new QTableWidgetItem(paramName)); DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, 0, m_params.at(columnId).attribute("min").toInt(), m_params.at(columnId).attribute("max").toInt(), - m_params.at(columnId).attribute("default").toInt(), m_params.at(columnId).attribute("suffix"), this); + m_params.at(columnId).attribute("default").toInt(), comment, m_params.at(columnId).attribute("suffix"), this); connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframeValue(int))); + connect(doubleparam, SIGNAL(showComment(const QString&)), this, SIGNAL(showComment(const QString&))); m_slidersLayout->addWidget(doubleparam, columnId, 0); QRadioButton *radio = new QRadioButton(this); @@ -161,7 +168,12 @@ void KeyframeEdit::slotDeleteKeyframe() keyframe_list->setCurrentCell(row, col); keyframe_list->selectRow(row); generateAllParams(); - button_delete->setEnabled(keyframe_list->rowCount() > 1); + + bool disable = keyframe_list->rowCount() < 2; + button_delete->setEnabled(!disable); + disable &= getPos(0) == m_min; + widgetTable->setHidden(disable); + buttonKeyframes->setHidden(!disable); } void KeyframeEdit::slotAddKeyframe()