| 464 | } |
| 465 | |
| 466 | void PageLayout::StackPart(LayoutPart::Pointer newPart, |
| 467 | const QString& viewId, const QString& refId) |
| 468 | { |
| 469 | this->SetRefPart(viewId, newPart); |
| 470 | // force creation of the view layout rec |
| 471 | this->GetViewLayoutRec(viewId, true); |
| 472 | |
| 473 | // If ref part is in a folder than just add the |
| 474 | // new view to that folder. |
| 475 | PartStack::Pointer folder = this->GetFolderPart(refId).Cast<PartStack>(); |
| 476 | if (folder != 0) |
| 477 | { |
| 478 | folder->Add(newPart); |
| 479 | this->SetFolderPart(viewId, folder); |
| 480 | return; |
| 481 | } |
| 482 | |
| 483 | // parts are now always contained in folders |
| 484 | |
| 485 | // // If the ref part is in the page layout then create |
| 486 | // // a new folder and add the new view. |
| 487 | // LayoutPart::Pointer refPart = this->GetRefPart(refId); |
| 488 | // if (refPart != 0) // && (refPart instanceof PartPane || refPart instanceof PartPlaceholder)) |
| 489 | // { |
| 490 | // PartStack::Pointer newFolder(new PartStack(rootLayoutContainer->page)); |
| 491 | // rootLayoutContainer->Replace(refPart, newFolder); |
| 492 | // newFolder->Add(refPart); |
| 493 | // newFolder->Add(newPart); |
| 494 | // this->SetFolderPart(refId, newFolder); |
| 495 | // this->SetFolderPart(viewId, newFolder); |
| 496 | // return; |
| 497 | // } |
| 498 | |
| 499 | // If ref part is not found then just do add. |
| 500 | WorkbenchPlugin::Log("Referenced part does not exist yet: " + refId); |
| 501 | PartStack::Pointer newFolder(new PartStack(rootLayoutContainer->page)); |
| 502 | newFolder->Add(newPart); |
| 503 | this->SetFolderPart(viewId, newFolder); |
| 504 | rootLayoutContainer->Add(newFolder); |
| 505 | } |
| 506 | |
| 507 | void PageLayout::StackPlaceholder(const QString& viewId, |
| 508 | const QString& refId) |
no test coverage detected