diff --git a/src/Mod/Part/Gui/Workbench.cpp b/src/Mod/Part/Gui/Workbench.cpp index 98e36e5ede..20dc2b0738 100644 --- a/src/Mod/Part/Gui/Workbench.cpp +++ b/src/Mod/Part/Gui/Workbench.cpp @@ -122,6 +122,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const << "Separator" << bop << join << split << compound << "Separator" + << "Sketcher_NewSketch" << "Part_Extrude" << "Part_Revolve" << "Part_Mirror" @@ -170,7 +171,8 @@ Gui::ToolBarItem* Workbench::setupToolBars() const Gui::ToolBarItem* tool = new Gui::ToolBarItem(root); tool->setCommand("Part tools"); - *tool << "Part_Extrude" + *tool << "Sketcher_NewSketch" + << "Part_Extrude" << "Part_Revolve" << "Part_Mirror" << "Part_Scale" diff --git a/src/Mod/Part/InitGui.py b/src/Mod/Part/InitGui.py index 5e3fecaea6..b3557cfe78 100644 --- a/src/Mod/Part/InitGui.py +++ b/src/Mod/Part/InitGui.py @@ -38,6 +38,21 @@ class PartWorkbench(Gui.Workbench): self.__class__.MenuText = "Part" self.__class__.ToolTip = "Part workbench" + def tryAddManipulator(self): + try: + import SketcherGui + + class Manipulator: + def modifyToolBars(self): + return [{"insert" : "Sketcher_NewSketch", "toolItem" : "Part_Extrude"}] + def modifyMenuBar(self): + return [{"insert" : "Sketcher_NewSketch", "menuItem" : "Part_Extrude"}] + + manip = Manipulator() + Gui.addWorkbenchManipulator(manip) + except ImportError as err: + pass + def Initialize(self): # load the module import PartGui @@ -64,6 +79,8 @@ class PartWorkbench(Gui.Workbench): App.Console.PrintError("'BOPTools' package cannot be loaded. " "{err}\n".format(err=str(err))) + self.tryAddManipulator() + def GetClassName(self): return "PartGui::Workbench"