#include "docclipbase.h"
#include "projectlist.h"
#include "kthumb.h"
+#include "monitoreditwidget.h"
#include "monitorscene.h"
#include "kdenlivesettings.h"
m_ui.buttonReset->setIcon(KIcon("view-refresh"));
m_ui.buttonReset->setToolTip(i18n("Reset effect"));
m_ui.checkAll->setToolTip(i18n("Enable/Disable all effects"));
+ m_ui.buttonShowComments->setIcon(KIcon("help-about"));
+ m_ui.buttonShowComments->setToolTip(i18n("Show additional information for the parameters"));
m_ui.effectlist->setDragDropMode(QAbstractItemView::NoDragDrop); //use internal if drop is recognised right
+ m_ui.labelComment->setHidden(true);
+
//connect(m_ui.region_url, SIGNAL(urlSelected(const KUrl &)), this , SLOT(slotRegionChanged()));
//connect(m_ui.region_url, SIGNAL(returnPressed()), this , SLOT(slotRegionChanged()));
connect(m_ui.effectlist, SIGNAL(itemSelectionChanged()), this , SLOT(slotItemSelectionChanged()));
connect(m_ui.buttonSave, SIGNAL(clicked()), this, SLOT(slotSaveEffect()));
connect(m_ui.buttonReset, SIGNAL(clicked()), this, SLOT(slotResetEffect()));
connect(m_ui.checkAll, SIGNAL(stateChanged(int)), this, SLOT(slotCheckAll(int)));
+ connect(m_ui.buttonShowComments, SIGNAL(clicked()), this, SLOT(slotShowComments()));
connect(m_effectedit, SIGNAL(parameterChanged(const QDomElement, const QDomElement)), this , SLOT(slotUpdateEffectParams(const QDomElement, const QDomElement)));
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)));
+ connect(this, SIGNAL(showComments(bool)), m_effectedit, SIGNAL(showComments(bool)));
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);
-
setEnabled(false);
}
double factor = c->baseClip()->getProperty("aspect_ratio").toDouble();
QPoint p((int)(size.section('x', 0, 0).toInt() * factor + 0.5), size.section('x', 1, 1).toInt());
m_effectedit->setFrameSize(p);
- m_effectedit->setFrameSize(p);
- } else ix = 0;
+ } else {
+ ix = 0;
+ }
}
if (m_clipref == NULL) {
m_ui.effectlist->blockSignals(true);
m_ui.effectlist->blockSignals(false);
m_ui.checkAll->setToolTip(QString());
m_ui.checkAll->setText(QString());
+ m_ui.labelComment->setText(QString());
setEnabled(false);
return;
}
m_trackMode = false;
m_currentEffectList = m_clipref->effectList();
setupListView(ix);
-
- slotUpdateComment();
}
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);
- slotUpdateComment();
}
void EffectStackView::slotItemChanged(QListWidgetItem *item)
m_ui.buttonUp->setEnabled(false);
m_ui.buttonDown->setEnabled(false);
m_ui.checkAll->setEnabled(false);
+ m_ui.buttonShowComments->setEnabled(false);
+ m_ui.labelComment->setHidden(true);
} else {
- qMin(ix, 0);
- qMax(ix, m_ui.effectlist->count() - 1);
+ ix = qBound(0, ix, m_ui.effectlist->count() - 1);
m_ui.effectlist->setCurrentRow(ix);
m_ui.checkAll->setEnabled(true);
}
int activeRow = m_ui.effectlist->currentRow();
bool isChecked = false;
if (hasItem && m_ui.effectlist->currentItem()->checkState() == Qt::Checked) isChecked = true;
+ QDomElement eff;
if (hasItem && m_ui.effectlist->currentItem()->isSelected()) {
- QDomElement eff = m_currentEffectList.at(activeRow);
+ eff = m_currentEffectList.at(activeRow);
if (m_trackMode) {
// showing track effects
m_effectedit->transferParamDesc(eff, 0, 0, m_trackInfo.duration);
m_clipref->cropStart().frames(KdenliveSettings::project_fps()),
(m_clipref->cropStart() + m_clipref->cropDuration()).frames(KdenliveSettings::project_fps()) - 1); //minx max frame
//m_ui.region_url->setUrl(KUrl(eff.attribute("region")));
+ m_ui.labelComment->setText(i18n(eff.firstChildElement("description").firstChildElement("full").text().toUtf8().data()));
}
if (!m_trackMode && m_clipref && update) m_clipref->setSelectedEffect(activeRow);
m_ui.buttonDel->setEnabled(hasItem);
m_ui.buttonUp->setEnabled(activeRow > 0);
m_ui.buttonDown->setEnabled((activeRow < m_ui.effectlist->count() - 1) && hasItem);
m_ui.frame->setEnabled(isChecked);
- slotUpdateComment();
+ m_ui.buttonShowComments->setEnabled(hasItem);
+
+ emit showComments(m_ui.buttonShowComments->isChecked());
+ m_ui.labelComment->setVisible(hasItem && m_ui.labelComment->text().count() && (m_ui.buttonShowComments->isChecked() || !eff.elementsByTagName("parameter").count()));
}
void EffectStackView::slotItemUp()
emit updateEffect(m_clipref, -1, old, dom, activeRow);
}
}
+
+ emit showComments(m_ui.buttonShowComments->isChecked());
+ m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || !m_ui.labelComment->text().count());
}
m_ui.checkAll->setEnabled(false);
m_effectedit->transferParamDesc(QDomElement(), 0, 0, 0);
//m_ui.region_url->clear();
+ m_ui.buttonShowComments->setEnabled(false);
+ m_ui.labelComment->setText(QString());
m_ui.effectlist->blockSignals(false);
}
void EffectStackView::slotCheckMonitorPosition(int renderPos)
{
if (m_trackMode || (renderPos >= m_clipref->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_clipref->endPos().frames(KdenliveSettings::project_fps()))) {
- if (!m_monitor->getEffectScene()->views().at(0)->isVisible())
+ if (!m_monitor->getEffectEdit()->getScene()->views().at(0)->isVisible())
m_monitor->slotEffectScene(true);
} else {
m_monitor->slotEffectScene(false);
return m_trackindex;
}
-void EffectStackView::slotUpdateComment(const QString& comment)
+void EffectStackView::slotShowComments()
{
- 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());
+ m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || !m_ui.labelComment->text().count());
+ emit showComments(m_ui.buttonShowComments->isChecked());
}
#include "effectstackview.moc"