Skip to content

Commit

Permalink
PartDesign: closing task dialog when exiting edit mode for Primitives
Browse files Browse the repository at this point in the history
=====================================================================

fixes #4241

Problem:

PartDesignGui::ViewProvider is responsible for closing the tasks for most of PD features when exiting edit mode
(i.e. unsetEdit()).

For primitives, PartDesignGui::ViewProviderPrimitive is responsible, and neither does it or relies on its parent
VP to do it when calling unsetEdit().

Solution:

Make PartDesignGui::ViewProviderPrimitive::unsetEdit() rely on parent PartDesignGui::ViewProvider to tidy up,
including closing the task dialog.

Reference:

This is the default stack call when closing a document while a PD task using PartDesignGui::Viewprovider is active:
  • Loading branch information
abdullahtahiriyo committed Jun 8, 2020
1 parent 652d965 commit 11f5500
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Mod/PartDesign/Gui/ViewProviderPrimitive.cpp
Expand Up @@ -123,8 +123,12 @@ bool ViewProviderPrimitive::setEdit(int ModNum)

void ViewProviderPrimitive::unsetEdit(int ModNum)
{
Q_UNUSED(ModNum);
setPreviewDisplayMode(false);

// Rely on parent class to:
// restitute old workbench (set setEdit above) and close the dialog if exiting editing
PartDesignGui::ViewProvider::unsetEdit(ModNum);

}

void ViewProviderPrimitive::updateData(const App::Property* p) {
Expand Down

0 comments on commit 11f5500

Please sign in to comment.