Fix Bin Effect reset

BUG: 376494
parent 0e3f8232
......@@ -2361,11 +2361,11 @@ void Bin::slotEffectDropped(QString id, QDomElement effect)
m_doc->commandStack()->push(command);
}
void Bin::slotUpdateEffect(QString id, QDomElement oldEffect, QDomElement newEffect, int ix)
void Bin::slotUpdateEffect(QString id, QDomElement oldEffect, QDomElement newEffect, int ix, bool refreshStack)
{
if (id.isEmpty()) id = m_monitor->activeClipId();
if (id.isEmpty()) return;
UpdateBinEffectCommand *command = new UpdateBinEffectCommand(this, id, oldEffect, newEffect, ix);
UpdateBinEffectCommand *command = new UpdateBinEffectCommand(this, id, oldEffect, newEffect, ix, refreshStack);
m_doc->commandStack()->push(command);
}
......
......@@ -558,7 +558,7 @@ private slots:
void slotItemDropped(QStringList ids, const QModelIndex &parent);
void slotItemDropped(const QList<QUrl>&urls, const QModelIndex &parent);
void slotEffectDropped(QString effect, const QModelIndex &parent);
void slotUpdateEffect(QString id, QDomElement oldEffect, QDomElement newEffect, int ix);
void slotUpdateEffect(QString id, QDomElement oldEffect, QDomElement newEffect, int ix, bool refreshStack = false);
void slotChangeEffectState(QString id, QList<int> indexes, bool disable);
void slotItemEdited(QModelIndex,QModelIndex,QVector<int>);
void slotAddUrl(QString url, int folderId, QMap <QString, QString> data = QMap <QString, QString>());
......
......@@ -150,14 +150,14 @@ void RemoveBinEffectCommand::redo()
m_bin->removeEffect(m_clipId, m_effect);
}
UpdateBinEffectCommand::UpdateBinEffectCommand(Bin *bin, const QString &clipId, QDomElement &oldEffect, QDomElement &newEffect, int ix, QUndoCommand *parent) :
UpdateBinEffectCommand::UpdateBinEffectCommand(Bin *bin, const QString &clipId, QDomElement &oldEffect, QDomElement &newEffect, int ix, bool refreshStack, QUndoCommand *parent) :
QUndoCommand(parent),
m_bin(bin),
m_clipId(clipId),
m_oldEffect(oldEffect),
m_newEffect(newEffect),
m_ix(ix),
m_refreshStack(false)
m_refreshStack(refreshStack)
{
setText(i18n("Edit Bin Effect"));
}
......
......@@ -109,7 +109,7 @@ private:
class UpdateBinEffectCommand : public QUndoCommand
{
public:
explicit UpdateBinEffectCommand(Bin *bin, const QString &clipId, QDomElement &oldEffect, QDomElement &newEffect, int ix, QUndoCommand *parent = 0);
explicit UpdateBinEffectCommand(Bin *bin, const QString &clipId, QDomElement &oldEffect, QDomElement &newEffect, int ix, bool refreshStack, QUndoCommand *parent = 0);
void undo();
void redo();
private:
......
......@@ -929,7 +929,7 @@ void EffectStackView2::slotResetEffect(int ix)
emit updateEffect(m_clipref, -1, old, dom, ix,true);
} else if (m_status == MASTER_CLIP) {
m_masterclipref->initEffect(m_effectMetaInfo.monitor->profileInfo(), dom);
emit updateMasterEffect(m_masterclipref->clipId(), old, dom, ix);
emit updateMasterEffect(m_masterclipref->clipId(), old, dom, ix,true);
}
}
......
......@@ -266,7 +266,7 @@ signals:
/** Parameters for an effect changed, update the filter in timeline */
void updateEffect(ClipItem*, int, const QDomElement&, const QDomElement &, int,bool);
/** Parameters for an effect changed, update the filter in timeline */
void updateMasterEffect(QString, const QDomElement&, const QDomElement &, int);
void updateMasterEffect(QString, const QDomElement&, const QDomElement &, int ix,bool refreshStack = false);
/** An effect in stack was moved, we need to regenerate
all effects for this clip in the playlist */
void refreshEffectStack(ClipItem *);
......
......@@ -332,7 +332,7 @@ MainWindow::MainWindow(const QString &MltPath, const QUrl &Url, const QString &
connect(pCore->bin(), SIGNAL(masterClipSelected(ClipController *, Monitor *)), m_effectStack, SLOT(slotMasterClipItemSelected(ClipController *, Monitor *)));
connect(pCore->bin(), SIGNAL(masterClipUpdated(ClipController *, Monitor *)), m_effectStack, SLOT(slotRefreshMasterClipEffects(ClipController *, Monitor *)));
connect(m_effectStack, SIGNAL(addMasterEffect(QString,QDomElement)), pCore->bin(), SLOT(slotEffectDropped(QString,QDomElement)));
connect(m_effectStack, SIGNAL(updateMasterEffect(QString,QDomElement,QDomElement,int)), pCore->bin(), SLOT(slotUpdateEffect(QString,QDomElement,QDomElement,int)));
connect(m_effectStack, SIGNAL(updateMasterEffect(QString,QDomElement,QDomElement,int,bool)), pCore->bin(), SLOT(slotUpdateEffect(QString,QDomElement,QDomElement,int,bool)));
connect(m_effectStack, SIGNAL(changeMasterEffectState(QString,QList<int>,bool)), pCore->bin(), SLOT(slotChangeEffectState(QString,QList<int>,bool)));
connect(m_effectStack, SIGNAL(removeMasterEffect(QString,QDomElement)), pCore->bin(), SLOT(slotDeleteEffect(QString,QDomElement)));
connect(m_effectStack, SIGNAL(changeEffectPosition(QString,const QList <int>,int)), pCore->bin(), SLOT(slotMoveEffect(QString,const QList <int>,int)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment