http://kdenlive.org/mantis/view.php?id=1939
svn path=/trunk/kdenlive/; revision=5197
DoubleParameterWidget::DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString &comment, const QString suffix, QWidget *parent) :
QWidget(parent),
DoubleParameterWidget::DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString &comment, const QString suffix, QWidget *parent) :
QWidget(parent),
- m_default(defaultValue)
+ m_default(defaultValue),
+ m_comment(comment)
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
reset->setToolTip(i18n("Reset to default value"));
layout->addWidget(reset);
reset->setToolTip(i18n("Reset to default value"));
layout->addWidget(reset);
+ if (m_comment != QString()) {
+ QToolButton *showComment = new QToolButton(this);
+ showComment->setAutoRaise(true);
+ showComment->setIcon(KIcon("help-about"));
+ layout->addWidget(showComment);
+
+ connect(showComment, SIGNAL(clicked(bool)), this, SLOT(slotShowComment()));
+ }
+
connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
connect(m_spinBox, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
connect(reset, SIGNAL(clicked(bool)), this, SLOT(slotReset()));
connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
connect(m_spinBox, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
connect(reset, SIGNAL(clicked(bool)), this, SLOT(slotReset()));
+void DoubleParameterWidget::slotShowComment()
+{
+ emit showComment(m_comment);
+}
+
#include "doubleparameterwidget.moc"
#include "doubleparameterwidget.moc"
* @param suffix (optional) Suffix to display in spinbox
* @param parent (optional) Parent Widget */
DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString &comment, const QString suffix = QString(), QWidget* parent = 0);
* @param suffix (optional) Suffix to display in spinbox
* @param parent (optional) Parent Widget */
DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString &comment, const QString suffix = QString(), QWidget* parent = 0);
/** @brief Updates the label to display @param name. */
void setName(const QString &name);
/** @brief Updates the label to display @param name. */
void setName(const QString &name);
/** @brief Gets the parameter's value. */
int getValue();
/** @brief Gets the parameter's value. */
int getValue();
/** @brief Sets value to m_default. */
void slotReset();
/** @brief Sets value to m_default. */
void slotReset();
+private slots:
+ /** @brief Emits showComment with m_comment. */
+ void slotShowComment();
+
private:
int m_default;
QLabel *m_name;
QSlider *m_slider;
QSpinBox *m_spinBox;
private:
int m_default;
QLabel *m_name;
QSlider *m_slider;
QSpinBox *m_spinBox;
signals:
void valueChanged(int);
signals:
void valueChanged(int);
+ void showComment(const QString&);
m_vbox->addWidget(doubleparam);
m_valueItems[paramName] = doubleparam;
connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
m_vbox->addWidget(doubleparam);
m_valueItems[paramName] = doubleparam;
connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
+ connect(doubleparam, SIGNAL(showComment(const QString&)), this, SIGNAL(showComment(const QString&)));
} else if (type == "list") {
Listval *lsval = new Listval;
lsval->setupUi(toFillin);
} else if (type == "list") {
Listval *lsval = new Listval;
lsval->setupUi(toFillin);
m_keyframeEditor = geo;
connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
m_keyframeEditor = geo;
connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
+ connect(geo, SIGNAL(showComment(const QString&)), this, SIGNAL(showComment(const QString&)));
} else {
// we already have a keyframe editor, so just add another column for the new param
m_keyframeEditor->addParameter(pa);
} else {
// we already have a keyframe editor, so just add another column for the new param
m_keyframeEditor->addParameter(pa);
public slots:
/** @brief Called when an effect is selected, builds the UI for this effect. */
void transferParamDesc(const QDomElement d, int pos, int in, int out, bool isEffect = true);
public slots:
/** @brief Called when an effect is selected, builds the UI for this effect. */
void transferParamDesc(const QDomElement d, int pos, int in, int out, bool isEffect = true);
/** @brief Called whenever(?) some parameter is changed in the gui.
*
* Transfers all Dynamic gui parameter settings into m_params(??) */
void collectAllParameters();
/** @brief Called whenever(?) some parameter is changed in the gui.
*
* Transfers all Dynamic gui parameter settings into m_params(??) */
void collectAllParameters();
/** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
void slotSyncEffectsPos(int pos);
/** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
void slotSyncEffectsPos(int pos);
void displayMessage(const QString&, int);
void checkMonitorPosition(int);
void syncEffectsPos(int pos);
void displayMessage(const QString&, int);
void checkMonitorPosition(int);
void syncEffectsPos(int pos);
+ void showComment(const QString&);
vbox1->setContentsMargins(0, 0, 0, 0);
vbox1->setSpacing(0);
vbox1->addWidget(m_effectedit);
vbox1->setContentsMargins(0, 0, 0, 0);
vbox1->setSpacing(0);
vbox1->addWidget(m_effectedit);
- m_ui.frame->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
//m_ui.region_url->fileDialog()->setFilter(ProjectList::getExtensions());
//m_ui.effectlist->horizontalHeader()->setVisible(false);
//m_ui.effectlist->verticalHeader()->setVisible(false);
//m_ui.region_url->fileDialog()->setFilter(ProjectList::getExtensions());
//m_ui.effectlist->horizontalHeader()->setVisible(false);
//m_ui.effectlist->verticalHeader()->setVisible(false);
m_ui.buttonReset->setToolTip(i18n("Reset effect"));
m_ui.checkAll->setToolTip(i18n("Enable/Disable all effects"));
m_ui.buttonReset->setToolTip(i18n("Reset effect"));
m_ui.checkAll->setToolTip(i18n("Enable/Disable all effects"));
m_ui.effectlist->setDragDropMode(QAbstractItemView::NoDragDrop); //use internal if drop is recognised right
//connect(m_ui.region_url, SIGNAL(urlSelected(const KUrl &)), this , SLOT(slotRegionChanged()));
m_ui.effectlist->setDragDropMode(QAbstractItemView::NoDragDrop); //use internal if drop is recognised right
//connect(m_ui.region_url, SIGNAL(urlSelected(const KUrl &)), this , SLOT(slotRegionChanged()));
connect(m_effectedit, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
connect(m_effectedit, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
connect(m_effectedit, SIGNAL(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
connect(m_effectedit, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
connect(m_effectedit, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
connect(m_effectedit, SIGNAL(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
+ connect(m_effectedit, SIGNAL(showComment(const QString&)), this, SLOT(slotUpdateComment(const QString&)));
connect(monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
m_effectLists["audio"] = &MainWindow::audioEffects;
m_effectLists["video"] = &MainWindow::videoEffects;
m_effectLists["custom"] = &MainWindow::customEffects;
m_ui.splitter->setStretchFactor(1, 10);
m_ui.splitter->setStretchFactor(0, 1);
connect(monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
m_effectLists["audio"] = &MainWindow::audioEffects;
m_effectLists["video"] = &MainWindow::videoEffects;
m_effectLists["custom"] = &MainWindow::customEffects;
m_ui.splitter->setStretchFactor(1, 10);
m_ui.splitter->setStretchFactor(0, 1);
+
+ m_ui.labelComment->setHidden(true);
+
m_trackMode = false;
m_currentEffectList = m_clipref->effectList();
setupListView(ix);
m_trackMode = false;
m_currentEffectList = m_clipref->effectList();
setupListView(ix);
}
void EffectStackView::slotTrackItemSelected(int ix, const TrackInfo info)
}
void EffectStackView::slotTrackItemSelected(int ix, const TrackInfo info)
m_ui.checkAll->setText(i18n("Effects for track %1").arg(info.trackName.isEmpty() ? QString::number(ix) : info.trackName));
m_trackindex = ix;
setupListView(0);
m_ui.checkAll->setText(i18n("Effects for track %1").arg(info.trackName.isEmpty() ? QString::number(ix) : info.trackName));
m_trackindex = ix;
setupListView(0);
}
void EffectStackView::slotItemChanged(QListWidgetItem *item)
{
bool disable = true;
if (item->checkState() == Qt::Checked) disable = false;
}
void EffectStackView::slotItemChanged(QListWidgetItem *item)
{
bool disable = true;
if (item->checkState() == Qt::Checked) disable = false;
- m_ui.frame_layout->setEnabled(!disable);
+ m_ui.frame->setEnabled(!disable);
m_ui.buttonReset->setEnabled(!disable);
int activeRow = m_ui.effectlist->currentRow();
if (activeRow >= 0) {
m_ui.buttonReset->setEnabled(!disable);
int activeRow = m_ui.effectlist->currentRow();
if (activeRow >= 0) {
m_ui.buttonReset->setEnabled(hasItem && isChecked);
m_ui.buttonUp->setEnabled(activeRow > 0);
m_ui.buttonDown->setEnabled((activeRow < m_ui.effectlist->count() - 1) && hasItem);
m_ui.buttonReset->setEnabled(hasItem && isChecked);
m_ui.buttonUp->setEnabled(activeRow > 0);
m_ui.buttonDown->setEnabled((activeRow < m_ui.effectlist->count() - 1) && hasItem);
- m_ui.frame_layout->setEnabled(isChecked);
+ m_ui.frame->setEnabled(isChecked);
+ slotUpdateComment();
}
void EffectStackView::slotItemUp()
}
void EffectStackView::slotItemUp()
{
int activeRow = m_ui.effectlist->currentRow();
if (activeRow >= 0) {
{
int activeRow = m_ui.effectlist->currentRow();
if (activeRow >= 0) {
- if (m_trackMode) emit removeEffect(NULL, m_trackindex, m_currentEffectList.at(activeRow).cloneNode().toElement());
- else emit removeEffect(m_clipref, -1, m_clipref->effectAt(activeRow));
+ if (m_trackMode)
+ emit removeEffect(NULL, m_trackindex, m_currentEffectList.at(activeRow).cloneNode().toElement());
+ else
+ emit removeEffect(m_clipref, -1, m_clipref->effectAt(activeRow));
slotUpdateCheckAllButton();
}
}
slotUpdateCheckAllButton();
}
}
+void EffectStackView::slotUpdateComment(const QString& comment)
+{
+ if (comment == m_ui.labelComment->text())
+ m_ui.labelComment->setText(QString());
+ else
+ m_ui.labelComment->setText(comment);
+
+ m_ui.labelComment->setHidden(m_ui.labelComment->text() == QString());
+}
+
#include "effectstackview.moc"
#include "effectstackview.moc"
/** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
void slotRenderPos(int pos);
/** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
void slotRenderPos(int pos);
+ /** @brief Sets the parameter explaining comment to @param comment. */
+ void slotUpdateComment(const QString &comment = QString());
+
signals:
void removeEffect(ClipItem*, int, QDomElement);
/** Parameters for an effect changed, update the filter in playlist */
signals:
void removeEffect(ClipItem*, int, QDomElement);
/** Parameters for an effect changed, update the filter in playlist */
m_params.at(columnId).attribute("min").toInt(), m_params.at(columnId).attribute("max").toInt(),
m_params.at(columnId).attribute("default").toInt(), comment, m_params.at(columnId).attribute("suffix"), this);
connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframeValue(int)));
m_params.at(columnId).attribute("min").toInt(), m_params.at(columnId).attribute("max").toInt(),
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);
m_slidersLayout->addWidget(doubleparam, columnId, 0);
QRadioButton *radio = new QRadioButton(this);
signals:
void parameterChanged();
void seekToPos(int);
signals:
void parameterChanged();
void seekToPos(int);
+ void showComment(const QString&);
- <width>448</width>
- <height>248</height>
+ <width>451</width>
+ <height>251</height>
</rect>
</property>
<property name="sizePolicy">
</rect>
</property>
<property name="sizePolicy">
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_2">
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_2">
- <layout class="QVBoxLayout" name="frame_layout">
- <item>
+ <layout class="QGridLayout" name="layoutEdit">
+ <item row="0" column="0" colspan="3">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
+ <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="labelComment">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</widget>
</layout>
</widget>
</widget>