MCPcopy Create free account
hub / github.com/MITK/MITK / UpdateTitle

Method UpdateTitle

Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp:1487–1533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1485}
1486
1487void QmitkExtWorkbenchWindowAdvisor::UpdateTitle(bool editorHidden)
1488{
1489 berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer();
1490 berry::IWorkbenchWindow::Pointer window = configurer->GetWindow();
1491 berry::IEditorPart::Pointer activeEditor;
1492 berry::IWorkbenchPage::Pointer currentPage = window->GetActivePage();
1493 berry::IPerspectiveDescriptor::Pointer persp;
1494 berry::IAdaptable* input = nullptr;
1495
1496 if (currentPage)
1497 {
1498 activeEditor = currentPage->GetActiveEditor();
1499 persp = currentPage->GetPerspective();
1500 input = currentPage->GetInput();
1501 }
1502
1503 if (editorHidden)
1504 {
1505 activeEditor = nullptr;
1506 }
1507
1508 // Nothing to do if the editor hasn't changed
1509 if (activeEditor == lastActiveEditor.Lock() && currentPage == lastActivePage.Lock()
1510 && persp == lastPerspective.Lock() && input == lastInput)
1511 {
1512 return;
1513 }
1514
1515 auto lockedLastActiveEditor = lastActiveEditor.Lock();
1516
1517 if (lockedLastActiveEditor.IsNotNull())
1518 {
1519 lockedLastActiveEditor->RemovePropertyListener(editorPropertyListener.data());
1520 }
1521
1522 lastActiveEditor = activeEditor;
1523 lastActivePage = currentPage;
1524 lastPerspective = persp;
1525 lastInput = input;
1526
1527 if (activeEditor)
1528 {
1529 activeEditor->AddPropertyListener(editorPropertyListener.data());
1530 }
1531
1532 RecomputeTitle();
1533}
1534
1535void QmitkExtWorkbenchWindowAdvisor::PropertyChange(const berry::Object::Pointer& /*source*/, int propId)
1536{

Callers 8

PartActivatedMethod · 0.45
PartBroughtToTopMethod · 0.45
PartClosedMethod · 0.45
PartHiddenMethod · 0.45
PartVisibleMethod · 0.45
PerspectiveActivatedMethod · 0.45
PerspectiveSavedAsMethod · 0.45

Calls 10

GetPerspectiveMethod · 0.80
IsNotNullMethod · 0.80
GetWindowMethod · 0.45
GetActivePageMethod · 0.45
GetActiveEditorMethod · 0.45
GetInputMethod · 0.45
LockMethod · 0.45
dataMethod · 0.45
AddPropertyListenerMethod · 0.45

Tested by

no test coverage detected