Gui: fix several regressions caused by PR #12035

* fix hard crash in MainWindow::_updateActions() if no MDI view exists
* in MDIView::buildWindowTitle() use the label of the document because this changes when saving it while the name is immutable
* fix const correctness in MDIView::buildWindowTitle()
* do not set the modified flag of the main window in MDIView::buildWindowTitle() but in the calling instance
* move setting the main window title to Application::viewActivated to reduce code duplication
* fix missing application name if FreeCADGui is loaded as Python module
This commit is contained in:
wmayer
2024-03-18 21:17:18 +01:00
committed by wwmayer
parent 5839134e95
commit f5baef888c
4 changed files with 20 additions and 16 deletions

View File

@@ -1260,6 +1260,10 @@ void Application::viewActivated(MDIView* pcView)
#endif
signalActivateView(pcView);
getMainWindow()->setWindowTitle(pcView->buildWindowTitle());
if (auto document = pcView->getGuiDocument()) {
getMainWindow()->setWindowModified(document->isModified());
}
// Set the new active document which is taken of the activated view. If, however,
// this view is passive we let the currently active document unchanged as we would