[TD]fix update suppression logic
This commit is contained in:
committed by
WandererFan
parent
e7df102e22
commit
aa4ba37a6c
@@ -321,12 +321,7 @@ void DrawPage::requestPaint(void)
|
||||
//this doesn't work right because there is no guaranteed of the restoration order
|
||||
void DrawPage::onDocumentRestored()
|
||||
{
|
||||
if (GlobalUpdateDrawings() &&
|
||||
KeepUpdated.getValue()) {
|
||||
updateAllViews();
|
||||
} else if (!GlobalUpdateDrawings() &&
|
||||
AllowPageOverride() &&
|
||||
KeepUpdated.getValue()) {
|
||||
if (canUpdate()) {
|
||||
updateAllViews();
|
||||
}
|
||||
|
||||
@@ -469,6 +464,20 @@ void DrawPage::handleChangedPropertyType(
|
||||
}
|
||||
}
|
||||
|
||||
bool DrawPage::canUpdate() const
|
||||
{
|
||||
bool result = false;
|
||||
if (GlobalUpdateDrawings() &&
|
||||
KeepUpdated.getValue()) {
|
||||
result = true;
|
||||
} else if (!GlobalUpdateDrawings() &&
|
||||
AllowPageOverride() &&
|
||||
KeepUpdated.getValue()) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//allow/prevent drawing updates for all Pages
|
||||
bool DrawPage::GlobalUpdateDrawings(void)
|
||||
{
|
||||
|
||||
@@ -105,6 +105,8 @@ public:
|
||||
bool forceRedraw(void) { return m_forceRedraw; }
|
||||
void redrawCommand();
|
||||
|
||||
bool canUpdate() const;
|
||||
|
||||
protected:
|
||||
void onBeforeChange(const App::Property* prop) override;
|
||||
void onChanged(const App::Property* prop) override;
|
||||
|
||||
@@ -129,6 +129,9 @@ bool DrawProjGroupItem::showLock(void) const
|
||||
App::DocumentObjectExecReturn *DrawProjGroupItem::execute(void)
|
||||
{
|
||||
// Base::Console().Message("DPGI::execute(%s)\n",Label.getValue());
|
||||
if (!keepUpdated()) {
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
|
||||
bool haveX = checkXDirection();
|
||||
if (!haveX) {
|
||||
|
||||
@@ -547,24 +547,9 @@ bool DrawView::keepUpdated(void)
|
||||
// Base::Console().Message("DV::keepUpdated() - %s\n", getNameInDocument());
|
||||
bool result = false;
|
||||
|
||||
bool pageUpdate = false;
|
||||
bool force = false;
|
||||
TechDraw::DrawPage *page = findParentPage();
|
||||
if(page) {
|
||||
pageUpdate = page->KeepUpdated.getValue();
|
||||
force = page->forceRedraw();
|
||||
}
|
||||
|
||||
if (DrawPage::GlobalUpdateDrawings() &&
|
||||
pageUpdate) {
|
||||
result = true;
|
||||
} else if (!DrawPage::GlobalUpdateDrawings() &&
|
||||
DrawPage::AllowPageOverride() &&
|
||||
pageUpdate) {
|
||||
result = true;
|
||||
}
|
||||
if (force) { //when do we turn this off??
|
||||
result = true;
|
||||
result = page->canUpdate() || page->forceRedraw();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ void ViewProviderPage::finishRestoring()
|
||||
m_docReady = true;
|
||||
//control drawing opening on restore based on Preference
|
||||
//mantis #2967 ph2 - don't even show blank page
|
||||
if (Preferences::keepPagesUpToDate()) {
|
||||
if (getDrawPage()->canUpdate()) {
|
||||
static_cast<void>(showMDIViewPage());
|
||||
}
|
||||
Gui::ViewProviderDocumentObject::finishRestoring();
|
||||
|
||||
Reference in New Issue
Block a user