parampanel: close contexts belonging to closing project

This commit is contained in:
itsmattkc
2022-01-02 18:43:27 -08:00
parent 2afa7ecafe
commit 4f9ac4b36d
4 changed files with 24 additions and 0 deletions
+5
View File
@@ -53,6 +53,11 @@ public:
GetParamView()->SetIgnoreNodeFlags(e);
}
void CloseContextsBelongingToProject(Project *p)
{
GetParamView()->CloseContextsBelongingToProject(p);
}
public slots:
void SelectNodes(const QVector<Node*>& nodes);
void DeselectNodes(const QVector<Node*>& nodes);
@@ -163,6 +163,20 @@ NodeParamView::~NodeParamView()
qDeleteAll(context_items_);
}
void NodeParamView::CloseContextsBelongingToProject(Project *p)
{
QVector<Node*> new_contexts = contexts_;
for (int i=0; i<new_contexts.size(); i++) {
if (new_contexts.at(i)->project() == p) {
new_contexts.removeAt(i);
i--;
}
}
SetContexts(new_contexts);
}
/*void NodeParamView::SelectNodes(const QVector<Node *> &nodes)
{
return;
+2
View File
@@ -55,6 +55,8 @@ public:
return input_checked_.value(input);
}
void CloseContextsBelongingToProject(Project *p);
Node* GetTimeTarget() const;
void DeleteSelected();
+3
View File
@@ -371,6 +371,9 @@ void MainWindow::ProjectClose(Project *p)
// Close project from NodeView
node_panel_->CloseContextsBelongingToProject(p);
// Close project from NodeParamView
param_panel_->CloseContextsBelongingToProject(p);
}
void MainWindow::SetApplicationProgressStatus(ProgressStatus status)