e.removeAttribute("kdenlive_ix");
}
CustomTrackView *view = (CustomTrackView *) scene()->views()[0];
- if (view) view->slotAddEffect(e, m_info.startPos, track());
+ if (view) view->slotDropEffect(this, e, m_info.startPos, track());
}
else return;
}
{
QPointF framePos = mapToScene(pos);
int track = framePos.y() / KdenliveSettings::trackheight();
- m_scene->clearSelection();
- m_dragItem = NULL;
- resetSelectionGroup(false);
m_clipDrag = data->hasFormat("kdenlive/clip") || data->hasFormat("kdenlive/producerslist");
// This is not a clip drag, maybe effect or other...
if (!m_clipDrag) return false;
+ m_scene->clearSelection();
+ m_dragItem = NULL;
+ resetSelectionGroup(false);
if (track < 0 || track > m_document->tracksCount() - 1 || m_document->trackInfoAt(m_document->tracksCount() - track - 1).isLocked) return true;
if (data->hasFormat("kdenlive/clip")) {
QStringList list = QString(data->data("kdenlive/clip")).split(';');
if (!m_document->renderer()->mltAddEffect(track, pos, params))
emit displayMessage(i18n("Problem adding effect to clip"), ErrorMessage);
clip->setSelectedEffect(params.paramValue("kdenlive_ix").toInt());
- if (clip->isSelected()) emit clipItemSelected(clip);
+ if (clip->isMainSelectedClip()) emit clipItemSelected(clip);
} else emit displayMessage(i18n("Cannot find clip to add effect"), ErrorMessage);
}
}
ClipItem *clip = getClipItemAt((int)pos.frames(m_document->fps()), m_document->tracksCount() - track);
if (clip) {
- clip->deleteEffect(index);
- emit clipItemSelected(clip);
+ clip->deleteEffect(index);
+ if (clip->isMainSelectedClip()) emit clipItemSelected(clip);
}
}
else effectName = i18n("effect");
effectCommand->setText(i18n("Add %1", effectName));
for (int i = 0; i < itemList.count(); i++) {
+ if (itemList.at(i)->type() == GROUPWIDGET) {
+ itemList << itemList.at(i)->childItems();
+ }
if (itemList.at(i)->type() == AVWIDGET) {
ClipItem *item = static_cast <ClipItem *>(itemList.at(i));
if (effect.tagName() == "effectgroup") {
if (clip) slotAddEffect(effect, clip->startPos(), clip->track());
}
+void CustomTrackView::slotDropEffect(ClipItem *clip, QDomElement effect, GenTime pos, int track)
+{
+ if (clip == NULL) return;
+ slotAddEffect(effect, pos, track);
+ if (clip->parentItem()) {
+ // Clip is in a group, should not happen
+ kDebug()<<"/// DROPPED ON ITEM IN GRP";
+ }
+ else if (clip != m_dragItem) {
+ clearSelection(false);
+ m_dragItem = clip;
+ clip->setSelected(true);
+ emit clipItemSelected(clip);
+ }
+}
+
void CustomTrackView::slotAddEffect(QDomElement effect, GenTime pos, int track)
{
QList<QGraphicsItem *> itemList;
QUndoCommand *effectCommand = new QUndoCommand();
QString effectName;
-
int offset = effect.attribute("clipstart").toInt();
if (effect.tagName() == "effectgroup") {
effectName = effect.attribute("name");
if (effectCommand->childCount() > 0) {
m_commandStack->push(effectCommand);
setDocumentModified();
- if (effectCommand->childCount() == 1) {
+ /*if (effectCommand->childCount() == 1) {
// Display newly added clip effect
for (int i = 0; i < itemList.count(); i++) {
if (itemList.at(i)->type() == AVWIDGET) {
ClipItem *clip = static_cast<ClipItem *>(itemList.at(i));
clip->setSelectedEffect(clip->effectsCount());
- if (!clip->isSelected()) {
+ if (!clip->isSelected() && (!m_dragItem || !itemList.contains(m_dragItem))) {
+ kDebug()<<"// CLIP WAS NO SELECTED, DRG: "<<(m_dragItem == NULL);
clearSelection(false);
clip->setSelected(true);
m_dragItem = clip;
+ emit clipItemSelected(clip);
+ break;
}
- emit clipItemSelected(clip);
- break;
}
}
}
}
}
}
- }
+ }*/
} else delete effectCommand;
}
void addData(const QString &id, const QString &key, const QString &data);
void setScale(double scaleFactor, double verticalScale);
void deleteClip(const QString &clipId);
+ /** @brief An effect was dropped on @param clip */
+ void slotDropEffect(ClipItem *clip, QDomElement effect, GenTime pos, int track);
/** @brief Add effect to current clip */
void slotAddEffect(QDomElement effect, GenTime pos, int track);
void slotAddGroupEffect(QDomElement effect, AbstractGroupItem *group, AbstractClipItem *dropTarget = NULL);
DoubleParameterWidget::DoubleParameterWidget(const QString &name, double value, double min, double max, double defaultValue, const QString &comment, int id, const QString suffix, int decimals, QWidget *parent) :
- QWidget(parent),
- m_commentLabel(NULL)
+ QWidget(parent)
{
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum);
QGridLayout *layout = new QGridLayout(this);
layout->addWidget(m_dragVal, 0, 1);
if (!comment.isEmpty()) {
- m_commentLabel = new QLabel(comment, this);
- m_commentLabel->setWordWrap(true);
- m_commentLabel->setTextFormat(Qt::RichText);
- m_commentLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
- m_commentLabel->setFrameShape(QFrame::StyledPanel);
- m_commentLabel->setFrameShadow(QFrame::Raised);
- m_commentLabel->setHidden(true);
- layout->addWidget(m_commentLabel, 1, 0, 1, -1);
+ setToolTip(comment);
}
m_dragVal->setValue(value, false);
connect(m_dragVal, SIGNAL(valueChanged(double, bool)), this, SLOT(slotSetValue(double, bool)));
DoubleParameterWidget::~DoubleParameterWidget()
{
delete m_dragVal;
- if (m_commentLabel) delete m_commentLabel;
}
int DoubleParameterWidget::spinSize()
void DoubleParameterWidget::slotShowComment( bool show)
{
- if (m_commentLabel) {
- m_commentLabel->setVisible(show);
- if (show)
- layout()->setContentsMargins(0, 0, 0, 15);
- else
- layout()->setContentsMargins(0, 0, 0, 0);
- }
}
#include "doubleparameterwidget.moc"
}
if (!value.isEmpty()) lsval->list->setCurrentIndex(listitems.indexOf(value));
lsval->name->setText(paramName);
+ lsval->setToolTip(comment);
lsval->labelComment->setText(comment);
lsval->widgetComment->setHidden(true);
m_valueItems[paramName] = lsval;
bval->setupUi(toFillin);
bval->checkBox->setCheckState(value == "0" ? Qt::Unchecked : Qt::Checked);
bval->name->setText(paramName);
+ bval->name->setToolTip(comment);
bval->labelComment->setText(comment);
bval->widgetComment->setHidden(true);
m_valueItems[paramName] = bval;
if (value.startsWith('#'))
value = value.replace('#', "0x");
ChooseColorWidget *choosecolor = new ChooseColorWidget(paramName, value, pa.hasAttribute("alpha"), parent);
+ choosecolor->setToolTip(comment);
m_vbox->addWidget(choosecolor);
m_valueItems[paramName] = choosecolor;
connect(choosecolor, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
pos = m_out - pos;
}
PositionEdit *posedit = new PositionEdit(paramName, pos, 0, m_out - m_in, m_metaInfo->timecode);
+ posedit->setToolTip(comment);
connect(this, SIGNAL(updateRange(int,int)), posedit, SLOT(setRange(int,int)));
m_vbox->addWidget(posedit);
m_valueItems[paramName+"position"] = posedit;
Urlval *cval = new Urlval;
cval->setupUi(toFillin);
cval->label->setText(paramName);
+ cval->setToolTip(comment);
cval->urlwidget->fileDialog()->setFilter(ProjectList::getExtensions());
m_valueItems[paramName] = cval;
cval->urlwidget->setUrl(KUrl(value));
kval->setupUi(toFillin);
kval->label->setText(paramName);
kval->lineeditwidget->setText(value);
+ kval->setToolTip(comment);
QDomElement klistelem = pa.firstChildElement("keywords");
QDomElement kdisplaylistelem = pa.firstChildElement("keywordsdisplay");
QStringList keywordlist;
QDomElement pname = ret.createElement("name");
pname.appendChild(ret.createTextNode(paramdesc.get("title")));
params.appendChild(pname);
+
+ if (paramdesc.get("description")) {
+ QDomElement desc = ret.createElement("comment");
+ desc.appendChild(ret.createTextNode(paramdesc.get("description")));
+ params.appendChild(desc);
+ }
eff.appendChild(params);
}