From 7a6b586a66b44b5efb0e61ef1da175ab84c00e25 Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Wed, 11 Mar 2020 01:11:54 -0600 Subject: [PATCH] Draft: move ShapeString to the creation tools Previously it was placed in the `annotation` category but since it creates a group of shapes, it is better in the `creation` category. Also small fixes in the menu text and tooltip. --- src/Mod/Draft/DraftTools.py | 18 +++++++++++++----- src/Mod/Draft/InitGui.py | 4 +++- src/Mod/Draft/draftutils/init_tools.py | 5 +++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/Mod/Draft/DraftTools.py b/src/Mod/Draft/DraftTools.py index aa9b520afd..fb3456818f 100644 --- a/src/Mod/Draft/DraftTools.py +++ b/src/Mod/Draft/DraftTools.py @@ -2237,14 +2237,22 @@ class Dimension(Creator): if not self.cont: self.finish() + class ShapeString(Creator): - """This class creates a shapestring feature.""" + """The Draft_ShapeString FreeCAD command definition.""" def GetResources(self): - return {'Pixmap' : 'Draft_ShapeString', - 'Accel' : "S, S", - 'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_ShapeString", "Shape from text..."), - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_ShapeString", "Creates text string in shapes.")} + """Set icon, menu and tooltip.""" + _menu = "Shape from text" + _tooltip = ("Creates a shape from a text string by choosing " + "a specific font and a placement.\n" + "The closed shapes can be used for extrusions " + "and boolean operations.") + d = {'Pixmap': 'Draft_ShapeString', + 'Accel': "S, S", + 'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_ShapeString", _menu), + 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_ShapeString", _tooltip)} + return d def Activated(self): name = translate("draft","ShapeString") diff --git a/src/Mod/Draft/InitGui.py b/src/Mod/Draft/InitGui.py index d864f31af4..ee9cc8f248 100644 --- a/src/Mod/Draft/InitGui.py +++ b/src/Mod/Draft/InitGui.py @@ -1,4 +1,3 @@ -"""Initialization of the Draft workbench (graphical interface).""" # *************************************************************************** # * Copyright (c) 2009 Yorik van Havre * # * * @@ -19,7 +18,10 @@ # * USA * # * * # *************************************************************************** +"""Initialization of the Draft workbench (graphical interface).""" + import os + import FreeCAD import FreeCADGui diff --git a/src/Mod/Draft/draftutils/init_tools.py b/src/Mod/Draft/draftutils/init_tools.py index 6228a41680..44c5cc1b08 100644 --- a/src/Mod/Draft/draftutils/init_tools.py +++ b/src/Mod/Draft/draftutils/init_tools.py @@ -42,12 +42,13 @@ def get_draft_drawing_commands(): "Draft_ArcTools", "Draft_Circle", "Draft_Ellipse", "Draft_Rectangle", "Draft_Polygon", "Draft_BSpline", "Draft_BezierTools", - "Draft_Point", "Draft_Facebinder"] + "Draft_Point", "Draft_Facebinder", + "Draft_ShapeString"] def get_draft_annotation_commands(): """Return the annotation commands list.""" - return ["Draft_Text", "Draft_ShapeString", "Draft_Dimension", + return ["Draft_Text", "Draft_Dimension", "Draft_Label"]