various: implemented multiple project support
This required various changes to various parts of the infrastructure (mostly using paths to finding the "root project" of any given object throughout). Now theoretically infinite projects can be opened and accounted for at any given time.
This commit is contained in:
@@ -511,6 +511,11 @@ ProjectViewModel::MoveItemCommand::MoveItemCommand(ProjectViewModel *model,
|
||||
setText(tr("Move Item"));
|
||||
}
|
||||
|
||||
Project *ProjectViewModel::MoveItemCommand::GetRelevantProject() const
|
||||
{
|
||||
return model_->project();
|
||||
}
|
||||
|
||||
void ProjectViewModel::MoveItemCommand::redo_internal()
|
||||
{
|
||||
model_->MoveItemInternal(item_, destination_);
|
||||
@@ -532,6 +537,11 @@ ProjectViewModel::RenameItemCommand::RenameItemCommand(ProjectViewModel* model,
|
||||
setText(tr("Rename Item"));
|
||||
}
|
||||
|
||||
Project *ProjectViewModel::RenameItemCommand::GetRelevantProject() const
|
||||
{
|
||||
return model_->project();
|
||||
}
|
||||
|
||||
void ProjectViewModel::RenameItemCommand::redo_internal()
|
||||
{
|
||||
model_->RenameChild(item_, new_name_);
|
||||
@@ -551,6 +561,11 @@ ProjectViewModel::AddItemCommand::AddItemCommand(ProjectViewModel* model, Item*
|
||||
{
|
||||
}
|
||||
|
||||
Project *ProjectViewModel::AddItemCommand::GetRelevantProject() const
|
||||
{
|
||||
return model_->project();
|
||||
}
|
||||
|
||||
void ProjectViewModel::AddItemCommand::redo_internal()
|
||||
{
|
||||
model_->AddChild(parent_, child_);
|
||||
@@ -572,6 +587,11 @@ ProjectViewModel::RemoveItemCommand::RemoveItemCommand(ProjectViewModel *model,
|
||||
{
|
||||
}
|
||||
|
||||
Project *ProjectViewModel::RemoveItemCommand::GetRelevantProject() const
|
||||
{
|
||||
return model_->project();
|
||||
}
|
||||
|
||||
void ProjectViewModel::RemoveItemCommand::redo_internal()
|
||||
{
|
||||
parent_ = item_->parent();
|
||||
|
||||
Reference in New Issue
Block a user