Gui: minor adjustment on command status update

This commit is contained in:
Zheng, Lei
2019-09-04 16:58:03 +08:00
committed by wmayer
parent b69a31c5b5
commit f55b4ca7f7
4 changed files with 10 additions and 2 deletions

View File

@@ -958,6 +958,9 @@ void Application::setActiveDocument(Gui::Document* pcDocument)
{
if (d->activeDocument == pcDocument)
return; // nothing needs to be done
getMainWindow()->updateActions();
if (pcDocument) {
// This happens if a document with more than one view is about being
// closed and a second view is activated. The document is still not

View File

@@ -772,6 +772,8 @@ void Document::slotChangedObject(const App::DocumentObject& Obj, const App::Prop
FC_LOG(Prop.getFullName() << " modified");
setModified(true);
}
getMainWindow()->updateActions(true);
}
void Document::slotRelabelObject(const App::DocumentObject& Obj)

View File

@@ -1001,7 +1001,6 @@ void MainWindow::setActiveWindow(MDIView* view)
onSetActiveSubWindow(view->parentWidget());
d->activeView = view;
Application::Instance->viewActivated(view);
updateActions();
}
void MainWindow::onWindowActivated(QMdiSubWindow* w)
@@ -1025,7 +1024,6 @@ void MainWindow::onWindowActivated(QMdiSubWindow* w)
// set active the appropriate window (it needs not to be part of mdiIds, e.g. directly after creation)
d->activeView = view;
Application::Instance->viewActivated(view);
updateActions();
}
void MainWindow::onWindowsMenuAboutToShow()

View File

@@ -44,6 +44,7 @@
#include <Gui/ViewProvider.h>
#include <Gui/Control.h>
#include <Gui/ActionFunction.h>
#include <Gui/MainWindow.h>
#if defined (QSINT_ACTIONPANEL)
#include <Gui/QSint/actionpanel/taskgroup_p.h>
@@ -613,10 +614,14 @@ void TaskView::showDialog(TaskDialog *dlg)
ActiveDialog = dlg;
ActiveDialog->open();
getMainWindow()->updateActions();
}
void TaskView::removeDialog(void)
{
getMainWindow()->updateActions();
if (ActiveCtrl) {
taskPanel->removeWidget(ActiveCtrl);
delete ActiveCtrl;