Switch to PartDesign workbench as soon as a PartDesign feature is edited

This commit is contained in:
jrheinlaender
2013-04-25 13:49:56 +04:30
committed by Stefan Tröger
parent 0fd0a5d605
commit 9ca63b603a
15 changed files with 71 additions and 33 deletions

View File

@@ -100,6 +100,9 @@ bool ViewProviderPad::setEdit(int ModNum)
// clear the selection (convenience)
Gui::Selection().clearSelection();
// always change to PartDesign WB, remember where we come from
oldWb = Gui::Command::assureWorkbench("PartDesignWorkbench");
// start the edit dialog
if (padDlg)
Gui::Control().showDialog(padDlg);
@@ -115,10 +118,10 @@ bool ViewProviderPad::setEdit(int ModNum)
void ViewProviderPad::unsetEdit(int ModNum)
{
if (ModNum == ViewProvider::Default) {
// and update the pad
//getSketchObject()->getDocument()->recompute();
// return to the WB we were in before editing the PartDesign feature
Gui::Command::assureWorkbench(oldWb.c_str());
if (ModNum == ViewProvider::Default) {
// when pressing ESC make sure to close the dialog
Gui::Control().closeDialog();
}