some adjustments on WB auto-switch

This commit is contained in:
jriegel 2012-05-19 17:59:24 +02:00 committed by Stefan Tröger
parent db460cff8a
commit 71b9ded9a1
2 changed files with 7 additions and 5 deletions

View File

@ -142,18 +142,19 @@ void Workbench::activated()
"Part_Box"
));
// set the previous used active Body
if(oldActive != "")
Gui::Command::doCommand(Gui::Command::Doc,"PartDesignGui.setActivePart(App.activeDocument().%s)",oldActive.c_str());
addTaskWatcher(Watcher);
Gui::Control().showTaskView();
// set the previous used active Body
if(oldActive != "")
Gui::Command::doCommand(Gui::Command::Doc,"PartDesignGui.setActivePart(App.activeDocument().%s)",oldActive.c_str());
}
void Workbench::deactivated()
{
removeTaskWatcher();
// remember the body for later activation
if(ActivePartObject)
oldActive = ActivePartObject->getNameInDocument();
@ -163,7 +164,6 @@ void Workbench::deactivated()
Gui::Command::doCommand(Gui::Command::Doc,"PartDesignGui.setActivePart(None)");
Gui::Workbench::deactivated();
removeTaskWatcher();
}

View File

@ -4584,6 +4584,8 @@ void ViewProviderSketch::unsetEdit(int ModNum)
// when pressing ESC make sure to close the dialog
Gui::Control().closeDialog();
//Gui::Application::Instance->
// return to the WB before edeting the sketch
Gui::Command::assureWorkbench(oldWb.c_str());
}