CollapsibleEffect::CollapsibleEffect(const QDomElement &effect, const QDomElement &original_effect, const ItemInfo &info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent) :
CollapsibleEffect::CollapsibleEffect(const QDomElement &effect, const QDomElement &original_effect, const ItemInfo &info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent) :
- AbstractCollapsibleWidget(parent),
- m_paramWidget(NULL),
- m_effect(effect),
- m_original_effect(original_effect),
- m_lastEffect(lastEffect),
- m_regionEffect(false)
+ AbstractCollapsibleWidget(parent),
+ m_paramWidget(NULL),
+ m_effect(effect),
+ m_original_effect(original_effect),
+ m_lastEffect(lastEffect),
+ m_regionEffect(false)
- if (m_info.groupIndex == -1) m_menu->addAction(m_groupAction);
- m_menu->addAction(KIcon("folder-new"), i18n("Create Region"), this, SLOT(slotCreateRegion()));
+ if (m_info.groupIndex == -1) m_menu->addAction(m_groupAction);
+ m_menu->addAction(KIcon("folder-new"), i18n("Create Region"), this, SLOT(slotCreateRegion()));
- frame->setProperty("mouseover", true);
- frame->setStyleSheet(frame->styleSheet());
- return QWidget::eventFilter(o, e);
+ frame->setProperty("mouseover", true);
+ frame->setStyleSheet(frame->styleSheet());
+ return QWidget::eventFilter(o, e);
- QWheelEvent *we = static_cast<QWheelEvent *>(e);
- if (!filterWheelEvent || we->modifiers() != Qt::NoModifier) {
- e->accept();
- return false;
- }
- if (qobject_cast<QAbstractSpinBox*>(o)) {
- if(qobject_cast<QAbstractSpinBox*>(o)->focusPolicy() == Qt::WheelFocus)
- {
- e->accept();
- return false;
- }
- else
- {
- e->ignore();
- return true;
- }
- }
- if (qobject_cast<KComboBox*>(o)) {
- if(qobject_cast<KComboBox*>(o)->focusPolicy() == Qt::WheelFocus)
- {
- e->accept();
- return false;
- }
- else
- {
- e->ignore();
- return true;
- }
- }
- if (qobject_cast<QProgressBar*>(o)) {
- if(qobject_cast<QProgressBar*>(o)->focusPolicy() == Qt::WheelFocus)
- {
- e->accept();
- return false;
- }
- else
- {
- e->ignore();
- return true;
- }
- }
+ QWheelEvent *we = static_cast<QWheelEvent *>(e);
+ if (!filterWheelEvent || we->modifiers() != Qt::NoModifier) {
+ e->accept();
+ return false;
+ }
+ if (qobject_cast<QAbstractSpinBox*>(o)) {
+ if(qobject_cast<QAbstractSpinBox*>(o)->focusPolicy() == Qt::WheelFocus)
+ {
+ e->accept();
+ return false;
+ }
+ else
+ {
+ e->ignore();
+ return true;
+ }
+ }
+ if (qobject_cast<KComboBox*>(o)) {
+ if(qobject_cast<KComboBox*>(o)->focusPolicy() == Qt::WheelFocus)
+ {
+ e->accept();
+ return false;
+ }
+ else
+ {
+ e->ignore();
+ return true;
+ }
+ }
+ if (qobject_cast<QProgressBar*>(o)) {
+ if(qobject_cast<QProgressBar*>(o)->focusPolicy() == Qt::WheelFocus)
+ {
+ e->accept();
+ return false;
+ }
+ else
+ {
+ e->ignore();
+ return true;
+ }
+ }
- m_effect.setAttribute("kdenlive_info", info);
- emit parameterChanged(m_original_effect, m_effect, effectIndex());
+ m_effect.setAttribute("kdenlive_info", info);
+ emit parameterChanged(m_original_effect, m_effect, effectIndex());
for (int i = 0; i < effects.count(); ++i) {
CollapsibleEffect *coll = new CollapsibleEffect(effects.at(i).toElement(), origin_effects.at(i).toElement(), info, metaInfo, container);
m_subParamWidgets.append(coll);
for (int i = 0; i < effects.count(); ++i) {
CollapsibleEffect *coll = new CollapsibleEffect(effects.at(i).toElement(), origin_effects.at(i).toElement(), info, metaInfo, container);
m_subParamWidgets.append(coll);
- connect(coll, SIGNAL(parameterChanged(QDomElement,QDomElement,int)), this , SLOT(slotUpdateRegionEffectParams(QDomElement,QDomElement,int)));
+ connect(coll, SIGNAL(parameterChanged(QDomElement,QDomElement,int)), this , SLOT(slotUpdateRegionEffectParams(QDomElement,QDomElement,int)));
//container = new QWidget(widgetFrame);
vbox->addWidget(coll);
//p = new ParameterContainer(effects.at(i).toElement(), info, isEffect, container);
//container = new QWidget(widgetFrame);
vbox->addWidget(coll);
//p = new ParameterContainer(effects.at(i).toElement(), info, isEffect, container);
if (m_effect.firstChildElement("parameter").isNull()) {
// Effect has no parameter, don't allow expand
collapseButton->setEnabled(false);
if (m_effect.firstChildElement("parameter").isNull()) {
// Effect has no parameter, don't allow expand
collapseButton->setEnabled(false);
}
connect (m_paramWidget, SIGNAL(parameterChanged(QDomElement,QDomElement,int)), this, SIGNAL(parameterChanged(QDomElement,QDomElement,int)));
}
connect (m_paramWidget, SIGNAL(parameterChanged(QDomElement,QDomElement,int)), this, SIGNAL(parameterChanged(QDomElement,QDomElement,int)));
- frame->setProperty("target", true);
- frame->setStyleSheet(frame->styleSheet());
- event->acceptProposedAction();
+ frame->setProperty("target", true);
+ frame->setStyleSheet(frame->styleSheet());
+ event->acceptProposedAction();
int ix = e.attribute("kdenlive_ix").toInt();
int currentEffectIx = effectIndex();
if (ix == currentEffectIx) {
int ix = e.attribute("kdenlive_ix").toInt();
int currentEffectIx = effectIndex();
if (ix == currentEffectIx) {
- if (e.tagName() == "effectgroup") {
- // moving a group
- QDomNodeList subeffects = e.elementsByTagName("effect");
- if (subeffects.isEmpty()) {
- event->ignore();
- return;
- }
- EffectInfo info;
- info.fromString(subeffects.at(0).toElement().attribute("kdenlive_info"));
- event->setDropAction(Qt::MoveAction);
- event->accept();
- if (info.groupIndex >= 0) {
- // Moving group
- QList <int> effectsIds;
- // Collect moved effects ids
- for (int i = 0; i < subeffects.count(); ++i) {
- QDomElement effect = subeffects.at(i).toElement();
- effectsIds << effect.attribute("kdenlive_ix").toInt();
- }
- emit moveEffect(effectsIds, currentEffectIx, info.groupIndex, info.groupName);
- }
- else {
- // group effect dropped from effect list
- if (m_info.groupIndex > -1) {
- // TODO: Should we merge groups??
-
- }
- emit addEffect(e);
- }
- return;
- }
- // effect dropped from effects list, add it
- e.setAttribute("kdenlive_ix", ix);
- if (m_info.groupIndex > -1) {
- // Dropped on a group
- e.setAttribute("kdenlive_info", m_info.toString());
- }
- event->setDropAction(Qt::CopyAction);
- event->accept();
- emit addEffect(e);
- return;
+ if (e.tagName() == "effectgroup") {
+ // moving a group
+ QDomNodeList subeffects = e.elementsByTagName("effect");
+ if (subeffects.isEmpty()) {
+ event->ignore();
+ return;
+ }
+ EffectInfo info;
+ info.fromString(subeffects.at(0).toElement().attribute("kdenlive_info"));
+ event->setDropAction(Qt::MoveAction);
+ event->accept();
+ if (info.groupIndex >= 0) {
+ // Moving group
+ QList <int> effectsIds;
+ // Collect moved effects ids
+ for (int i = 0; i < subeffects.count(); ++i) {
+ QDomElement effect = subeffects.at(i).toElement();
+ effectsIds << effect.attribute("kdenlive_ix").toInt();
+ }
+ emit moveEffect(effectsIds, currentEffectIx, info.groupIndex, info.groupName);
+ }
+ else {
+ // group effect dropped from effect list
+ if (m_info.groupIndex > -1) {
+ // TODO: Should we merge groups??
+
+ }
+ emit addEffect(e);
+ }
+ return;
+ }
+ // effect dropped from effects list, add it
+ e.setAttribute("kdenlive_ix", ix);
+ if (m_info.groupIndex > -1) {
+ // Dropped on a group
+ e.setAttribute("kdenlive_info", m_info.toString());
+ }
+ event->setDropAction(Qt::CopyAction);
+ event->accept();
+ emit addEffect(e);
+ return;
}
emit moveEffect(QList <int> () <<ix, currentEffectIx, m_info.groupIndex, m_info.groupName);
event->setDropAction(Qt::MoveAction);
}
emit moveEffect(QList <int> () <<ix, currentEffectIx, m_info.groupIndex, m_info.groupName);
event->setDropAction(Qt::MoveAction);