From 3ba2f86034751ce96e994d466b1e559a8f2a149c Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Wed, 29 Apr 2020 20:58:59 -0500 Subject: [PATCH 1/9] Draft: add view provider for BSpline object --- src/Mod/Draft/CMakeLists.txt | 1 + src/Mod/Draft/draftmake/make_bspline.py | 4 +- .../Draft/draftviewproviders/view_bspline.py | 38 +++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 src/Mod/Draft/draftviewproviders/view_bspline.py diff --git a/src/Mod/Draft/CMakeLists.txt b/src/Mod/Draft/CMakeLists.txt index 601eb58f9a..2473d99fdd 100644 --- a/src/Mod/Draft/CMakeLists.txt +++ b/src/Mod/Draft/CMakeLists.txt @@ -113,6 +113,7 @@ SET(Draft_objects SET(Draft_view_providers draftviewproviders/__init__.py draftviewproviders/view_base.py + draftviewproviders/view_bspline.py draftviewproviders/view_circulararray.py draftviewproviders/view_clone.py draftviewproviders/view_facebinder.py diff --git a/src/Mod/Draft/draftmake/make_bspline.py b/src/Mod/Draft/draftmake/make_bspline.py index 9dfa41195a..5f030ab6ef 100644 --- a/src/Mod/Draft/draftmake/make_bspline.py +++ b/src/Mod/Draft/draftmake/make_bspline.py @@ -35,9 +35,9 @@ from draftutils.utils import type_check from draftutils.translate import translate from draftobjects.bspline import BSpline + if App.GuiUp: - # from draftviewproviders.view_bspline import ViewProviderBSpline - from draftviewproviders.view_wire import ViewProviderWire + from draftviewproviders.view_bspline import ViewProviderBSpline def make_bspline(pointslist, closed=False, placement=None, face=None, support=None): diff --git a/src/Mod/Draft/draftviewproviders/view_bspline.py b/src/Mod/Draft/draftviewproviders/view_bspline.py new file mode 100644 index 0000000000..4fb0d35724 --- /dev/null +++ b/src/Mod/Draft/draftviewproviders/view_bspline.py @@ -0,0 +1,38 @@ +# *************************************************************************** +# * Copyright (c) 2020 Eliud Cabrera Castillo * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** +"""Provides the view provider code for BSpline objects. + +At the moment this view provider subclasses the Wire view provider, +and behaves the same as it. In the future this could change +if another behavior is desired. +""" +## @package view_bspline +# \ingroup DRAFT +# \brief Provides the view provider code for BSpline objects. + +from draftviewproviders.view_wire import ViewProviderWire + + +class ViewProviderBSpline(ViewProviderWire): + """The view provider for the BSpline object.""" + + def __init__(self, vobj): + super(ViewProviderBSpline, self).__init__(vobj) From 81029a2b74b61b33045eb0d5f38e7bb62e57327f Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Wed, 29 Apr 2020 22:50:02 -0500 Subject: [PATCH 2/9] Draft: add view provider for Bezier curve object --- src/Mod/Draft/CMakeLists.txt | 1 + src/Mod/Draft/draftmake/make_bezcurve.py | 3 +- .../Draft/draftviewproviders/view_bezier.py | 38 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/Mod/Draft/draftviewproviders/view_bezier.py diff --git a/src/Mod/Draft/CMakeLists.txt b/src/Mod/Draft/CMakeLists.txt index 2473d99fdd..99aadd4aae 100644 --- a/src/Mod/Draft/CMakeLists.txt +++ b/src/Mod/Draft/CMakeLists.txt @@ -113,6 +113,7 @@ SET(Draft_objects SET(Draft_view_providers draftviewproviders/__init__.py draftviewproviders/view_base.py + draftviewproviders/view_bezier.py draftviewproviders/view_bspline.py draftviewproviders/view_circulararray.py draftviewproviders/view_clone.py diff --git a/src/Mod/Draft/draftmake/make_bezcurve.py b/src/Mod/Draft/draftmake/make_bezcurve.py index b0d945ce6c..0f8892592b 100644 --- a/src/Mod/Draft/draftmake/make_bezcurve.py +++ b/src/Mod/Draft/draftmake/make_bezcurve.py @@ -36,8 +36,7 @@ from draftutils.translate import translate from draftobjects.bezcurve import BezCurve if App.GuiUp: - # from draftviewproviders.view_bezcurve import ViewProviderBezCurve - from draftviewproviders.view_wire import ViewProviderWire + from draftviewproviders.view_bezier import ViewProviderBezCurve def make_bezcurve(pointslist, closed=False, placement=None, face=None, support=None, degree=None): diff --git a/src/Mod/Draft/draftviewproviders/view_bezier.py b/src/Mod/Draft/draftviewproviders/view_bezier.py new file mode 100644 index 0000000000..e3f2394a6e --- /dev/null +++ b/src/Mod/Draft/draftviewproviders/view_bezier.py @@ -0,0 +1,38 @@ +# *************************************************************************** +# * Copyright (c) 2020 Eliud Cabrera Castillo * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** +"""Provides the view provider code for Bezier curve objects. + +At the moment this view provider subclasses the Wire view provider, +and behaves the same as it. In the future this could change +if another behavior is desired. +""" +## @package view_bezier +# \ingroup DRAFT +# \brief Provides the view provider code for Bezier curve objects. + +from draftviewproviders.view_wire import ViewProviderWire + + +class ViewProviderBezCurve(ViewProviderWire): + """The view provider for the Bezier curve object.""" + + def __init__(self, vobj): + super(ViewProviderBezCurve, self).__init__(vobj) From 6b2e9d0a6da40944b400854f7ce0ba8f2c79fa9d Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 30 Apr 2020 11:35:53 +0200 Subject: [PATCH 3/9] Gui: [skip ci] remove superfluous word --- src/Gui/QuantitySpinBox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 8588141550..2410ed4b6f 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -259,7 +259,7 @@ QuantitySpinBox::QuantitySpinBox(QWidget *parent) iconLabel->setStyleSheet(QString::fromLatin1("QLabel { border: none; padding: 0px; padding-top: %2px; width: %1px; height: %1px }").arg(iconHeight).arg(frameWidth/2)); iconLabel->hide(); lineEdit()->setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth)); - // When a style sheet is set the text margins must for top/bottom must be set to avoid to squash the widget + // When a style sheet is set the text margins for top/bottom must be set to avoid to squash the widget lineEdit()->setTextMargins(0, 2, 0, 2); QObject::connect(iconLabel, SIGNAL(clicked()), this, SLOT(openFormulaDialog())); From 244639c2bf6cf8dc6e38f1956f36561c17009bfe Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Wed, 29 Apr 2020 07:22:41 -0400 Subject: [PATCH 4/9] [skip-ci] Fix typos in Draft, Mesh, and src/Tools Found via codespell v1.17.0.dev0 ``` codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml ``` --- src/Mod/Draft/draftguitools/gui_drawing.py | 2 +- src/Mod/Draft/draftguitools/gui_move.py | 4 ++-- src/Mod/Draft/draftguitools/gui_offset.py | 4 ++-- src/Mod/Draft/draftguitools/gui_rotate.py | 4 ++-- src/Mod/Draft/draftguitools/gui_scale.py | 2 +- src/Mod/Draft/draftobjects/base.py | 4 ++-- src/Mod/Draft/draftviewproviders/view_base.py | 20 +++++++++---------- src/Mod/Fem/femsolver/calculix/writer.py | 2 +- src/Mod/Mesh/App/Core/Segmentation.cpp | 2 +- src/Mod/Mesh/App/MeshTexture.h | 2 +- src/Tools/generateBase/generateDS.py | 2 +- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Mod/Draft/draftguitools/gui_drawing.py b/src/Mod/Draft/draftguitools/gui_drawing.py index 3735f1f08e..37b2cfaa8d 100644 --- a/src/Mod/Draft/draftguitools/gui_drawing.py +++ b/src/Mod/Draft/draftguitools/gui_drawing.py @@ -30,7 +30,7 @@ that is displayed in a drawing page in the Drawing Workbench. This command should be considered obsolete as the Drawing Workbench is obsolete since 0.17. -A similar command is not planed for the TechDraw Workbench because +A similar command is not planned for the TechDraw Workbench because it is not really necessary. TechDraw has its own set of tools to create 2D projections of 2D and 3D objects. """ diff --git a/src/Mod/Draft/draftguitools/gui_move.py b/src/Mod/Draft/draftguitools/gui_move.py index 08915264f6..39103ed6d5 100644 --- a/src/Mod/Draft/draftguitools/gui_move.py +++ b/src/Mod/Draft/draftguitools/gui_move.py @@ -134,7 +134,7 @@ class Move(gui_base_original.Modifier): self.handle_mouse_click_event(arg) def handle_mouse_move_event(self, arg): - """Hande the mouse when moving.""" + """Handle the mouse when moving.""" for ghost in self.ghosts: ghost.off() self.point, ctrlPoint, info = gui_tool_utils.getPoint(self, arg) @@ -150,7 +150,7 @@ class Move(gui_base_original.Modifier): gui_tool_utils.redraw3DView() def handle_mouse_click_event(self, arg): - """Hande the mouse when the first button is clicked.""" + """Handle the mouse when the first button is clicked.""" if not self.ghosts: self.set_ghosts() if not self.point: diff --git a/src/Mod/Draft/draftguitools/gui_offset.py b/src/Mod/Draft/draftguitools/gui_offset.py index 20beb5e474..401f317fe4 100644 --- a/src/Mod/Draft/draftguitools/gui_offset.py +++ b/src/Mod/Draft/draftguitools/gui_offset.py @@ -22,14 +22,14 @@ # * USA * # * * # *************************************************************************** -"""Provides tools for offseting objects with the Draft Workbench. +"""Provides tools for offsetting objects with the Draft Workbench. It mostly works on lines, polylines, and similar objects with regular geometrical shapes, like rectangles. """ ## @package gui_offset # \ingroup DRAFT -# \brief Provides tools for offseting objects with the Draft Workbench. +# \brief Provides tools for offsetting objects with the Draft Workbench. import math from PySide.QtCore import QT_TRANSLATE_NOOP diff --git a/src/Mod/Draft/draftguitools/gui_rotate.py b/src/Mod/Draft/draftguitools/gui_rotate.py index d486516980..d1424f935b 100644 --- a/src/Mod/Draft/draftguitools/gui_rotate.py +++ b/src/Mod/Draft/draftguitools/gui_rotate.py @@ -123,7 +123,7 @@ class Rotate(gui_base_original.Modifier): self.handle_mouse_click_event(arg) def handle_mouse_move_event(self, arg): - """Hande the mouse when moving.""" + """Handle the mouse when moving.""" plane = App.DraftWorkingPlane for ghost in self.ghosts: @@ -175,7 +175,7 @@ class Rotate(gui_base_original.Modifier): gui_tool_utils.redraw3DView() def handle_mouse_click_event(self, arg): - """Hande the mouse when the first button is clicked.""" + """Handle the mouse when the first button is clicked.""" if not self.point: return if self.step == 0: diff --git a/src/Mod/Draft/draftguitools/gui_scale.py b/src/Mod/Draft/draftguitools/gui_scale.py index 3b5ed86313..6e1c8f14c1 100644 --- a/src/Mod/Draft/draftguitools/gui_scale.py +++ b/src/Mod/Draft/draftguitools/gui_scale.py @@ -79,7 +79,7 @@ class Scale(gui_base_original.Modifier): self.get_object_selection() def get_object_selection(self): - """Get object selection and proceed if succesful.""" + """Get object selection and proceed if successful.""" if Gui.Selection.getSelection(): return self.proceed() self.ui.selectUi() diff --git a/src/Mod/Draft/draftobjects/base.py b/src/Mod/Draft/draftobjects/base.py index 4b5775e6f6..1674f1e6e4 100644 --- a/src/Mod/Draft/draftobjects/base.py +++ b/src/Mod/Draft/draftobjects/base.py @@ -124,7 +124,7 @@ class DraftObject(object): By default it does nothing. - Paramaters + Parameters ---------- obj : the scripted object. This commonly may be of types `Part::Part2DObjectPython`, @@ -140,7 +140,7 @@ class DraftObject(object): By default it does nothing. - Paramaters + Parameters ---------- obj : the scripted object. This commonly may be of types `Part::Part2DObjectPython`, diff --git a/src/Mod/Draft/draftviewproviders/view_base.py b/src/Mod/Draft/draftviewproviders/view_base.py index 8880066365..466ffe0180 100644 --- a/src/Mod/Draft/draftviewproviders/view_base.py +++ b/src/Mod/Draft/draftviewproviders/view_base.py @@ -155,7 +155,7 @@ class ViewProviderDraft(object): Override this method to set up a custom scene. - Paramaters + Parameters ---------- vobj : the view provider of the scripted object. This is `obj.ViewObject`. @@ -196,7 +196,7 @@ class ViewProviderDraft(object): By default it returns an empty list. - Paramaters + Parameters ---------- vobj : the view provider of the scripted object. This is `obj.ViewObject`. @@ -232,7 +232,7 @@ class ViewProviderDraft(object): By default since they have the same names nothing needs to be done, and it just returns the input `mode`. - Paramaters + Parameters ---------- str A string defining a display mode such as @@ -252,7 +252,7 @@ class ViewProviderDraft(object): the properties `TextureImage`, `Pattern`, `DiffuseColor`, and `PatternSize` change. - Paramaters + Parameters ---------- vobj : the view provider of the scripted object. This is `obj.ViewObject`. @@ -341,7 +341,7 @@ class ViewProviderDraft(object): By default it does nothing. - Paramaters + Parameters ---------- vobj : the view provider of the scripted object. This is `obj.ViewObject`. @@ -361,7 +361,7 @@ class ViewProviderDraft(object): :: Gui.runCommand('Draft_Edit') - Paramaters + Parameters ---------- vobj : the view provider of the scripted object. This is `obj.ViewObject`. @@ -374,7 +374,7 @@ class ViewProviderDraft(object): Returns ------- bool - It is `True` if `mode` is 0, and `Draft_Edit` ran succesfully. + It is `True` if `mode` is 0, and `Draft_Edit` ran successfully. It is `False` otherwise. """ if mode == 0 and App.GuiUp: #remove guard after splitting every viewprovider @@ -401,7 +401,7 @@ class ViewProviderDraft(object): App.activeDraftCommand.finish() Gui.Control.closeDialog() - Paramaters + Parameters ---------- vobj : the view provider of the scripted object. This is `obj.ViewObject`. @@ -487,7 +487,7 @@ _ViewProviderDraft = ViewProviderDraft class ViewProviderDraftAlt(ViewProviderDraft): """A view provider that doesn't absorb its base object in the tree view. - The `claimChildren` method is overriden to return an empty list. + The `claimChildren` method is overridden to return an empty list. """ def __init__(self, vobj): @@ -504,7 +504,7 @@ _ViewProviderDraftAlt = ViewProviderDraftAlt class ViewProviderDraftPart(ViewProviderDraftAlt): """A view provider that displays a Part icon instead of a Draft icon. - The `getIcon` method is overriden to provide `Tree_Part.svg`. + The `getIcon` method is overridden to provide `Tree_Part.svg`. """ def __init__(self, vobj): diff --git a/src/Mod/Fem/femsolver/calculix/writer.py b/src/Mod/Fem/femsolver/calculix/writer.py index 526f3fae5e..c01874a93c 100644 --- a/src/Mod/Fem/femsolver/calculix/writer.py +++ b/src/Mod/Fem/femsolver/calculix/writer.py @@ -187,7 +187,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter): # mesh def write_mesh(self, inpfile_split=None): # write mesh to file - element_param = 1 # hightest element order only + element_param = 1 # highest element order only group_param = False # do not write mesh group data if inpfile_split is True: write_name = "femesh" diff --git a/src/Mod/Mesh/App/Core/Segmentation.cpp b/src/Mod/Mesh/App/Core/Segmentation.cpp index fe8790dcde..cbe49c0eaa 100644 --- a/src/Mod/Mesh/App/Core/Segmentation.cpp +++ b/src/Mod/Mesh/App/Core/Segmentation.cpp @@ -201,7 +201,7 @@ CylinderSurfaceFit::CylinderSurfaceFit() /*! * \brief CylinderSurfaceFit::CylinderSurfaceFit - * Set a pre-defined cylinder. Internal cylinder fits are not done, then. + * Set a predefined cylinder. Internal cylinder fits are not done, then. */ CylinderSurfaceFit::CylinderSurfaceFit(const Base::Vector3f& b, const Base::Vector3f& a, float r) : basepoint(b) diff --git a/src/Mod/Mesh/App/MeshTexture.h b/src/Mod/Mesh/App/MeshTexture.h index b82c94812c..8f6b279a18 100644 --- a/src/Mod/Mesh/App/MeshTexture.h +++ b/src/Mod/Mesh/App/MeshTexture.h @@ -37,7 +37,7 @@ namespace Mesh /*! The MeshTexture class. This algorithm is useful to update the material after a mesh has been modified by removing points or facets. If the coordinates of points have changed or if - new points have been added then a pre-defined color will be set. + new points have been added then a predefined color will be set. @author Werner Mayer */ class MeshExport MeshTexture diff --git a/src/Tools/generateBase/generateDS.py b/src/Tools/generateBase/generateDS.py index 5bd7ffe460..8c2559bd16 100644 --- a/src/Tools/generateBase/generateDS.py +++ b/src/Tools/generateBase/generateDS.py @@ -3205,7 +3205,7 @@ Usage: python generateDS.py [ options ] Options: -o Output file name for data representation classes -s Output file name for subclasses - -p Prefix string to be pre-pended to the class names + -p Prefix string to be prepended to the class names -n Transform names with table in mappingfilename. -f Force creation of output files. Do not ask. -a Namespace abbreviation, e.g. "xsd:". Default = 'xs:'. From 52d03926e60fbff9a566fd3cf1bfa3be76c584e3 Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Tue, 28 Apr 2020 18:48:50 -0500 Subject: [PATCH 5/9] Gui: change string from Document to Documentation The add property dialog (introduced by the LinkMerge) previously showed "Document" which is confusing. The edit box is there to provide an explanation on the new property, that is, "Documentation". Also improve the tooltips. Also change "Append" to "Prefix" in the checkbox as it's more clear that the `Group` is added at the beginning to form the full name of the property. --- src/Gui/DlgAddProperty.ui | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/Gui/DlgAddProperty.ui b/src/Gui/DlgAddProperty.ui index 31059b42f6..ef45352f9b 100644 --- a/src/Gui/DlgAddProperty.ui +++ b/src/Gui/DlgAddProperty.ui @@ -6,7 +6,7 @@ 0 0 - 354 + 418 258 @@ -15,7 +15,7 @@ - + Type @@ -25,7 +25,7 @@ - + Group @@ -35,7 +35,7 @@ - + Name @@ -45,22 +45,33 @@ - + + + Verbose description of the new property. + - Document + Documentation - + + + Verbose description of the new property. + + - Append the group name in front of the property name in the form of 'group'_'name' to avoid conflict with existing property. The prefixed group name will be auto trimmed when shown in the property editor. + Prefix the property name with the group name in the form 'Group_Name' to avoid conflicts with an existing property. +In this case the prefix will be automatically trimmed when shown in the property editor. +However, the property is still used in a script with the full name, like 'obj.Group_Name'. + +If this is not ticked, then the property must be uniquely named, and it is accessed like 'obj.Name'. - Append group name + Prefix group name From b2e63db460c51eed252b99962ccd1adfa63fe51d Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Tue, 28 Apr 2020 11:06:46 -0500 Subject: [PATCH 6/9] Gui: add sWhatsThis to Std_DrawStyle --- src/Gui/CommandView.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index dda1a12b77..24b18a6602 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -575,8 +575,9 @@ StdCmdDrawStyle::StdCmdDrawStyle() { sGroup = QT_TR_NOOP("Standard-View"); sMenuText = QT_TR_NOOP("Draw style"); - sToolTipText = QT_TR_NOOP("Draw style"); - sStatusTip = QT_TR_NOOP("Draw style"); + sToolTipText = QT_TR_NOOP("Change the draw style of the objects"); + sStatusTip = QT_TR_NOOP("Change the draw style of the objects"); + sWhatsThis = "Std_DrawStyle"; sPixmap = "DrawStyleAsIs"; eType = Alter3DView; From c34ef270187b6fb4199d67fd704fe27dfbbdecdc Mon Sep 17 00:00:00 2001 From: carlopav Date: Thu, 30 Apr 2020 10:37:42 +0200 Subject: [PATCH 7/9] Draft: fix bspline and bezcurve viewproviders Finished to fix bspline and bezcurve wiewproviders. --- src/Mod/Draft/CMakeLists.txt | 2 +- src/Mod/Draft/Draft.py | 8 ++++---- src/Mod/Draft/draftmake/make_bezcurve.py | 2 +- .../{view_bezier.py => view_bezcurve.py} | 3 +++ src/Mod/Draft/draftviewproviders/view_bspline.py | 3 +++ 5 files changed, 12 insertions(+), 6 deletions(-) rename src/Mod/Draft/draftviewproviders/{view_bezier.py => view_bezcurve.py} (97%) diff --git a/src/Mod/Draft/CMakeLists.txt b/src/Mod/Draft/CMakeLists.txt index 99aadd4aae..338cee7245 100644 --- a/src/Mod/Draft/CMakeLists.txt +++ b/src/Mod/Draft/CMakeLists.txt @@ -113,7 +113,7 @@ SET(Draft_objects SET(Draft_view_providers draftviewproviders/__init__.py draftviewproviders/view_base.py - draftviewproviders/view_bezier.py + draftviewproviders/view_bezcurve.py draftviewproviders/view_bspline.py draftviewproviders/view_circulararray.py draftviewproviders/view_clone.py diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 0e282950da..2c4caf1dce 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -222,15 +222,15 @@ if FreeCAD.GuiUp: from draftmake.make_bspline import make_bspline, makeBSpline from draftobjects.bspline import BSpline, _BSpline if FreeCAD.GuiUp: - # for compatibility with older versions - _ViewProviderBSpline = ViewProviderWire + from draftviewproviders.view_bspline import ViewProviderBSpline + from draftviewproviders.view_bspline import _ViewProviderBSpline # bezcurve from draftmake.make_bezcurve import make_bezcurve, makeBezCurve from draftobjects.bezcurve import BezCurve, _BezCurve if FreeCAD.GuiUp: - # for compatibility with older versions - _ViewProviderBezCurve = ViewProviderWire + from draftviewproviders.view_bezcurve import ViewProviderBezCurve + from draftviewproviders.view_bezcurve import _ViewProviderBezCurve # clone from draftmake.make_clone import make_clone, clone diff --git a/src/Mod/Draft/draftmake/make_bezcurve.py b/src/Mod/Draft/draftmake/make_bezcurve.py index 0f8892592b..ea6d39137d 100644 --- a/src/Mod/Draft/draftmake/make_bezcurve.py +++ b/src/Mod/Draft/draftmake/make_bezcurve.py @@ -36,7 +36,7 @@ from draftutils.translate import translate from draftobjects.bezcurve import BezCurve if App.GuiUp: - from draftviewproviders.view_bezier import ViewProviderBezCurve + from draftviewproviders.view_bezcurve import ViewProviderBezCurve def make_bezcurve(pointslist, closed=False, placement=None, face=None, support=None, degree=None): diff --git a/src/Mod/Draft/draftviewproviders/view_bezier.py b/src/Mod/Draft/draftviewproviders/view_bezcurve.py similarity index 97% rename from src/Mod/Draft/draftviewproviders/view_bezier.py rename to src/Mod/Draft/draftviewproviders/view_bezcurve.py index e3f2394a6e..502ef3caa4 100644 --- a/src/Mod/Draft/draftviewproviders/view_bezier.py +++ b/src/Mod/Draft/draftviewproviders/view_bezcurve.py @@ -36,3 +36,6 @@ class ViewProviderBezCurve(ViewProviderWire): def __init__(self, vobj): super(ViewProviderBezCurve, self).__init__(vobj) + + +_ViewProviderBezCurve = ViewProviderBezCurve \ No newline at end of file diff --git a/src/Mod/Draft/draftviewproviders/view_bspline.py b/src/Mod/Draft/draftviewproviders/view_bspline.py index 4fb0d35724..0bb162a012 100644 --- a/src/Mod/Draft/draftviewproviders/view_bspline.py +++ b/src/Mod/Draft/draftviewproviders/view_bspline.py @@ -36,3 +36,6 @@ class ViewProviderBSpline(ViewProviderWire): def __init__(self, vobj): super(ViewProviderBSpline, self).__init__(vobj) + + +_ViewProviderBSpline = ViewProviderBSpline \ No newline at end of file From 3da68ba3c541f3d0557cef22eb6481d438d41036 Mon Sep 17 00:00:00 2001 From: carlopav Date: Thu, 30 Apr 2020 13:18:49 +0200 Subject: [PATCH 8/9] Draft: fix to statusbar import on wb Activated and Deactivated Import statusbar related functions only if snapper is loaded added new line at the end --- src/Mod/Draft/InitGui.py | 8 ++++---- src/Mod/Draft/draftviewproviders/view_bezcurve.py | 2 +- src/Mod/Draft/draftviewproviders/view_bspline.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Mod/Draft/InitGui.py b/src/Mod/Draft/InitGui.py index 66330e4c3a..8df1888a92 100644 --- a/src/Mod/Draft/InitGui.py +++ b/src/Mod/Draft/InitGui.py @@ -130,8 +130,8 @@ class DraftWorkbench(FreeCADGui.Workbench): FreeCADGui.draftToolBar.Activated() if hasattr(FreeCADGui, "Snapper"): FreeCADGui.Snapper.show() - import draftutils.init_draft_statusbar as dsb - dsb.show_draft_statusbar() + import draftutils.init_draft_statusbar as dsb + dsb.show_draft_statusbar() FreeCAD.Console.PrintLog("Draft workbench activated.\n") def Deactivated(self): @@ -140,8 +140,8 @@ class DraftWorkbench(FreeCADGui.Workbench): FreeCADGui.draftToolBar.Deactivated() if hasattr(FreeCADGui, "Snapper"): FreeCADGui.Snapper.hide() - import draftutils.init_draft_statusbar as dsb - dsb.hide_draft_statusbar() + import draftutils.init_draft_statusbar as dsb + dsb.hide_draft_statusbar() FreeCAD.Console.PrintLog("Draft workbench deactivated.\n") def ContextMenu(self, recipient): diff --git a/src/Mod/Draft/draftviewproviders/view_bezcurve.py b/src/Mod/Draft/draftviewproviders/view_bezcurve.py index 502ef3caa4..5e3a44d6a1 100644 --- a/src/Mod/Draft/draftviewproviders/view_bezcurve.py +++ b/src/Mod/Draft/draftviewproviders/view_bezcurve.py @@ -38,4 +38,4 @@ class ViewProviderBezCurve(ViewProviderWire): super(ViewProviderBezCurve, self).__init__(vobj) -_ViewProviderBezCurve = ViewProviderBezCurve \ No newline at end of file +_ViewProviderBezCurve = ViewProviderBezCurve diff --git a/src/Mod/Draft/draftviewproviders/view_bspline.py b/src/Mod/Draft/draftviewproviders/view_bspline.py index 0bb162a012..248e763ac9 100644 --- a/src/Mod/Draft/draftviewproviders/view_bspline.py +++ b/src/Mod/Draft/draftviewproviders/view_bspline.py @@ -38,4 +38,4 @@ class ViewProviderBSpline(ViewProviderWire): super(ViewProviderBSpline, self).__init__(vobj) -_ViewProviderBSpline = ViewProviderBSpline \ No newline at end of file +_ViewProviderBSpline = ViewProviderBSpline From 501b11a03d4398a87e871d2d8da525f10eff90a8 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 30 Apr 2020 14:53:37 +0200 Subject: [PATCH 9/9] Gui: [skip ci] fixes #0004330: The Std_WhatsThis command does not work for 2 submenus of the View menu. --- src/Gui/Command.cpp | 1 + src/Gui/CommandLink.cpp | 10 +++++++--- src/Gui/CommandView.cpp | 13 ++++++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index cd5fb7f4cd..cbe4f5d98f 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -987,6 +987,7 @@ Action * GroupCommand::createAction(void) { pcAction->setDropDownMenu(true); pcAction->setExclusive(false); pcAction->setCheckable(true); + pcAction->setWhatsThis(QString::fromLatin1(sWhatsThis)); for(auto &v : cmds) { if(!v.first) diff --git a/src/Gui/CommandLink.cpp b/src/Gui/CommandLink.cpp index 3a6e6f3c2a..1e699caa55 100644 --- a/src/Gui/CommandLink.cpp +++ b/src/Gui/CommandLink.cpp @@ -96,9 +96,13 @@ Action * StdCmdLinkMakeGroup::createAction(void) applyCommandData(this->className(), pcAction); // add the action items - pcAction->addAction(QObject::tr("Simple group")); - pcAction->addAction(QObject::tr("Group with links")); - pcAction->addAction(QObject::tr("Group with transform links")); + QAction* action = nullptr; + action = pcAction->addAction(QObject::tr("Simple group")); + action->setWhatsThis(QString::fromLatin1(sWhatsThis)); + action = pcAction->addAction(QObject::tr("Group with links")); + action->setWhatsThis(QString::fromLatin1(sWhatsThis)); + action = pcAction->addAction(QObject::tr("Group with transform links")); + action->setWhatsThis(QString::fromLatin1(sWhatsThis)); return pcAction; } diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 24b18a6602..0426c17b61 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -255,11 +255,15 @@ Action * StdCmdFreezeViews::createAction(void) // add the action items saveView = pcAction->addAction(QObject::tr("Save views...")); - pcAction->addAction(QObject::tr("Load views...")); + saveView->setWhatsThis(QString::fromLatin1(sWhatsThis)); + QAction* loadView = pcAction->addAction(QObject::tr("Load views...")); + loadView->setWhatsThis(QString::fromLatin1(sWhatsThis)); pcAction->addAction(QString::fromLatin1(""))->setSeparator(true); freezeView = pcAction->addAction(QObject::tr("Freeze view")); freezeView->setShortcut(QString::fromLatin1(sAccel)); + freezeView->setWhatsThis(QString::fromLatin1(sWhatsThis)); clearView = pcAction->addAction(QObject::tr("Clear views")); + clearView->setWhatsThis(QString::fromLatin1(sWhatsThis)); separator = pcAction->addAction(QString::fromLatin1("")); separator->setSeparator(true); offset = pcAction->actions().count(); @@ -596,36 +600,43 @@ Gui::Action * StdCmdDrawStyle::createAction(void) a0->setChecked(true); a0->setObjectName(QString::fromLatin1("Std_DrawStyleAsIs")); a0->setShortcut(QKeySequence(QString::fromUtf8("V,1"))); + a0->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a1 = pcAction->addAction(QString()); a1->setCheckable(true); a1->setIcon(BitmapFactory().iconFromTheme("DrawStylePoints")); a1->setObjectName(QString::fromLatin1("Std_DrawStylePoints")); a1->setShortcut(QKeySequence(QString::fromUtf8("V,2"))); + a1->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a2 = pcAction->addAction(QString()); a2->setCheckable(true); a2->setIcon(BitmapFactory().iconFromTheme("DrawStyleWireFrame")); a2->setObjectName(QString::fromLatin1("Std_DrawStyleWireframe")); a2->setShortcut(QKeySequence(QString::fromUtf8("V,3"))); + a2->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a3 = pcAction->addAction(QString()); a3->setCheckable(true); a3->setIcon(BitmapFactory().iconFromTheme("DrawStyleHiddenLine")); a3->setObjectName(QString::fromLatin1("Std_DrawStyleHiddenLine")); a3->setShortcut(QKeySequence(QString::fromUtf8("V,4"))); + a3->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a4 = pcAction->addAction(QString()); a4->setCheckable(true); a4->setIcon(BitmapFactory().iconFromTheme("DrawStyleNoShading")); a4->setObjectName(QString::fromLatin1("Std_DrawStyleNoShading")); a4->setShortcut(QKeySequence(QString::fromUtf8("V,5"))); + a4->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a5 = pcAction->addAction(QString()); a5->setCheckable(true); a5->setIcon(BitmapFactory().iconFromTheme("DrawStyleShaded")); a5->setObjectName(QString::fromLatin1("Std_DrawStyleShaded")); a5->setShortcut(QKeySequence(QString::fromUtf8("V,6"))); + a5->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a6 = pcAction->addAction(QString()); a6->setCheckable(true); a6->setIcon(BitmapFactory().iconFromTheme("DrawStyleFlatLines")); a6->setObjectName(QString::fromLatin1("Std_DrawStyleFlatLines")); a6->setShortcut(QKeySequence(QString::fromUtf8("V,7"))); + a6->setWhatsThis(QString::fromLatin1(sWhatsThis)); pcAction->setIcon(a0->icon());