Fix deleting output node (part 2)

This commit is contained in:
shun-iwasawa 2023-04-17 13:19:31 +09:00 committed by manongjohn
parent 5a456adac6
commit 92163602e5
5 changed files with 4 additions and 30 deletions

View file

@ -72,8 +72,6 @@ DVAPI void unlinkFx(TFx *fx, TFxHandle *fxHandle, TXsheetHandle *xshHandle);
DVAPI void makeMacroFx(const std::vector<TFxP> &fxs, TApplication *app);
DVAPI void explodeMacroFx(TMacroFx *macroFx, TApplication *app);
DVAPI void createOutputFx(TXsheetHandle *xshHandle, TFx *currentFx);
DVAPI void removeOutputFx(TFx *fx, TXsheetHandle *xshHandle,
TFxHandle *fxHandle);
DVAPI void makeOutputFxCurrent(TFx *fx, TXsheetHandle *xshHandle);
DVAPI void disconnectNodesFromXsheet(const std::list<TFxP> &fxs,
TXsheetHandle *xshHandle);

View file

@ -213,7 +213,6 @@ protected slots:
void onExplodeMacroFx();
void onOpenMacroFx();
void onSavePresetFx();
void onRemoveOutput();
void onActivateOutput();
void onPreview();
void onCacheFx();

View file

@ -404,7 +404,7 @@ void FxCommandUndo::attach(TXsheet *xsh, const TFxCommand::Link &link,
//------------------------------------------------------
void FxCommandUndo::attachOutputs(TXsheet *xsh, TFx *insertedFx, TFx *inputFx) {
TCG_ASSERT(inputFx, return );
TCG_ASSERT(inputFx, return);
FxDag *fxDag = xsh->getFxDag();
@ -2363,23 +2363,6 @@ static void deleteFxs(const std::list<TFxP> &fxs, TXsheetHandle *xshHandle,
undoManager->endBlock();
}
//**********************************************************************
// Remove Output Fx command
//**********************************************************************
void TFxCommand::removeOutputFx(TFx *fx, TXsheetHandle *xshHandle,
TFxHandle *fxHandle) {
TOutputFx *outputFx = dynamic_cast<TOutputFx *>(fx);
if (!outputFx) return;
std::unique_ptr<FxCommandUndo> undo(
new DeleteFxOrColumnUndo(fx, xshHandle, fxHandle));
if (undo->isConsistent()) {
undo->redo();
TUndoManager::manager()->add(undo.release());
}
}
//**********************************************************************
// Delete Columns command
//**********************************************************************
@ -3318,7 +3301,7 @@ void UndoConnectFxs::GroupData::restore() const {
void UndoConnectFxs::initialize() {
if (!UndoDisconnectFxs::isConsistent()) return;
TCG_ASSERT(m_link.m_inputFx && m_link.m_outputFx, m_fxs.clear(); return );
TCG_ASSERT(m_link.m_inputFx && m_link.m_outputFx, m_fxs.clear(); return);
// Store sensible original data for the undo
m_undoGroupDatas.reserve(m_fxs.size());

View file

@ -1134,7 +1134,7 @@ void FxOutputPainter::contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) {
if (fxScene->getXsheet()->getFxDag()->getOutputFxCount() > 1) {
QAction *removeOutput =
new QAction(createQIcon("delete", false, true), tr("&Delete"), &menu);
connect(removeOutput, SIGNAL(triggered()), fxScene, SLOT(onRemoveOutput()));
connect(removeOutput, SIGNAL(triggered()), fxScene, SLOT(onDeleteFx()));
QAction *activateOutput = new QAction(tr("&Activate"), &menu);
connect(activateOutput, SIGNAL(triggered()), fxScene,
@ -3149,7 +3149,7 @@ FxSchematicColumnNode::FxSchematicColumnNode(FxSchematicScene *scene,
bool ret = true;
ret = ret && connect(m_resizeItem, SIGNAL(toggled(bool)), this,
SLOT(onChangedSize(bool)));
SLOT(onChangedSize(bool)));
ret = ret &&
connect(m_nameItem, SIGNAL(focusOut()), this, SLOT(onNameChanged()));
ret = ret && connect(m_renderToggle, SIGNAL(toggled(bool)), this,

View file

@ -1464,12 +1464,6 @@ void FxSchematicScene::onSavePresetFx() {
//------------------------------------------------------------------
void FxSchematicScene::onRemoveOutput() {
TFxCommand::removeOutputFx(m_fxHandle->getFx(), m_xshHandle, m_fxHandle);
}
//------------------------------------------------------------------
void FxSchematicScene::onActivateOutput() {
TFxCommand::makeOutputFxCurrent(m_fxHandle->getFx(), m_xshHandle);
}