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 ce224298a7
commit 8682b5f490
15 changed files with 71 additions and 33 deletions

View File

@@ -92,8 +92,9 @@ bool ViewProviderPocket::setEdit(int ModNum)
// clear the selection (convenience)
Gui::Selection().clearSelection();
//if(ModNum == ViewProvider::Default)
// Gui::Command::openCommand("Change pocket parameters");
// always change to PartDesign WB, remember where we come from
oldWb = Gui::Command::assureWorkbench("PartDesignWorkbench");
// start the edit dialog
if (padDlg)
@@ -110,10 +111,10 @@ bool ViewProviderPocket::setEdit(int ModNum)
void ViewProviderPocket::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();
}