From 6aeaa5e76c632831eaa823d6dbcd85fa5378270c Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 17 Sep 2017 16:23:16 -0700 Subject: [PATCH] Moved PathPocket into 3d Tools command group with new icon. --- src/Mod/Path/Gui/Resources/Path.qrc | 1 + .../Gui/Resources/icons/Path-3DPocket.svg | 269 ++++++++++++++++++ src/Mod/Path/InitGui.py | 27 +- src/Mod/Path/PathScripts/PathPocketGui.py | 2 +- 4 files changed, 292 insertions(+), 7 deletions(-) create mode 100644 src/Mod/Path/Gui/Resources/icons/Path-3DPocket.svg diff --git a/src/Mod/Path/Gui/Resources/Path.qrc b/src/Mod/Path/Gui/Resources/Path.qrc index a96c10c403..29d5d88875 100644 --- a/src/Mod/Path/Gui/Resources/Path.qrc +++ b/src/Mod/Path/Gui/Resources/Path.qrc @@ -1,5 +1,6 @@ + icons/Path-3DPocket.svg icons/Path-3DSurface.svg icons/Path-Array.svg icons/Path-Axis.svg diff --git a/src/Mod/Path/Gui/Resources/icons/Path-3DPocket.svg b/src/Mod/Path/Gui/Resources/icons/Path-3DPocket.svg new file mode 100644 index 0000000000..4c85acba04 --- /dev/null +++ b/src/Mod/Path/Gui/Resources/icons/Path-3DPocket.svg @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + Path-3DSurface + 2016-05-15 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Path/Gui/Resources/icons/Path-3DSurface.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Path/InitGui.py b/src/Mod/Path/InitGui.py index 45472de51a..219fe76f00 100644 --- a/src/Mod/Path/InitGui.py +++ b/src/Mod/Path/InitGui.py @@ -68,7 +68,7 @@ class PathWorkbench (Workbench): from PathScripts import PathSanity from PathScripts import PathSimpleCopy from PathScripts import PathStop - from PathScripts import PathSurfaceGui + from PathScripts import PathSurface from PathScripts import PathToolController from PathScripts import PathToolLenOffset from PathScripts import PathToolLibraryManager @@ -78,8 +78,8 @@ class PathWorkbench (Workbench): projcmdlist = ["Path_Job", "Path_Post", "Path_Inspect", "Path_Sanity"] toolcmdlist = ["Path_ToolLibraryEdit"] prepcmdlist = ["Path_Plane", "Path_Fixture", "Path_ToolLenOffset", "Path_Comment", "Path_Stop", "Path_Custom", "Path_Shape"] - twodopcmdlist = ["Path_Contour", "Path_Profile_Faces", "Path_Profile_Edges", "Path_Pocket", "Path_Drilling", "Path_Engrave", "Path_MillFace", "Path_Helix"] - threedopcmdlist = ["Path_Surface"] + twodopcmdlist = ["Path_Contour", "Path_Profile_Faces", "Path_Profile_Edges", "Path_Drilling", "Path_Engrave", "Path_MillFace", "Path_Helix"] + threedopcmdlist = ["Path_Pocket", "Path_Surfacing"] modcmdlist = ["Path_OperationCopy", "Path_Array", "Path_SimpleCopy" ] dressupcmdlist = ["PathDressup_Dogbone", "PathDressup_DragKnife", "PathDressup_Tag", "PathDressup_RampEntry"] extracmdlist = ["Path_SelectLoop", "Path_Shape", "Path_Area", "Path_Area_Workplane"] @@ -90,12 +90,27 @@ class PathWorkbench (Workbench): def QT_TRANSLATE_NOOP(scope, text): return text - def translate(context, text): - return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8).encode("utf8") + class ThreeDCommandGroup: + def GetCommands(self): + return tuple(threedopcmdlist) + + def GetResources(self): + return { 'MenuText': QT_TRANSLATE_NOOP("Path",'3D Operations'), + 'ToolTip': QT_TRANSLATE_NOOP("Path",'3D Operations') + } + def IsActive(self): + if FreeCAD.ActiveDocument is not None: + for o in FreeCAD.ActiveDocument.Objects: + if o.Name[:3] == "Job": + return True + return False + + FreeCADGui.addCommand('Path_3dTools', ThreeDCommandGroup()) + self.appendToolbar(QT_TRANSLATE_NOOP("Path", "Project Setup"), projcmdlist) self.appendToolbar(QT_TRANSLATE_NOOP("Path", "Tool Commands"), toolcmdlist) #self.appendToolbar(QT_TRANSLATE_NOOP("Path", "Partial Commands"), prepcmdlist) - self.appendToolbar(QT_TRANSLATE_NOOP("Path", "New Operations"), twodopcmdlist+threedopcmdlist) + self.appendToolbar(QT_TRANSLATE_NOOP("Path", "New Operations"), twodopcmdlist+['Path_3dTools']) self.appendToolbar(QT_TRANSLATE_NOOP("Path", "Path Modification"), modcmdlist) self.appendToolbar(QT_TRANSLATE_NOOP("Path", "Helpful Tools"), extracmdlist) diff --git a/src/Mod/Path/PathScripts/PathPocketGui.py b/src/Mod/Path/PathScripts/PathPocketGui.py index be2b7273ef..1e67a7162d 100644 --- a/src/Mod/Path/PathScripts/PathPocketGui.py +++ b/src/Mod/Path/PathScripts/PathPocketGui.py @@ -44,7 +44,7 @@ class TaskPanelOpPage(PathPocketBaseGui.TaskPanelOpPage): Command = PathOpGui.SetupOperation('Pocket', PathPocket.Create, TaskPanelOpPage, - 'Path-Pocket', + 'Path-3DPocket', QtCore.QT_TRANSLATE_NOOP("PathPocket", "Pocket"), QtCore.QT_TRANSLATE_NOOP("PathPocket", "Creates a Path Pocket object from a face or faces"))