Part: Add Sketcher_NewSketch to Part toolbar (#14318)
* Update Workbench.cpp * Part: Update InitGui.py
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user